Thierry FOURNIER | a5ec06d | 2017-04-10 23:47:23 +0200 | [diff] [blame] | 1 | DESTDIR = |
| 2 | PREFIX = /usr/local |
| 3 | BINDIR = $(PREFIX)/bin |
| 4 | |
David Carlier | 0f4df64 | 2017-06-06 10:20:51 +0100 | [diff] [blame] | 5 | CC ?= gcc |
Thierry FOURNIER | a5ec06d | 2017-04-10 23:47:23 +0200 | [diff] [blame] | 6 | LD = $(CC) |
| 7 | |
| 8 | ifeq ($(MODSEC_INC),) |
| 9 | MODSEC_INC := modsecurity-2.9.1/INSTALL/include |
| 10 | endif |
| 11 | |
| 12 | ifeq ($(MODSEC_LIB),) |
| 13 | MODSEC_LIB := modsecurity-2.9.1/INSTALL/lib |
| 14 | endif |
| 15 | |
| 16 | ifeq ($(APACHE2_INC),) |
| 17 | APACHE2_INC := /usr/include/apache2 |
| 18 | endif |
| 19 | |
| 20 | ifeq ($(APR_INC),) |
| 21 | APR_INC := /usr/include/apr-1.0 |
| 22 | endif |
| 23 | |
| 24 | ifeq ($(LIBXML_INC),) |
| 25 | LIBXML_INC := /usr/include/libxml2 |
| 26 | endif |
| 27 | |
David Carlier | 0f4df64 | 2017-06-06 10:20:51 +0100 | [diff] [blame] | 28 | ifeq ($(EVENT_LIB),) |
| 29 | EVENT_LIB := -levent |
| 30 | endif |
| 31 | |
| 32 | ifeq ($(EVENT_INC),) |
| 33 | EVENT_INC := /usr/include |
| 34 | endif |
| 35 | |
| 36 | CFLAGS += -g -Wall -pthread |
David Carlier | 0f4df64 | 2017-06-06 10:20:51 +0100 | [diff] [blame] | 37 | INCS += -I../../include -I../../ebtree -I$(MODSEC_INC) -I$(APACHE2_INC) -I$(APR_INC) -I$(LIBXML_INC) -I$(EVENT_INC) |
Christian Ruppert | 57dc283 | 2017-11-30 10:11:36 +0100 | [diff] [blame] | 38 | LIBS += -lpthread $(EVENT_LIB) -levent_pthreads -lcurl -lapr-1 -laprutil-1 -lxml2 -lpcre -lyajl |
Thierry FOURNIER | a5ec06d | 2017-04-10 23:47:23 +0200 | [diff] [blame] | 39 | |
| 40 | OBJS = spoa.o modsec_wrapper.o |
| 41 | |
| 42 | modsecurity: $(OBJS) |
Christian Ruppert | 57dc283 | 2017-11-30 10:11:36 +0100 | [diff] [blame] | 43 | $(LD) $(LDFLAGS) -o $@ $^ $(MODSEC_LIB)/standalone.a $(LIBS) |
Thierry FOURNIER | a5ec06d | 2017-04-10 23:47:23 +0200 | [diff] [blame] | 44 | |
| 45 | install: modsecurity |
| 46 | install modsecurity $(DESTDIR)$(BINDIR) |
| 47 | |
| 48 | clean: |
| 49 | rm -f modsecurity $(OBJS) |
| 50 | |
| 51 | %.o: %.c |
| 52 | $(CC) $(CFLAGS) $(INCS) -c -o $@ $< |