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