blob: 93119b3b619851811175a7266cb6931f05d3a72e [file] [log] [blame]
Thierry FOURNIERa5ec06d2017-04-10 23:47:23 +02001DESTDIR =
2PREFIX = /usr/local
3BINDIR = $(PREFIX)/bin
4
David Carlier0f4df642017-06-06 10:20:51 +01005CC ?= gcc
Thierry FOURNIERa5ec06d2017-04-10 23:47:23 +02006LD = $(CC)
7
8ifeq ($(MODSEC_INC),)
9MODSEC_INC := modsecurity-2.9.1/INSTALL/include
10endif
11
12ifeq ($(MODSEC_LIB),)
13MODSEC_LIB := modsecurity-2.9.1/INSTALL/lib
14endif
15
16ifeq ($(APACHE2_INC),)
17APACHE2_INC := /usr/include/apache2
18endif
19
20ifeq ($(APR_INC),)
21APR_INC := /usr/include/apr-1.0
22endif
23
24ifeq ($(LIBXML_INC),)
25LIBXML_INC := /usr/include/libxml2
26endif
27
David Carlier0f4df642017-06-06 10:20:51 +010028ifeq ($(EVENT_LIB),)
29EVENT_LIB := -levent
30endif
31
32ifeq ($(EVENT_INC),)
33EVENT_INC := /usr/include
34endif
35
36CFLAGS += -g -Wall -pthread
Willy Tarreaufc80e302020-05-27 11:05:33 +020037INCS += -I../../include -I$(MODSEC_INC) -I$(APACHE2_INC) -I$(APR_INC) -I$(LIBXML_INC) -I$(EVENT_INC)
Christian Ruppert57dc2832017-11-30 10:11:36 +010038LIBS += -lpthread $(EVENT_LIB) -levent_pthreads -lcurl -lapr-1 -laprutil-1 -lxml2 -lpcre -lyajl
Thierry FOURNIERa5ec06d2017-04-10 23:47:23 +020039
40OBJS = spoa.o modsec_wrapper.o
41
42modsecurity: $(OBJS)
Christian Ruppert57dc2832017-11-30 10:11:36 +010043 $(LD) $(LDFLAGS) -o $@ $^ $(MODSEC_LIB)/standalone.a $(LIBS)
Thierry FOURNIERa5ec06d2017-04-10 23:47:23 +020044
45install: modsecurity
46 install modsecurity $(DESTDIR)$(BINDIR)
47
48clean:
49 rm -f modsecurity $(OBJS)
50
51%.o: %.c
52 $(CC) $(CFLAGS) $(INCS) -c -o $@ $<