Thierry FOURNIER | a5ec06d | 2017-04-10 23:47:23 +0200 | [diff] [blame^] | 1 | DESTDIR = |
| 2 | PREFIX = /usr/local |
| 3 | BINDIR = $(PREFIX)/bin |
| 4 | |
| 5 | CC = gcc |
| 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 | |
| 28 | CFLAGS = -g -Wall -pthread |
| 29 | LDFLAGS = -lpthread -levent -levent_pthreads -lcurl -lapr-1 -laprutil-1 -lxml2 -lpcre -lyajl |
| 30 | INCS += -I../../include -I../../ebtree -I$(MODSEC_INC) -I$(APACHE2_INC) -I$(APR_INC) -I$(LIBXML_INC) |
| 31 | LIBS = |
| 32 | |
| 33 | OBJS = spoa.o modsec_wrapper.o |
| 34 | |
| 35 | modsecurity: $(OBJS) |
| 36 | $(LD) $(LDFLAGS) $(LIBS) -o $@ $^ $(MODSEC_LIB)/standalone.a |
| 37 | |
| 38 | install: modsecurity |
| 39 | install modsecurity $(DESTDIR)$(BINDIR) |
| 40 | |
| 41 | clean: |
| 42 | rm -f modsecurity $(OBJS) |
| 43 | |
| 44 | %.o: %.c |
| 45 | $(CC) $(CFLAGS) $(INCS) -c -o $@ $< |