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 |
| 37 | LDFLAGS += -lpthread $(EVENT_LIB) -levent_pthreads -lcurl -lapr-1 -laprutil-1 -lxml2 -lpcre -lyajl |
| 38 | INCS += -I../../include -I../../ebtree -I$(MODSEC_INC) -I$(APACHE2_INC) -I$(APR_INC) -I$(LIBXML_INC) -I$(EVENT_INC) |
Thierry FOURNIER | a5ec06d | 2017-04-10 23:47:23 +0200 | [diff] [blame] | 39 | LIBS = |
| 40 | |
| 41 | OBJS = spoa.o modsec_wrapper.o |
| 42 | |
| 43 | modsecurity: $(OBJS) |
| 44 | $(LD) $(LDFLAGS) $(LIBS) -o $@ $^ $(MODSEC_LIB)/standalone.a |
| 45 | |
| 46 | install: modsecurity |
| 47 | install modsecurity $(DESTDIR)$(BINDIR) |
| 48 | |
| 49 | clean: |
| 50 | rm -f modsecurity $(OBJS) |
| 51 | |
| 52 | %.o: %.c |
| 53 | $(CC) $(CFLAGS) $(INCS) -c -o $@ $< |