Makefile.win revision 251876
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 \ 64251876Speter $(INTDIR)\testdate.obj $(INTDIR)\testmemcache.obj 65251876Speter 66251876SpeterCLEAN_DATA = manyfile.bin testfile.txt data\sqlite*.db 67251876Speter 68251876SpeterCLEAN_BUILDDIRS = Debug Release LibD LibR 9x x64 69251876Speter 70251876SpeterPROGRAMS = \ 71251876Speter $(OUTDIR)\testall.exe 72251876Speter 73251876SpeterOTHER_PROGRAMS = \ 74251876Speter $(OUTDIR)\dbd.exe 75251876Speter 76251876Speter# bring in rules.mk for standard functionality 77251876SpeterALL: $(PROGRAMS) $(OTHER_PROGRAMS) 78251876Speter 79251876SpeterCL = cl.exe 80251876SpeterLD = link.exe 81251876Speter 82251876SpeterAPR_PATH = ..\..\apr 83251876SpeterAPI_PATH = ..\..\apr-iconv 84251876Speter 85251876SpeterAPROUTDIR=$(OUTDIR) 86251876Speter 87251876Speter!IF "$(MODEL)" == "static" 88251876SpeterPROGRAM_DEPENDENCIES = \ 89251876Speter $(APR_PATH)\$(APROUTDIR)\apr-1.lib \ 90251876Speter ..\$(OUTDIR)\aprutil-1.lib 91251876SpeterSTATIC_CFLAGS = /D APR_DECLARE_STATIC /D APU_DECLARE_STATIC 92251876SpeterSTATIC_LIBS = odbc32.lib odbccp32.lib wldap32.lib 93251876Speter!ELSE 94251876SpeterPROGRAM_DEPENDENCIES = \ 95251876Speter $(APR_PATH)\$(APROUTDIR)\libapr-1.lib \ 96251876Speter ..\$(OUTDIR)\libaprutil-1.lib 97251876SpeterSTATIC_CFLAGS = 98251876Speter# APR 1.3 doesn't fully abstract ldap_ calls to permit switching providers; 99251876SpeterSTATIC_LIBS = wldap32.lib 100251876Speter!ENDIF 101251876Speter 102251876Speter!IFDEF _DEBUG 103251876SpeterDEBUG_CFLAGS = /MDd 104251876Speter!ELSE 105251876SpeterDEBUG_CFLAGS = /MD 106251876Speter!ENDIF 107251876Speter 108251876SpeterINCLUDES=/I "../include" /I "$(API_PATH)/include" /I "$(APR_PATH)/include" 109251876Speter 110251876SpeterCFLAGS = /nologo /c /W3 /Gm /EHsc /Zi /Od $(INCLUDES) \ 111251876Speter $(STATIC_CFLAGS) $(DEBUG_CFLAGS) /D "BINPATH=$(OUTDIR:\=/)" \ 112251876Speter /D _DEBUG /D WIN32 /Fo"$(INTDIR)/" /FD 113251876Speter 114251876SpeterLD_LIBS = kernel32.lib advapi32.lib ws2_32.lib wsock32.lib \ 115251876Speter ole32.lib shell32.lib rpcrt4.lib $(STATIC_LIBS) 116251876Speter 117251876SpeterLDFLAGS = /nologo /debug /subsystem:console /incremental:no 118251876SpeterSHLDFLAGS = /nologo /dll /debug /subsystem:windows /incremental:no 119251876Speter 120251876Speter.c{$(INTDIR)}.obj:: 121251876Speter $(CL) $(CFLAGS) -c $< -Fd$(INTDIR)\ $(INCLUDES) 122251876Speter 123251876Speter# PROGRAMS; 124251876Speter 125251876Speterabts.c: abts.h abts_tests.h testutil.h 126251876Speter 127251876Spetertestutil.c: abts.h abts_tests.h testutil.h 128251876Speter 129251876Speter$(OUTDIR)\testall.exe: $(ALL_TESTS) $(INTDIR)\abts.obj $(PROGRAM_DEPENDENCIES) 130251876Speter $(LD) $(LDFLAGS) /out:"$@" $** $(LD_LIBS) 131251876Speter @if exist "$@.manifest" \ 132251876Speter mt.exe -manifest "$@.manifest" -outputresource:$@;1 133251876Speter 134251876Speter# OTHER_PROGRAMS; 135251876Speter 136251876Speter$(OUTDIR)\dbd.exe: $(INTDIR)\dbd.obj $(PROGRAM_DEPENDENCIES) 137251876Speter $(LD) $(LDFLAGS) /out:"$@" $** $(LD_LIBS) 138251876Speter @if exist "$@.manifest" \ 139251876Speter mt.exe -manifest "$@.manifest" -outputresource:$@;1 140251876Speter 141251876Speter 142251876Spetercleandata: 143251876Speter @for %f in ($(CLEAN_DATA)) do @if EXIST %f del /f %f 144251876Speter 145251876Speterclean: cleandata 146251876Speter @if EXIST $(INTDIR)\. rmdir /s /q $(INTDIR) 147251876Speter @if EXIST $(OUTDIR)\. rmdir /s /q $(OUTDIR) 148251876Speter 149251876Spetercleanall: 150251876Speter @for %d in ($(CLEAN_BUILDDIRS) $(INTDIR) $(OUTDIR)) do \ 151251876Speter @if EXIST %d\. rmdir /s /q %d 152251876Speter 153251876Speter 154251876Speter!IF "$(MODEL)" != "static" 155251876SpeterPATH=$(OUTDIR);..\$(OUTDIR);..\ldap\$(OUTDIR);..\dbd\$(OUTDIR);$(API_PATH)\$(OUTDIR);$(APR_PATH)\$(APROUTDIR);$(PATH) 156251876Speter!ENDIF 157251876SpeterAPR_ICONV1_PATH=$(API_PATH)\$(OUTDIR)\iconv 158251876Speter 159251876Spetercheck: $(PROGRAMS) $(OTHER_PROGRAMS) 160251876Speter echo Testing dbd sqlite2 && $(OUTDIR)\dbd.exe sqlite2 || echo Failed 161251876Speter echo Testing dbd sqlite3 && $(OUTDIR)\dbd.exe sqlite3 || echo Failed 162251876Speter @for %p in ($(PROGRAMS)) do @( \ 163251876Speter echo Testing %p && %p -v || echo %p failed \ 164251876Speter ) 165251876Speter 166251876Spetercheckall: check 167251876Speter 168251876Speter# DO NOT REMOVE 169