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