mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-08-14 05:45:59 +03:00
Building with --enable-standalone-module was failing due the lack of the reference to the msc_json.c file inside the standalone/Makefile.am. This patch also place the dependency of the yajl to the nginx module config script.
80 lines
2.4 KiB
Makefile
80 lines
2.4 KiB
Makefile
###########################################################################
|
|
#
|
|
# Usage: NMAKE -f Makefile.win APACHE={httpd installion dir} PCRE={pcre dir} LIBXML2={LibXML2 dir} [ LUA={Lua dir} ]
|
|
#
|
|
!IF "$(APACHE)" == "" || "$(PCRE)" == "" || "$(LIBXML2)" == ""
|
|
!ERROR NMAKE arguments: APACHE=dir PCRE=dir LIBXML2=dir are required to build mod_security2 for Windows
|
|
!ENDIF
|
|
|
|
# Linking libraries
|
|
LIBS = $(APACHE)\lib\libhttpd.lib \
|
|
$(APACHE)\lib\libapr-1.lib \
|
|
$(APACHE)\lib\libaprutil-1.lib \
|
|
$(PCRE)\pcre.lib \
|
|
$(LIBXML2)\win32\bin.msvc\libxml2.lib \
|
|
Ws2_32.lib \
|
|
"iphlpapi.lib"
|
|
|
|
###########################################################################
|
|
###########################################################################
|
|
|
|
CC = CL
|
|
|
|
MT = mt
|
|
|
|
DEFS = /nologo /O2 /LD /W3 /wd4244 /wd4018 -DWIN32 -DWINNT -Dinline=APR_INLINE -D$(VERSION)
|
|
|
|
DLL = mod_security2.so
|
|
|
|
INCLUDES = -I. -I.. \
|
|
-I$(PCRE)\include -I$(PCRE) \
|
|
-I$(LIBXML2)\include \
|
|
-I$(APACHE)\include
|
|
|
|
# Lua is optional
|
|
!IF "$(LUA)" != ""
|
|
LIBS = $(LIBS) $(LUA)\lua5.1.lib
|
|
DEFS=$(DEFS) -DWITH_LUA
|
|
INCLUDES = $(INCLUDES) -I$(LUA)\include -I$(LUA) \
|
|
!ENDIF
|
|
|
|
# Yajl/Json is optional
|
|
!IF "$(YAJL)" != ""
|
|
LIBS = $(LIBS) $(YAJL)\yajl.lib
|
|
DEFS=$(DEFS) -DWITH_YAJL
|
|
INCLUDES = $(INCLUDES) -I$(YAJL)\include -I$(YAJL) \
|
|
!ENDIF
|
|
|
|
CFLAGS= -MD $(INCLUDES) $(DEFS)
|
|
|
|
LDFLAGS =
|
|
|
|
OBJS = mod_security2.obj apache2_config.obj apache2_io.obj apache2_util.obj \
|
|
re.obj re_operators.obj re_actions.obj re_tfns.obj re_variables.obj \
|
|
msc_logging.obj msc_xml.obj msc_multipart.obj modsecurity.obj \
|
|
msc_parsers.obj msc_util.obj msc_pcre.obj persist_dbm.obj \
|
|
msc_reqbody.obj msc_geo.obj msc_gsb.obj msc_crypt.obj msc_tree.obj msc_unicode.obj acmp.obj msc_lua.obj \
|
|
msc_release.obj libinjection\libinjection_sqli.obj \
|
|
msc_status_engine.obj \
|
|
msc_json.obj
|
|
|
|
all: $(DLL)
|
|
|
|
dll: $(DLL)
|
|
|
|
.c.obj:
|
|
$(CC) $(CFLAGS) -c $< -Fo$@
|
|
|
|
.cpp.obj:
|
|
$(CC) $(CFLAGS) -c $< -Fo$@
|
|
|
|
$(DLL): $(OBJS)
|
|
$(CC) $(CFLAGS) $(LDFLAGS) -LD $(OBJS) -Fe$(DLL) $(LIBS) /link
|
|
IF EXIST $(DLL).manifest $(MT) -manifest $(DLL).manifest -outputresource:$(DLL);2
|
|
|
|
install: $(DLL)
|
|
copy /Y $(DLL) $(APACHE)\modules
|
|
|
|
clean:
|
|
del $(OBJS) $(DLL) *.dll *.lib *.pdb *.idb *.ilk *.exp *.res *.rc *.bin *.manifest
|