blob: fa3d2eba5c2f39bb0f6454632c80173568d4f846 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
|
# PROGRAMS
# test programs invoked via standard user interface, run on all platforms
# ALL_TESTS
# test modules invoked through the abts suite (./testall)
# OTHER_PROGRAMS
# programs such as sendfile, that have to be invoked in a special sequence
# or with special parameters
# Windows Specific;
# MODEL
# dynamic or static - refers to which set of bindings are desired
# and controls which libraries (apr-1 or libapr-1) will be linked.
# OUTDIR
# the library path of the libraries, and also the path within test/
# where all of the tests for that library will be built
# APROUTDIR
# The library path of apr (if different from OUTDIR)
# APR_PATH
# relative or absolute path to locate apr libs and includes
# API_PATH
# relative or absolute path to locate apr-iconv libs and includes
!IFNDEF MODEL
MODEL=dynamic
!ENDIF
!IFNDEF OUTDIR
!IF "$(MODEL)" == "static"
OUTDIR=LibR
!ELSE
OUTDIR=Release
!ENDIF
!IF [$(COMSPEC) /c cl /nologo /? \
| $(SystemRoot)\System32\find.exe "x64" >NUL ] == 0
OUTDIR=x64\$(OUTDIR)
!ENDIF
!ENDIF
!IF !EXIST("$(OUTDIR)\.")
!IF ([$(COMSPEC) /C mkdir $(OUTDIR)] == 0)
!ENDIF
!ENDIF
!IFNDEF INTDIR
INTDIR=$(OUTDIR)
!ELSE
!IF !EXIST("$(INTDIR)\.")
!IF ([$(COMSPEC) /C mkdir $(INTDIR)] == 0)
!ENDIF
!ENDIF
!ENDIF
!MESSAGE Building tests into $(OUTDIR) for $(MODEL)
ALL_TESTS = $(INTDIR)\teststrmatch.obj $(INTDIR)\testuri.obj \
$(INTDIR)\testuuid.obj $(INTDIR)\testutil.obj \
$(INTDIR)\testbuckets.obj $(INTDIR)\testpass.obj \
$(INTDIR)\testmd4.obj $(INTDIR)\testmd5.obj \
$(INTDIR)\testldap.obj $(INTDIR)\testdbd.obj \
$(INTDIR)\testdbm.obj $(INTDIR)\testreslist.obj \
$(INTDIR)\testxml.obj $(INTDIR)\testqueue.obj \
$(INTDIR)\testrmm.obj $(INTDIR)\testxlate.obj \
$(INTDIR)\testdate.obj $(INTDIR)\testmemcache.obj \
$(INTDIR)\testredis.obj $(INTDIR)\testsiphash.obj \
$(INTDIR)\testcrypto.obj
CLEAN_DATA = manyfile.bin testfile.txt data\sqlite*.db
CLEAN_BUILDDIRS = Debug Release LibD LibR 9x x64
PROGRAMS = \
$(OUTDIR)\testall.exe
OTHER_PROGRAMS = \
$(OUTDIR)\dbd.exe
# bring in rules.mk for standard functionality
ALL: $(PROGRAMS) $(OTHER_PROGRAMS)
CL = cl.exe
LD = link.exe
APR_PATH = ..\..\apr
API_PATH = ..\..\apr-iconv
APROUTDIR=$(OUTDIR)
!IF "$(MODEL)" == "static"
PROGRAM_DEPENDENCIES = \
$(APR_PATH)\$(APROUTDIR)\apr-1.lib \
$(API_PATH)\$(OUTDIR)\apriconv-1.lib \
..\$(OUTDIR)\aprutil-1.lib
STATIC_CFLAGS = /D APR_DECLARE_STATIC /D APU_DECLARE_STATIC
STATIC_LIBS = libexpatMT.lib odbc32.lib odbccp32.lib wldap32.lib
!ELSE
PROGRAM_DEPENDENCIES = \
$(APR_PATH)\$(APROUTDIR)\libapr-1.lib \
..\$(OUTDIR)\libaprutil-1.lib
STATIC_CFLAGS =
# APR 1.3 doesn't fully abstract ldap_ calls to permit switching providers;
STATIC_LIBS = wldap32.lib
!ENDIF
!IFDEF _DEBUG
DEBUG_CFLAGS = /MDd
!ELSE
DEBUG_CFLAGS = /MD
!ENDIF
INCLUDES=/I "../include" /I "$(API_PATH)/include" /I "$(APR_PATH)/include"
CFLAGS = /nologo /c /W3 /Gm /EHsc /Zi /Od $(INCLUDES) \
$(STATIC_CFLAGS) $(DEBUG_CFLAGS) /D "BINPATH=$(OUTDIR:\=/)" \
/D _DEBUG /D WIN32 /Fo"$(INTDIR)/" /FD
LD_LIBS = kernel32.lib advapi32.lib ws2_32.lib wsock32.lib \
ole32.lib shell32.lib rpcrt4.lib $(STATIC_LIBS)
LDFLAGS = /nologo /debug /subsystem:console /incremental:no
SHLDFLAGS = /nologo /dll /debug /subsystem:windows /incremental:no
.c{$(INTDIR)}.obj::
$(CL) $(CFLAGS) -c $< -Fd$(INTDIR)\ $(INCLUDES)
# PROGRAMS;
abts.c: abts.h abts_tests.h testutil.h
testutil.c: abts.h abts_tests.h testutil.h
$(OUTDIR)\testall.exe: $(ALL_TESTS) $(INTDIR)\abts.obj $(PROGRAM_DEPENDENCIES)
$(LD) $(LDFLAGS) /out:"$@" $** $(LD_LIBS)
@if exist "$@.manifest" \
mt.exe -manifest "$@.manifest" -outputresource:$@;1
# OTHER_PROGRAMS;
$(OUTDIR)\dbd.exe: $(INTDIR)\dbd.obj $(PROGRAM_DEPENDENCIES)
$(LD) $(LDFLAGS) /out:"$@" $** $(LD_LIBS)
@if exist "$@.manifest" \
mt.exe -manifest "$@.manifest" -outputresource:$@;1
cleandata:
@for %f in ($(CLEAN_DATA)) do @if EXIST %f del /f %f
clean: cleandata
@if EXIST $(INTDIR)\. rmdir /s /q $(INTDIR)
@if EXIST $(OUTDIR)\. rmdir /s /q $(OUTDIR)
cleanall:
@for %d in ($(CLEAN_BUILDDIRS) $(INTDIR) $(OUTDIR)) do \
@if EXIST %d\. rmdir /s /q %d
!IF "$(MODEL)" != "static"
PATH=$(OUTDIR);..\$(OUTDIR);..\ldap\$(OUTDIR);..\dbd\$(OUTDIR);$(API_PATH)\$(OUTDIR);$(APR_PATH)\$(APROUTDIR);$(PATH)
!ENDIF
APR_ICONV1_PATH=$(API_PATH)\$(OUTDIR)\iconv
check: $(PROGRAMS) $(OTHER_PROGRAMS)
echo Testing dbd sqlite2 && $(OUTDIR)\dbd.exe sqlite2 || echo Failed
echo Testing dbd sqlite3 && $(OUTDIR)\dbd.exe sqlite3 || echo Failed
@for %p in ($(PROGRAMS)) do @( \
echo Testing %p && %p -v || echo %p failed \
)
checkall: check
# DO NOT REMOVE
|