2017-04-10 21:47:23 +00:00
|
|
|
DESTDIR =
|
|
|
|
PREFIX = /usr/local
|
|
|
|
BINDIR = $(PREFIX)/bin
|
|
|
|
|
2017-06-06 09:20:51 +00:00
|
|
|
CC ?= gcc
|
2017-04-10 21:47:23 +00:00
|
|
|
LD = $(CC)
|
|
|
|
|
|
|
|
ifeq ($(MODSEC_INC),)
|
|
|
|
MODSEC_INC := modsecurity-2.9.1/INSTALL/include
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(MODSEC_LIB),)
|
|
|
|
MODSEC_LIB := modsecurity-2.9.1/INSTALL/lib
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(APACHE2_INC),)
|
|
|
|
APACHE2_INC := /usr/include/apache2
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(APR_INC),)
|
|
|
|
APR_INC := /usr/include/apr-1.0
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(LIBXML_INC),)
|
|
|
|
LIBXML_INC := /usr/include/libxml2
|
|
|
|
endif
|
|
|
|
|
2017-06-06 09:20:51 +00:00
|
|
|
ifeq ($(EVENT_LIB),)
|
|
|
|
EVENT_LIB := -levent
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(EVENT_INC),)
|
|
|
|
EVENT_INC := /usr/include
|
|
|
|
endif
|
|
|
|
|
|
|
|
CFLAGS += -g -Wall -pthread
|
2020-05-27 09:05:33 +00:00
|
|
|
INCS += -I../../include -I$(MODSEC_INC) -I$(APACHE2_INC) -I$(APR_INC) -I$(LIBXML_INC) -I$(EVENT_INC)
|
2017-11-30 09:11:36 +00:00
|
|
|
LIBS += -lpthread $(EVENT_LIB) -levent_pthreads -lcurl -lapr-1 -laprutil-1 -lxml2 -lpcre -lyajl
|
2017-04-10 21:47:23 +00:00
|
|
|
|
|
|
|
OBJS = spoa.o modsec_wrapper.o
|
|
|
|
|
|
|
|
modsecurity: $(OBJS)
|
2017-11-30 09:11:36 +00:00
|
|
|
$(LD) $(LDFLAGS) -o $@ $^ $(MODSEC_LIB)/standalone.a $(LIBS)
|
2017-04-10 21:47:23 +00:00
|
|
|
|
|
|
|
install: modsecurity
|
|
|
|
install modsecurity $(DESTDIR)$(BINDIR)
|
|
|
|
|
|
|
|
clean:
|
|
|
|
rm -f modsecurity $(OBJS)
|
|
|
|
|
|
|
|
%.o: %.c
|
|
|
|
$(CC) $(CFLAGS) $(INCS) -c -o $@ $<
|