Makefile.win revision 253734
1251876Speter# PROGRAMS 2251876Speter# test programs invoked via standard user interface, run on all platforms 3251876Speter# ALL_TESTS 4251876Speter# test modules invoked through the abts suite (./testall) 5251876Speter# OTHER_PROGRAMS 6251876Speter# programs such as sendfile, that have to be invoked in a special sequence 7251876Speter# or with special parameters 8251876Speter 9251876Speter# Windows Specific; 10251876Speter# MODEL 11251876Speter# dynamic or static - refers to which set of bindings are desired 12251876Speter# and controls which libraries (apr-1 or libapr-1) will be linked. 13251876Speter# OUTDIR 14251876Speter# the library path of the libraries, and also the path within test/ 15251876Speter# where all of the tests for that library will be built 16251876Speter# APROUTDIR 17251876Speter# The library path of apr (if different from OUTDIR) 18251876Speter# APR_PATH 19251876Speter# relative or absolute path to locate apr libs and includes 20251876Speter# API_PATH 21251876Speter# relative or absolute path to locate apr-iconv libs and includes 22251876Speter 23251876Speter!IFNDEF MODEL 24251876SpeterMODEL=dynamic 25251876Speter!ENDIF 26251876Speter 27251876Speter!IFNDEF OUTDIR 28251876Speter!IF "$(MODEL)" == "static" 29251876SpeterOUTDIR=LibR 30251876Speter!ELSE 31251876SpeterOUTDIR=Release 32251876Speter!ENDIF 33251876Speter 34251876Speter!IF [$(COMSPEC) /c cl /nologo /? \ 35251876Speter | $(SystemRoot)\System32\find.exe "x64" >NUL ] == 0 36251876SpeterOUTDIR=x64\$(OUTDIR) 37251876Speter!ENDIF 38251876Speter!ENDIF 39251876Speter 40251876Speter!IF !EXIST("$(OUTDIR)\.") 41251876Speter!IF ([$(COMSPEC) /C mkdir $(OUTDIR)] == 0) 42251876Speter!ENDIF 43251876Speter!ENDIF 44251876Speter 45251876Speter!IFNDEF INTDIR 46251876SpeterINTDIR=$(OUTDIR) 47251876Speter!ELSE 48251876Speter!IF !EXIST("$(INTDIR)\.") 49251876Speter!IF ([$(COMSPEC) /C mkdir $(INTDIR)] == 0) 50251876Speter!ENDIF 51251876Speter!ENDIF 52251876Speter!ENDIF 53251876Speter 54251876Speter!MESSAGE Building tests into $(OUTDIR) for $(MODEL) 55251876Speter 56251876SpeterALL_TESTS = $(INTDIR)\teststrmatch.obj $(INTDIR)\testuri.obj \ 57251876Speter $(INTDIR)\testuuid.obj $(INTDIR)\testutil.obj \ 58251876Speter $(INTDIR)\testbuckets.obj $(INTDIR)\testpass.obj \ 59251876Speter $(INTDIR)\testmd4.obj $(INTDIR)\testmd5.obj \ 60251876Speter $(INTDIR)\testldap.obj $(INTDIR)\testdbd.obj \ 61251876Speter $(INTDIR)\testdbm.obj $(INTDIR)\testreslist.obj \ 62251876Speter $(INTDIR)\testxml.obj $(INTDIR)\testqueue.obj \ 63251876Speter $(INTDIR)\testrmm.obj $(INTDIR)\testxlate.obj \ 64253734Speter $(INTDIR)\testdate.obj $(INTDIR)\testmemcache.obj \ 65253734Speter $(INTDIR)\testcrypto.obj 66251876Speter 67251876SpeterCLEAN_DATA = manyfile.bin testfile.txt data\sqlite*.db 68251876Speter 69251876SpeterCLEAN_BUILDDIRS = Debug Release LibD LibR 9x x64 70251876Speter 71251876SpeterPROGRAMS = \ 72251876Speter $(OUTDIR)\testall.exe 73251876Speter 74251876SpeterOTHER_PROGRAMS = \ 75251876Speter $(OUTDIR)\dbd.exe 76251876Speter 77251876Speter# bring in rules.mk for standard functionality 78251876SpeterALL: $(PROGRAMS) $(OTHER_PROGRAMS) 79251876Speter 80251876SpeterCL = cl.exe 81251876SpeterLD = link.exe 82251876Speter 83251876SpeterAPR_PATH = ..\..\apr 84251876SpeterAPI_PATH = ..\..\apr-iconv 85251876Speter 86251876SpeterAPROUTDIR=$(OUTDIR) 87251876Speter 88251876Speter!IF "$(MODEL)" == "static" 89251876SpeterPROGRAM_DEPENDENCIES = \ 90251876Speter $(APR_PATH)\$(APROUTDIR)\apr-1.lib \ 91251876Speter ..\$(OUTDIR)\aprutil-1.lib 92251876SpeterSTATIC_CFLAGS = /D APR_DECLARE_STATIC /D APU_DECLARE_STATIC 93251876SpeterSTATIC_LIBS = odbc32.lib odbccp32.lib wldap32.lib 94251876Speter!ELSE 95251876SpeterPROGRAM_DEPENDENCIES = \ 96251876Speter $(APR_PATH)\$(APROUTDIR)\libapr-1.lib \ 97251876Speter ..\$(OUTDIR)\libaprutil-1.lib 98251876SpeterSTATIC_CFLAGS = 99251876Speter# APR 1.3 doesn't fully abstract ldap_ calls to permit switching providers; 100251876SpeterSTATIC_LIBS = wldap32.lib 101251876Speter!ENDIF 102251876Speter 103251876Speter!IFDEF _DEBUG 104251876SpeterDEBUG_CFLAGS = /MDd 105251876Speter!ELSE 106251876SpeterDEBUG_CFLAGS = /MD 107251876Speter!ENDIF 108251876Speter 109251876SpeterINCLUDES=/I "../include" /I "$(API_PATH)/include" /I "$(APR_PATH)/include" 110251876Speter 111251876SpeterCFLAGS = /nologo /c /W3 /Gm /EHsc /Zi /Od $(INCLUDES) \ 112251876Speter $(STATIC_CFLAGS) $(DEBUG_CFLAGS) /D "BINPATH=$(OUTDIR:\=/)" \ 113251876Speter /D _DEBUG /D WIN32 /Fo"$(INTDIR)/" /FD 114251876Speter 115251876SpeterLD_LIBS = kernel32.lib advapi32.lib ws2_32.lib wsock32.lib \ 116251876Speter ole32.lib shell32.lib rpcrt4.lib $(STATIC_LIBS) 117251876Speter 118251876SpeterLDFLAGS = /nologo /debug /subsystem:console /incremental:no 119251876SpeterSHLDFLAGS = /nologo /dll /debug /subsystem:windows /incremental:no 120251876Speter 121251876Speter.c{$(INTDIR)}.obj:: 122251876Speter $(CL) $(CFLAGS) -c $< -Fd$(INTDIR)\ $(INCLUDES) 123251876Speter 124251876Speter# PROGRAMS; 125251876Speter 126251876Speterabts.c: abts.h abts_tests.h testutil.h 127251876Speter 128251876Spetertestutil.c: abts.h abts_tests.h testutil.h 129251876Speter 130251876Speter$(OUTDIR)\testall.exe: $(ALL_TESTS) $(INTDIR)\abts.obj $(PROGRAM_DEPENDENCIES) 131251876Speter $(LD) $(LDFLAGS) /out:"$@" $** $(LD_LIBS) 132251876Speter @if exist "$@.manifest" \ 133251876Speter mt.exe -manifest "$@.manifest" -outputresource:$@;1 134251876Speter 135251876Speter# OTHER_PROGRAMS; 136251876Speter 137251876Speter$(OUTDIR)\dbd.exe: $(INTDIR)\dbd.obj $(PROGRAM_DEPENDENCIES) 138251876Speter $(LD) $(LDFLAGS) /out:"$@" $** $(LD_LIBS) 139251876Speter @if exist "$@.manifest" \ 140251876Speter mt.exe -manifest "$@.manifest" -outputresource:$@;1 141251876Speter 142251876Speter 143251876Spetercleandata: 144251876Speter @for %f in ($(CLEAN_DATA)) do @if EXIST %f del /f %f 145251876Speter 146251876Speterclean: cleandata 147251876Speter @if EXIST $(INTDIR)\. rmdir /s /q $(INTDIR) 148251876Speter @if EXIST $(OUTDIR)\. rmdir /s /q $(OUTDIR) 149251876Speter 150251876Spetercleanall: 151251876Speter @for %d in ($(CLEAN_BUILDDIRS) $(INTDIR) $(OUTDIR)) do \ 152251876Speter @if EXIST %d\. rmdir /s /q %d 153251876Speter 154251876Speter 155251876Speter!IF "$(MODEL)" != "static" 156251876SpeterPATH=$(OUTDIR);..\$(OUTDIR);..\ldap\$(OUTDIR);..\dbd\$(OUTDIR);$(API_PATH)\$(OUTDIR);$(APR_PATH)\$(APROUTDIR);$(PATH) 157251876Speter!ENDIF 158251876SpeterAPR_ICONV1_PATH=$(API_PATH)\$(OUTDIR)\iconv 159251876Speter 160251876Spetercheck: $(PROGRAMS) $(OTHER_PROGRAMS) 161251876Speter echo Testing dbd sqlite2 && $(OUTDIR)\dbd.exe sqlite2 || echo Failed 162251876Speter echo Testing dbd sqlite3 && $(OUTDIR)\dbd.exe sqlite3 || echo Failed 163251876Speter @for %p in ($(PROGRAMS)) do @( \ 164251876Speter echo Testing %p && %p -v || echo %p failed \ 165251876Speter ) 166251876Speter 167251876Spetercheckall: check 168251876Speter 169251876Speter# DO NOT REMOVE 170