2 # test programs invoked via standard user interface, run on all platforms
4 # test modules invoked through the abts suite (./testall)
6 # programs such as sendfile, that have to be invoked in a special sequence
7 # or with special parameters
11 # dynamic or static - refers to which set of bindings are desired
12 # and controls which libraries (apr-1 or libapr-1) will be linked.
14 # the library path of the libraries, and also the path within test/
15 # where all of the tests for that library will be built
17 # The library path of apr (if different from OUTDIR)
19 # relative or absolute path to locate apr libs and includes
21 # relative or absolute path to locate apr-iconv libs and includes
28 !IF "$(MODEL)" == "static"
34 !IF [$(COMSPEC) /c cl /nologo /? \
35 | $(SystemRoot)\System32\find.exe "x64" >NUL ] == 0
40 !IF !EXIST("$(OUTDIR)\.")
41 !IF ([$(COMSPEC) /C mkdir $(OUTDIR)] == 0)
48 !IF !EXIST("$(INTDIR)\.")
49 !IF ([$(COMSPEC) /C mkdir $(INTDIR)] == 0)
54 !MESSAGE Building tests into $(OUTDIR) for $(MODEL)
56 ALL_TESTS = $(INTDIR)\teststrmatch.obj $(INTDIR)\testuri.obj \
57 $(INTDIR)\testuuid.obj $(INTDIR)\testutil.obj \
58 $(INTDIR)\testbuckets.obj $(INTDIR)\testpass.obj \
59 $(INTDIR)\testmd4.obj $(INTDIR)\testmd5.obj \
60 $(INTDIR)\testldap.obj $(INTDIR)\testdbd.obj \
61 $(INTDIR)\testdbm.obj $(INTDIR)\testreslist.obj \
62 $(INTDIR)\testxml.obj $(INTDIR)\testqueue.obj \
63 $(INTDIR)\testrmm.obj $(INTDIR)\testxlate.obj \
64 $(INTDIR)\testdate.obj $(INTDIR)\testmemcache.obj \
65 $(INTDIR)\testcrypto.obj
67 CLEAN_DATA = manyfile.bin testfile.txt data\sqlite*.db
69 CLEAN_BUILDDIRS = Debug Release LibD LibR 9x x64
77 # bring in rules.mk for standard functionality
78 ALL: $(PROGRAMS) $(OTHER_PROGRAMS)
84 API_PATH = ..\..\apr-iconv
88 !IF "$(MODEL)" == "static"
89 PROGRAM_DEPENDENCIES = \
90 $(APR_PATH)\$(APROUTDIR)\apr-1.lib \
91 $(API_PATH)\$(OUTDIR)\apriconv-1.lib \
92 ..\xml\expat\lib\$(OUTDIR)\xml.lib \
93 ..\$(OUTDIR)\aprutil-1.lib
94 STATIC_CFLAGS = /D APR_DECLARE_STATIC /D APU_DECLARE_STATIC
95 STATIC_LIBS = odbc32.lib odbccp32.lib wldap32.lib
97 PROGRAM_DEPENDENCIES = \
98 $(APR_PATH)\$(APROUTDIR)\libapr-1.lib \
99 ..\$(OUTDIR)\libaprutil-1.lib
101 # APR 1.3 doesn't fully abstract ldap_ calls to permit switching providers;
102 STATIC_LIBS = wldap32.lib
111 INCLUDES=/I "../include" /I "$(API_PATH)/include" /I "$(APR_PATH)/include"
113 CFLAGS = /nologo /c /W3 /Gm /EHsc /Zi /Od $(INCLUDES) \
114 $(STATIC_CFLAGS) $(DEBUG_CFLAGS) /D "BINPATH=$(OUTDIR:\=/)" \
115 /D _DEBUG /D WIN32 /Fo"$(INTDIR)/" /FD
117 LD_LIBS = kernel32.lib advapi32.lib ws2_32.lib wsock32.lib \
118 ole32.lib shell32.lib rpcrt4.lib $(STATIC_LIBS)
120 LDFLAGS = /nologo /debug /subsystem:console /incremental:no
121 SHLDFLAGS = /nologo /dll /debug /subsystem:windows /incremental:no
124 $(CL) $(CFLAGS) -c $< -Fd$(INTDIR)\ $(INCLUDES)
128 abts.c: abts.h abts_tests.h testutil.h
130 testutil.c: abts.h abts_tests.h testutil.h
132 $(OUTDIR)\testall.exe: $(ALL_TESTS) $(INTDIR)\abts.obj $(PROGRAM_DEPENDENCIES)
133 $(LD) $(LDFLAGS) /out:"$@" $** $(LD_LIBS)
134 @if exist "$@.manifest" \
135 mt.exe -manifest "$@.manifest" -outputresource:$@;1
139 $(OUTDIR)\dbd.exe: $(INTDIR)\dbd.obj $(PROGRAM_DEPENDENCIES)
140 $(LD) $(LDFLAGS) /out:"$@" $** $(LD_LIBS)
141 @if exist "$@.manifest" \
142 mt.exe -manifest "$@.manifest" -outputresource:$@;1
146 @for %f in ($(CLEAN_DATA)) do @if EXIST %f del /f %f
149 @if EXIST $(INTDIR)\. rmdir /s /q $(INTDIR)
150 @if EXIST $(OUTDIR)\. rmdir /s /q $(OUTDIR)
153 @for %d in ($(CLEAN_BUILDDIRS) $(INTDIR) $(OUTDIR)) do \
154 @if EXIST %d\. rmdir /s /q %d
157 !IF "$(MODEL)" != "static"
158 PATH=$(OUTDIR);..\$(OUTDIR);..\ldap\$(OUTDIR);..\dbd\$(OUTDIR);$(API_PATH)\$(OUTDIR);$(APR_PATH)\$(APROUTDIR);$(PATH)
160 APR_ICONV1_PATH=$(API_PATH)\$(OUTDIR)\iconv
162 check: $(PROGRAMS) $(OTHER_PROGRAMS)
163 echo Testing dbd sqlite2 && $(OUTDIR)\dbd.exe sqlite2 || echo Failed
164 echo Testing dbd sqlite3 && $(OUTDIR)\dbd.exe sqlite3 || echo Failed
165 @for %p in ($(PROGRAMS)) do @( \
166 echo Testing %p && %p -v || echo %p failed \