apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wr...@apache.org
Subject svn commit: r495112 - /apr/apr-iconv/trunk/build/modules.mk.win
Date Thu, 11 Jan 2007 04:51:55 GMT
Author: wrowe
Date: Wed Jan 10 20:51:54 2007
New Revision: 495112

URL: http://svn.apache.org/viewvc?view=rev&rev=495112
Log:
Greatly improve the performance of building these hundred loadable
iconv modules on win32.

Modified:
    apr/apr-iconv/trunk/build/modules.mk.win

Modified: apr/apr-iconv/trunk/build/modules.mk.win
URL: http://svn.apache.org/viewvc/apr/apr-iconv/trunk/build/modules.mk.win?view=diff&rev=495112&r1=495111&r2=495112
==============================================================================
--- apr/apr-iconv/trunk/build/modules.mk.win (original)
+++ apr/apr-iconv/trunk/build/modules.mk.win Wed Jan 10 20:51:54 2007
@@ -5,6 +5,7 @@
 !ELSE
 NULL=nul
 rmdir=deltree /y
+!ERROR it's not NT
 !ENDIF
 
 SILENT=@
@@ -16,21 +17,20 @@
 !IF "$(BUILD_MODE)" == "release" || "$(BUILD_MODE)" == "Release"
 !IF "$(BIND_MODE)" == "shared"
 # release shared
-APR_LIB_PFX = $(APR_SOURCE)\Release\lib
-API_LIB_PFX = $(API_SOURCE)\Release\lib
-CFG_CFLAGS  = /MD /O2 /Oy- /Zi
-CFG_DEFINES = /D "NDEBUG"
-CFG_LDFLAGS = /debug /opt:ref
+API_LIBS = $(APR_SOURCE)\Release\libapr-1.lib \
+	   $(API_SOURCE)\Release\libapriconv-1.lib
+CFG_CFLAGS  = /MD /Zi /O2 /Oy- /D "NDEBUG"
+CFG_LDFLAGS = /debug /opt:ref /incremental:no
 CFG_OUTPUT  = Release\iconv
 
 !ELSE
 !IF "$(BIND_MODE)" == "static"
 # release static
-APR_LIB_PFX = $(APR_SOURCE)\LibR\	# no line continuation
-API_LIB_PFX = $(API_SOURCE)\LibR\	# no line continuation
-CFG_CFLAGS  = /MD /O2 /Oy- /Zi
-CFG_DEFINES = /D "NDEBUG" /D "APR_DECLARE_STATIC" /D "API_DECLARE_STATIC"
-CFG_LDFLAGS = /debug /incremental:no /opt:ref
+API_LIBS = $(APR_SOURCE)\LibR\apr-1.lib \
+	   $(API_SOURCE)\LibR\apriconv-1.lib \
+	  kernel32.lib advapi32.lib ws2_32.lib mswsock.lib
+CFG_CFLAGS  = /MD /Zi /O2 /Oy- /D "NDEBUG" /D "APR_DECLARE_STATIC" /D "API_DECLARE_STATIC"
+CFG_LDFLAGS = /debug /opt:ref /incremental:no
 CFG_OUTPUT  = LibR\iconv
 
 !ELSE
@@ -42,21 +42,20 @@
 !IF "$(BUILD_MODE)" == "debug" || "$(BUILD_MODE)" == "Debug"
 !IF "$(BIND_MODE)" == "shared"
 # debug shared
-APR_LIB_PFX = $(APR_SOURCE)\Debug\lib
-API_LIB_PFX = $(API_SOURCE)\Debug\lib
-CFG_CFLAGS  = /MDd /Zi /Od
-CFG_DEFINES = /D "_DEBUG"
-CFG_LDFLAGS = /debug
+API_LIBS = $(APR_SOURCE)\Debug\libapr-1.lib \
+	   $(API_SOURCE)\Debug\libapriconv-1.lib
+CFG_CFLAGS  = /MDd /Zi /Od /EHsc /D "_DEBUG"
+CFG_LDFLAGS = /debug /incremental:no
 CFG_OUTPUT  = Debug\iconv
 
 !ELSE
 !IF "$(BIND_MODE)" == "static"
 # debug static
-APR_LIB_PFX = $(APR_SOURCE)\LibD\	# no line continuation
-API_LIB_PFX = $(API_SOURCE)\LibD\	# no line continuation
-CFG_CFLAGS  = /MDd /Zi /Od
-CFG_DEFINES = /D "_DEBUG" /D "APR_DECLARE_STATIC" /D "API_DECLARE_STATIC"
-CFG_LDFLAGS = /debug
+APR_LIB = $(APR_SOURCE)\LibD\apr-1.lib \
+	  $(API_SOURCE)\LibD\apriconv-1.lib \
+	  kernel32.lib advapi32.lib ws2_32.lib mswsock.lib
+CFG_CFLAGS  = /MDd /Zi /Od /EHsc /D "_DEBUG" /D "APR_DECLARE_STATIC" /D "API_DECLARE_STATIC"
+CFG_LDFLAGS = /debug /incremental:no
 CFG_OUTPUT  = LibD\iconv
 
 !ELSE
@@ -73,14 +72,14 @@
 APR_SOURCE   = ..\..\apr
 API_SOURCE   = ..
 OUTPUT_DIR   = $(API_SOURCE)\$(CFG_OUTPUT)
-OBJ_DIR   = $(OUTPUT_DIR)\objs
 
-INT_CFLAGS   = /nologo $(CFG_CFLAGS) /Fp"$(OUTPUT_DIR)\iconv.pch" /YX"iconv.h"
-INT_INCLUDES = /I "$(API_SOURCE)\include" /I "$(API_SOURCE)\lib" \
-		/I "$(APR_SOURCE)\include"
-INT_DEFINES  = /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" $(CFG_DEFINES)
-INT_LDFLAGS  = /nologo /dll /incremental:no /subsystem:windows \
-		/export:iconv_module,DATA $(CFG_LDFLAGS)
+INT_CFLAGS   = /nologo $(CFG_CFLAGS) /Fd"$(OUTPUT_DIR)\iconv_src" \
+		/Fp"$(OUTPUT_DIR)\iconv.pch" /Yu"iconv.h" \
+		/I "$(API_SOURCE)\include" /I "$(API_SOURCE)\lib" \
+		/I "$(APR_SOURCE)\include" \
+		/D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL"
+INT_LDFLAGS  = /nologo $(CFG_LDFLAGS) /dll /subsystem:windows /incremental:no \
+		/export:iconv_module,DATA 
 
 CFLAGS       = /W3
 ALL_CFLAGS   = $(INT_CFLAGS) $(INT_INCLUDES) $(INT_DEFINES) $(CFLAGS)
@@ -88,23 +87,23 @@
 LDFLAGS      = 
 ALL_LDFLAGS  = $(INT_LDFLAGS) $(LDFLAGS)
 
-.c{$(OUTPUT_DIR)}.so:
-	-$(SILENT)if not exist "$(OUTPUT_DIR)\$(NULL)" mkdir "$(OUTPUT_DIR)"
-	-$(SILENT)if not exist "$(OBJ_DIR)\$(NULL)" mkdir "$(OBJ_DIR)"
-	$(SILENT)echo Compiling $<... via $(OBJ_DIR)\$(@B).obj to $@
-	$(SILENT)cl $(ALL_CFLAGS) /Fo"$(OBJ_DIR)\$(@B).obj" \
-		/Fd"$(OBJ_DIR)\$(@B)_src" $< \
-		/link $(ALL_LDFLAGS) /out:$@ \
-		/base:@"..\build\BaseAddr.ref",$(@F) \
-		"$(API_LIB_PFX)apriconv-1.lib" "$(APR_LIB_PFX)apr-1.lib" \
-		kernel32.lib advapi32.lib ws2_32.lib mswsock.lib
-	if exist $@.manifest mt.exe -manifest $@.manifest -outputresource:$@;2
-	$(SILENT)echo.
-	$(SILENT)del "$*.exp"
-	$(SILENT)del "$*.lib"
+all: $(OUTPUT_DIR) $(ALL_TARGETS)
 
-all: $(ALL_TARGETS)
+$(OUTPUT_DIR):
+	-$(SILENT)if not exist "$(OUTPUT_DIR)\$(NULL)" mkdir "$(OUTPUT_DIR)"
 
+.c{$(OUTPUT_DIR)}.so:
+        $(SILENT)if not exist "$(OUTPUT_DIR)\iconv.pch" ( \
+	  echo Precompiling iconv.pch from iconv.h & \
+	  cl $(ALL_CFLAGS) /Yc"iconv.h" /Fo"$*.obj" /c $< \
+	) else ( \
+	  cl $(ALL_CFLAGS) /Fo"$*.obj" /c $< \
+	)
+	$(SILENT)link $(ALL_LDFLAGS) $*.obj $(API_LIBS) /out:$@ \
+		/base:@"..\build\BaseAddr.ref",$(@F) & \
+	( if exist $@.manifest \
+		mt -manifest $@.manifest -outputresource:$@;2 ) & \
+	del "$*.exp" & del "$*.lib"
 
 # The rebase target below is used only to *regenerate* the BaseAddr.ref file
 # if the module list or sizes change considerably.  Use the rebase target to



Mime
View raw message