Imported Upstream version 2.5.11
[libapache-mod-security.git] / apache2 / Makefile.in
1 # Makefile for ModSecurity
2
3 MOD_SECURITY2 = mod_security2 apache2_config apache2_io apache2_util \
4     re re_operators re_actions re_tfns re_variables \
5     msc_logging msc_xml msc_multipart modsecurity msc_parsers msc_util msc_pcre \
6     persist_dbm msc_reqbody pdf_protect msc_geo acmp msc_lua msc_release
7
8 MSC_TEST = re re_operators re_actions re_tfns re_variables \
9     msc_logging msc_xml msc_multipart modsecurity \
10     msc_parsers msc_util msc_pcre  persist_dbm \
11     msc_reqbody msc_geo acmp msc_lua msc_release
12
13 MOD_SECURITY2_H = re.h modsecurity.h msc_logging.h msc_multipart.h msc_parsers.h \
14     msc_pcre.h msc_util.h msc_xml.h persist_dbm.h apache2.h pdf_protect.h \
15     msc_geo.h acmp.h utf8tables.h msc_lua.h msc_release.h
16
17 CC = @APXS_CC@
18 LIBTOOL = @APXS_LIBTOOL@
19 PERL = @PERL@
20 EXTRA_CFLAGS = @EXTRA_CFLAGS@
21 MODSEC_EXTRA_CFLAGS = @MODSEC_EXTRA_CFLAGS@
22
23 ### Note: must be in APXS format: -Wc,-flag
24 APXS_EXTRA_CFLAGS = @APXS_EXTRA_CFLAGS@
25 MODSEC_APXS_EXTRA_CFLAGS = @MODSEC_APXS_EXTRA_CFLAGS@
26
27 APXS = @APXS@
28 APXS_WRAPPER = @APXS_WRAPPER@
29 APXS_INCLUDEDIR = @APXS_INCLUDEDIR@
30 APXS_INCLUDES = @APXS_INCLUDES@
31 APXS_CFLAGS = @APXS_CFLAGS@
32 APXS_LDFLAGS = @APXS_LDFLAGS@
33 APXS_LIBS = @APXS_LIBS@
34
35 PCRE_CFLAGS = @PCRE_CFLAGS@
36 PCRE_LIBS = @PCRE_LIBS@
37
38 LUA_CFLAGS = @LUA_CFLAGS@
39 LUA_LIBS = @LUA_LIBS@
40
41 LIBXML2_CFLAGS = @LIBXML2_CFLAGS@
42 LIBXML2_LIBS = @LIBXML2_LIBS@
43
44 APR_CFLAGS = @APR_CFLAGS@
45 APR_LDFLAGS = @APR_LDFLAGS@
46 APR_LIBS = @APR_LIBS@
47 APR_LINK_LD = @APR_LINK_LD@
48
49 APU_CFLAGS = @APU_CFLAGS@
50 APU_LDFLAGS = @APU_LDFLAGS@
51 APU_LIBS = @APU_LIBS@
52 APU_LINK_LD = @APU_LINK_LD@
53
54 CPPFLAGS = @CPPFLAGS@ $(PCRE_CFLAGS) $(LIBXML2_CFLAGS) $(LUA_CFLAGS) 
55 LIBS = @LIBS@ $(PCRE_LIBS) $(LIBXML2_LIBS) $(LUA_LIBS)
56 LDFLAGS = @LDFLAGS@
57 CFLAGS = @CFLAGS@
58
59 COMPILE_APACHE_MOD = $(APXS_WRAPPER) -c $(CPPFLAGS) $(LDFLAGS) $(LIBS)
60
61 INSTALL_MOD_SHARED = $(APXS_WRAPPER) -i
62
63 all: mod_security2.la
64
65 install: install-mods
66
67 clean-extras:
68         @for dir in mlogc-src; do \
69             if test -d $$dir; then \
70                         (cd $$dir && $(MAKE) clean); \
71                 fi; \
72         done
73         @rm -rf ../tools/mlogc ../tools/mlogc-batch-load.pl
74
75 clean: clean-extras
76         @rm -rf *.la *.lo *.loT *.o *.slo .libs msc_test msc-test-debug.log
77
78 distclean: clean
79         @rm -rf Makefile mlogc-src/Makefile mlogc-src/mlogc-batch-load.pl ../tools/*.pl t/run-unit-tests.pl t/run-regression-tests.pl t/gen_rx-pm.pl t/csv_rx-pm.pl t/run-tests.pl t/regression/server_root/conf/httpd.conf t/regression/server_root/conf/*.t_*.conf t/regression/server_root/tmp/* t/regression/server_root/logs/*.log t/regression/server_root/logs/audit/* t/regression/server_root/upload/* t/regression/server_root/data/* config config.log config.status build/apxs-wrapper
80
81 maintainer-clean: distclean
82         @rm -rf config config.log config.status configure mod_security2_config.h autoscan.log configure.scan build/libtool.m4 build/config.guess build/config.sub build/ltmain.sh
83
84 install-mods: mod_security2.la
85         $(INSTALL_MOD_SHARED) mod_security2.la
86
87 ${MOD_SECURITY2:=.slo}: $(MOD_SECURITY2_H)
88 ${MOD_SECURITY2:=.lo}: $(MOD_SECURITY2_H)
89 ${MOD_SECURITY2:=.o}: $(MOD_SECURITY2_H})
90
91 mod_security2.la: $(MOD_SECURITY2_H) *.c
92         @src=""; \
93         for f in $(MOD_SECURITY2); do \
94                 src="$$src $$f.c"; \
95         done; \
96         rm -f msc_test msc_test.o msc_test.lo msc_test.slo; \
97         $(COMPILE_APACHE_MOD) $(APXS_EXTRA_CFLAGS) $(MODSEC_APXS_EXTRA_CFLAGS) $$src
98
99 ### MLogC
100 mlogc:
101         @(cd mlogc-src && $(MAKE) mlogc) \
102         && cp -p mlogc-src/mlogc ../tools \
103         && cp -p mlogc-src/mlogc-batch-load.pl ../tools \
104         && echo \
105         && echo "Successfully built \"mlogc\" in ../tools." \
106         && echo "See: mlogc-src/INSTALL" \
107         && echo
108
109 ### Experimental Test Framework (*NIX only right now)
110 msc_test.lo: msc_test.c
111         $(LIBTOOL) --mode=compile $(CC) $(APXS_INCLUDES) $(APXS_CFLAGS) $(CPPFLAGS) $(APR_CFLAGS) $(APU_CFLAGS) -o msc_test.lo -c msc_test.c
112
113 msc_test: $(TESTOBJS) $(MOD_SECURITY2_H}) msc_test.lo 
114         objs=""; \
115         for f in $(MSC_TEST); do \
116                 objs="$$objs $$f.lo"; \
117         done; \
118         $(LIBTOOL) --mode=link $(CC) $$objs -o msc_test msc_test.lo $(LDFLAGS) $(LIBS) $(APR_LINK_LD) $(APU_LINK_LD)
119
120 test: t/run-unit-tests.pl msc_test
121         @rm -f msc-test-debug.log; \
122         $(PERL) t/run-unit-tests.pl
123
124 test-regression: t/run-regression-tests.pl
125         @$(PERL) t/run-regression-tests.pl
126
127 .PHONY: all install clean-extras clean maintainer-clean distclean install-mods test test-regression