apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wr...@apache.org
Subject svn commit: r582603 - in /apr/apr/trunk/test: Makefile.win testall.dsw testapp.dsp testappnt.dsp
Date Sun, 07 Oct 2007 09:55:15 GMT
Author: wrowe
Date: Sun Oct  7 02:55:12 2007
New Revision: 582603

URL: http://svn.apache.org/viewvc?rev=582603&view=rev
Log:
Refactor Makefile.win to permit many parallel sorts of builds
(e.g. testing x86 and x64, regular nt vs. 9x inclusive builds,
debug vs. release and libs vs. dll's).

Migrate 'testapp', the simple stub example, in order to test
every flavor of apr_app.lib and libapr_app.lib.  (Before you
ask, this is the stub that allows apr apps to accept unicode
command input, and represent it all as utf-8 to our true-char
flavor libraries.)

Removed:
    apr/apr/trunk/test/testapp.dsp
    apr/apr/trunk/test/testappnt.dsp
Modified:
    apr/apr/trunk/test/Makefile.win
    apr/apr/trunk/test/testall.dsw

Modified: apr/apr/trunk/test/Makefile.win
URL: http://svn.apache.org/viewvc/apr/apr/trunk/test/Makefile.win?rev=582603&r1=582602&r2=582603&view=diff
==============================================================================
--- apr/apr/trunk/test/Makefile.win (original)
+++ apr/apr/trunk/test/Makefile.win Sun Oct  7 02:55:12 2007
@@ -7,113 +7,165 @@
 #   programs such as sendfile, that have to be invoked in a special sequence
 #   or with special parameters
 
-STDTEST_PORTABLE = \
-	testlockperf.exe \
-	testshmproducer.exe \
-	testshmconsumer.exe \
-	testmutexscope.exe \
-	testall.exe
+!IFNDEF MODEL
+MODEL=dynamic
+!ENDIF
 
-OTHER_PROGRAMS = sendfile.exe 
+INCDIR=../include
 
-PROGRAMS = $(STDTEST_PORTABLE) $(STDTEST_NONPORTABLE) $(OTHER_PROGRAMS)
+!IFNDEF OUTDIR
+!IF "$(MODEL)" == "static"
+OUTDIR=LibR
+!ELSE
+OUTDIR=Release
+!ENDIF
+
+!IF [$(COMSPEC) /c cl /nologo /? | find "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
 
-TARGETS = $(PROGRAMS)
+!MESSAGE Building tests into $(OUTDIR) for $(MODEL)
 
-# bring in rules.mk for standard functionality
-ALL: $(TARGETS)
+STDTEST_PORTABLE = \
+	$(OUTDIR)\testapp.exe \
+	$(OUTDIR)\testall.exe \
+	$(OUTDIR)\testlockperf.exe \
+	$(OUTDIR)\testmutexscope.exe
+
+OTHER_PROGRAMS = \
+	$(OUTDIR)\sendfile.exe 
+
+TESTALL_COMPONENTS = \
+	$(OUTDIR)\mod_test.dll \
+	$(OUTDIR)\occhild.exe \
+	$(OUTDIR)\readchild.exe \
+	$(OUTDIR)\proc_child.exe \
+        $(OUTDIR)\tryread.exe \
+	$(OUTDIR)\sockchild.exe \
+	$(OUTDIR)\testshmproducer.exe \
+	$(OUTDIR)\testshmconsumer.exe \
+	$(OUTDIR)\globalmutexchild.exe
+
+ALL_TESTS = $(INTDIR)\testutil.obj $(INTDIR)\testtime.obj $(INTDIR)\teststr.obj \
+	$(INTDIR)\testvsn.obj $(INTDIR)\testipsub.obj $(INTDIR)\testmmap.obj \
+	$(INTDIR)\testud.obj $(INTDIR)\testtable.obj $(INTDIR)\testsleep.obj \
+	$(INTDIR)\testpools.obj $(INTDIR)\testfmt.obj $(INTDIR)\testfile.obj \
+	$(INTDIR)\testdir.obj $(INTDIR)\testfileinfo.obj $(INTDIR)\testrand.obj \
+	$(INTDIR)\testdso.obj $(INTDIR)\testoc.obj $(INTDIR)\testdup.obj \
+	$(INTDIR)\testsockets.obj $(INTDIR)\testproc.obj $(INTDIR)\testpoll.obj \
+	$(INTDIR)\testlock.obj $(INTDIR)\testsockopt.obj $(INTDIR)\testpipe.obj \
+	$(INTDIR)\testthread.obj $(INTDIR)\testhash.obj $(INTDIR)\testargs.obj \
+	$(INTDIR)\testnames.obj $(INTDIR)\testuser.obj $(INTDIR)\testpath.obj \
+	$(INTDIR)\testenv.obj $(INTDIR)\testprocmutex.obj $(INTDIR)\testfnmatch.obj \
+	$(INTDIR)\testatomic.obj $(INTDIR)\testflock.obj $(INTDIR)\testshm.obj \
+	$(INTDIR)\testsock.obj $(INTDIR)\testglobalmutex.obj $(INTDIR)\teststrnatcmp.obj \
+	$(INTDIR)\testfilecopy.obj $(INTDIR)\testtemp.obj $(INTDIR)\testlfs.obj \
+	$(INTDIR)\testcond.obj
+
+CLEAN_TARGETS = testfile.tmp lfstests/large.bin \
+	data/testputs.txt data/testbigfprintf.dat \
+	data/testwritev.txt data/testwritev_full.txt
 
-CL = cl.exe
+PROGRAMS = $(TESTALL_COMPONENTS) $(STDTEST_PORTABLE) $(STDTEST_NONPORTABLE) $(OTHER_PROGRAMS)
 
-CFLAGS = /nologo /c /MDd /W3 /Gm /EHsc /Zi /Od /D _DEBUG /D WIN32 /D APR_DECLARE_STATIC /FD

+TARGETS = $(PROGRAMS)
 
-.c.obj::
-	$(CL) -c $< $(CFLAGS) $(INCLUDES)
+# bring in rules.mk for standard functionality
+ALL: $(TARGETS)
 
-LOCAL_LIBS= ../LibD/apr-1.lib 
-ALL_LIBS= kernel32.lib user32.lib advapi32.lib Rpcrt4.lib ws2_32.lib wsock32.lib ole32.lib

+clean:
 
+CL = cl.exe
+LD = link.exe 
 
-CLEAN_TARGETS = testfile.tmp mod_test.dll proc_child.exe occhild.exe \
-	readchild.exe tryread.exe sockchild.exe \
-	globalmutexchild.exe lfstests/large.bin \
-	data/testputs.txt data/testbigfprintf.dat data/testwritev.txt \
-        data/testwritev_full.txt
-CLEAN_SUBDIRS = internal
+!IF "$(MODEL)" == "static"
+LOCAL_LIB= ..\$(OUTDIR)\apr-1.lib 
+APP_LIB= ..\build\$(OUTDIR)\apr_app-1.lib 
+STATIC_CFLAGS = /D APR_DECLARE_STATIC
+!ELSE
+LOCAL_LIB= ..\$(OUTDIR)\libapr-1.lib 
+APP_LIB= ..\build\$(OUTDIR)\libapr_app-1.lib 
+STATIC_CFLAGS = 
+!ENDIF
+
+!IFDEF _DEBUG
+DEBUG_CFLAGS = /MDd
+!ELSE
+DEBUG_CFLAGS = /MD 
+!ENDIF
 
-INCDIR=../include
 INCLUDES=/I "$(INCDIR)"
 
-# link programs using -no-install to get real executables not
-# libtool wrapper scripts which link an executable when first run.
-LINK_PROG = link.exe /nologo /debug /machine:I386 /subsystem:console /incremental:no 
-LINK_LIB = link.exe /nologo /dll /debug /machine:I386 /subsystem:windows /incremental:no
-
-check: $(STDTEST_PORTABLE) $(STDTEST_NONPORTABLE)
-	for prog in $(STDTEST_PORTABLE) $(STDTEST_NONPORTABLE); do \
-		./$$prog; \
-		if test $$? = 255; then \
-			echo "$$prog failed"; \
-			break; \
-		fi; \
-	done
-
-occhild.exe: occhild.obj $(LOCAL_LIBS)
-	$(LINK_PROG) occhild.obj $(LOCAL_LIBS) $(ALL_LIBS)
-
-sockchild.exe: sockchild.obj $(LOCAL_LIBS)
-	$(LINK_PROG) sockchild.obj $(LOCAL_LIBS) $(ALL_LIBS)
-
-readchild.exe: readchild.obj $(LOCAL_LIBS)
-	$(LINK_PROG) readchild.obj $(LOCAL_LIBS) $(ALL_LIBS)
-
-globalmutexchild.exe: globalmutexchild.obj $(LOCAL_LIBS)
-	$(LINK_PROG) globalmutexchild.obj $(LOCAL_LIBS) $(ALL_LIBS)
-
-tryread.exe: tryread.obj $(LOCAL_LIBS)
-	$(LINK_PROG) tryread.obj $(LOCAL_LIBS) $(ALL_LIBS)
-
-proc_child.exe: proc_child.obj $(LOCAL_LIBS)
-	$(LINK_PROG) proc_child.obj $(LOCAL_LIBS) $(ALL_LIBS)
-
-# FIXME: -prefer-pic is only supported with libtool-1.4+
-mod_test.dll: mod_test.obj
-	$(LINK_LIB) mod_test.obj /export:print_hello /export:count_reps $(LOCAL_LIBS) $(ALL_LIBS)
-
-testlockperf.exe: testlockperf.obj $(LOCAL_LIBS)
-	$(LINK_PROG) testlockperf.obj $(LOCAL_LIBS) $(ALL_LIBS)
-
-sendfile.exe: sendfile.obj $(LOCAL_LIBS)
-	$(LINK_PROG) sendfile.obj $(LOCAL_LIBS) $(ALL_LIBS)
-
-testshmproducer.exe: testshmproducer.obj $(LOCAL_LIBS)
-	$(LINK_PROG) testshmproducer.obj $(LOCAL_LIBS) $(ALL_LIBS)
-
-testshmconsumer.exe: testshmconsumer.obj $(LOCAL_LIBS)
-	$(LINK_PROG) testshmconsumer.obj $(LOCAL_LIBS) $(ALL_LIBS)
-
-testprocmutex.exe: testprocmutex.obj $(LOCAL_LIBS)
-	$(LINK_PROG) testprocmutex.obj $(LOCAL_LIBS) $(ALL_LIBS)
-
-testmutexscope.exe: testmutexscope.obj $(LOCAL_LIBS)
-	$(LINK_PROG) testmutexscope.obj $(LOCAL_LIBS) $(ALL_LIBS)
-
-TESTS = testutil.obj testtime.obj teststr.obj testvsn.obj testipsub.obj \
-	testmmap.obj testud.obj testtable.obj testsleep.obj testpools.obj \
-	testfmt.obj testfile.obj testdir.obj testfileinfo.obj testrand.obj \
-	testdso.obj testoc.obj testdup.obj testsockets.obj testproc.obj \
-	testpoll.obj testlock.obj testsockopt.obj testpipe.obj testthread.obj \
-	testhash.obj testargs.obj testnames.obj testuser.obj testpath.obj \
-	testenv.obj testprocmutex.obj testfnmatch.obj testatomic.obj \
-	testflock.obj testshm.obj testsock.obj testglobalmutex.obj \
-	teststrnatcmp.obj testfilecopy.obj testtemp.obj testlfs.obj \
-	testcond.obj
-
-testall.exe: $(TESTS) mod_test.dll occhild.exe \
-	 readchild.exe abts.obj proc_child.exe \
-         tryread.exe sockchild.exe globalmutexchild.exe \
-         $(LOCAL_LIBS)
-	$(LINK_PROG) /out:testall.exe $(TESTS) abts.obj $(LOCAL_LIBS) $(ALL_LIBS)
-
+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 = $(LOCAL_LIB) kernel32.lib advapi32.lib ws2_32.lib wsock32.lib \
+	  ole32.lib shell32.lib rpcrt4.lib
+
+LDFLAGS = /nologo /debug /subsystem:console /incremental:no 
+SHLDFLAGS = /nologo /dll /debug /subsystem:windows /incremental:no
+
+.c{$(INTDIR)}.obj::
+	$(CL) $(CFLAGS) -c $< -Fd$(INTDIR)\ $(INCLUDES)
+
+.c{$(OUTDIR)}.exe:
+	$(CL) $(CFLAGS) -c $** -Fd$(INTDIR)\ $(INCLUDES) 
+	$(LD) $(LDFLAGS) /out:"$@" $*.obj $(LD_LIBS)
+	if exist "$@.manifest" \
+	    mt.exe -manifest "$@.manifest" -outputresource:$@;1
+
+{$(INTDIR)}.obj{$(OUTDIR)}.exe:
+	$(LD) $(LDFLAGS) /out:"$@" $*.obj $(LD_LIBS)
+	if exist "$@.manifest" \
+	    mt.exe -manifest "$@.manifest" -outputresource:$@;1
+
+$(OUTDIR)\mod_test.dll: $(INTDIR)/mod_test.obj
+	$(LD) $(SHLDFLAGS) /out:"$@" $** \
+	       /export:print_hello /export:count_reps $(LD_LIBS)
+	if exist "$@.manifest" \
+	    mt.exe -manifest "$@.manifest" -outputresource:$@;2
+
+$(OUTDIR)\testapp.exe: $(INTDIR)/testapp.obj
+	$(LD) $(LDFLAGS) /out:"$@" $** \
+	      /entry:wmainCRTStartup $(APP_LIB) $(LD_LIBS)
+	if exist "$@.manifest" \
+	    mt.exe -manifest "$@.manifest" -outputresource:$@;2
+
+$(OUTDIR)\testall.exe: $(ALL_TESTS) $(INTDIR)\abts.obj
+	$(LD) $(LDFLAGS) /out:"$@" $** $(LD_LIBS)
+	if exist "$@.manifest" \
+	    mt.exe -manifest "$@.manifest" -outputresource:$@;1
+
+
+clean:
+	for %f in ($(CLEAN_TARGETS)) do del /f %f
+	rmdir /s /q $(OUTDIR)
+!IF "$(OUTDIR)" != "$(INTDIR)"
+	rmdir /s /q $(OUTDIR)
+!ENDIF
+
+
+PATH=$(OUTDIR);..\$(OUTDIR);$(PATH)
+
+check: $(TESTALL_COMPONENTS) $(STDTEST_PORTABLE) $(STDTEST_NONPORTABLE)
+	for %p in ($(STDTEST_PORTABLE) $(STDTEST_NONPORTABLE)) do @( \
+	    echo Testing %p && %p || echo "%p failed" \
+	)
 
 # DO NOT REMOVE

Modified: apr/apr/trunk/test/testall.dsw
URL: http://svn.apache.org/viewvc/apr/apr/trunk/test/testall.dsw?rev=582603&r1=582602&r2=582603&view=diff
==============================================================================
--- apr/apr/trunk/test/testall.dsw (original)
+++ apr/apr/trunk/test/testall.dsw Sun Oct  7 02:55:12 2007
@@ -41,6 +41,9 @@
     Begin Project Dependency
     Project_Dep_Name libapr
     End Project Dependency
+    Begin Project Dependency
+    Project_Dep_Name libapr_app
+    End Project Dependency
 }}}
 
 ###############################################################################
@@ -56,6 +59,9 @@
     Begin Project Dependency
     Project_Dep_Name apr
     End Project Dependency
+    Begin Project Dependency
+    Project_Dep_Name apr_app
+    End Project Dependency
 }}}
 
 ###############################################################################
@@ -82,42 +88,6 @@
 {{{
     Begin Project Dependency
     Project_Dep_Name libapr
-    End Project Dependency
-}}}
-
-###############################################################################
-
-Project: "testapp"=".\testapp.dsp" - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
-    Begin Project Dependency
-    Project_Dep_Name apr
-    End Project Dependency
-    Begin Project Dependency
-    Project_Dep_Name apr_app
-    End Project Dependency
-}}}
-
-###############################################################################
-
-Project: "testappnt"=".\testappnt.dsp" - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
-    Begin Project Dependency
-    Project_Dep_Name apr
-    End Project Dependency
-    Begin Project Dependency
-    Project_Dep_Name apr_app
     End Project Dependency
 }}}
 



Mime
View raw message