[complement-svn] SF.net SVN: complement: [1389] branches/Makefiles/explore/Makefiles/gmake
Status: Pre-Alpha
Brought to you by:
complement
From: <com...@us...> - 2006-11-03 12:26:44
|
Revision: 1389 http://svn.sourceforge.net/complement/?rev=1389&view=rev Author: complement Date: 2006-11-03 04:26:36 -0800 (Fri, 03 Nov 2006) Log Message: ----------- GNU make 3.80 had problems (relative 3.81), this is workaround to satisfy 3.80 and code clean Modified Paths: -------------- branches/Makefiles/explore/Makefiles/gmake/linux/rules-install-so.mak branches/Makefiles/explore/Makefiles/gmake/linux/rules-so.mak branches/Makefiles/explore/Makefiles/gmake/targets.mak Modified: branches/Makefiles/explore/Makefiles/gmake/linux/rules-install-so.mak =================================================================== --- branches/Makefiles/explore/Makefiles/gmake/linux/rules-install-so.mak 2006-11-02 19:31:21 UTC (rev 1388) +++ branches/Makefiles/explore/Makefiles/gmake/linux/rules-install-so.mak 2006-11-03 12:26:36 UTC (rev 1389) @@ -1,4 +1,4 @@ -# -*- makefile -*- Time-stamp: <06/11/02 20:57:29 ptr> +# -*- makefile -*- Time-stamp: <06/11/03 11:47:01 ptr> # # Copyright (c) 1997-1999, 2002, 2003, 2005, 2006 # Petr Ovtchenkov @@ -19,6 +19,7 @@ install: $(INSTALL_TAGS) +# Workaround forGNU make 3.80; see comments in rules-so.mak define do_install_so_links $${INSTALL_LIB_DIR$(1)}/$${SO_NAME$(1)xxx}: ${SO_NAME_OUT$(1)xxx} $$(INSTALL_SO) $${SO_NAME_OUT$(1)xxx} $(INSTALL_LIB_DIR$(1)) @@ -27,12 +28,19 @@ $(call do_so_links_1,$$(INSTALL_LIB_DIR$(1)),$${SO_NAME$(1)},$${SO_NAME$(1)x}) endef -$(eval $(call do_install_so_links,)) -$(eval $(call do_install_so_links,_DBG)) +define do_install_so_links_wk +# expand to nothing, if WITHOUT_STLPORT ifndef WITHOUT_STLPORT -$(eval $(call do_install_so_links,_STLDBG)) +$(call do_install_so_links,$(1)) endif +endef +$(eval $(call do_install_so_links,)) +$(eval $(call do_install_so_links,_DBG)) +# ifndef WITHOUT_STLPORT +$(eval $(call do_install_so_links_wk,_STLDBG)) +# endif + install-release-shared: release-shared $(INSTALL_LIB_DIR) $(INSTALL_LIB_DIR)/${SO_NAMExxx} ${POST_INSTALL} Modified: branches/Makefiles/explore/Makefiles/gmake/linux/rules-so.mak =================================================================== --- branches/Makefiles/explore/Makefiles/gmake/linux/rules-so.mak 2006-11-02 19:31:21 UTC (rev 1388) +++ branches/Makefiles/explore/Makefiles/gmake/linux/rules-so.mak 2006-11-03 12:26:36 UTC (rev 1389) @@ -1,4 +1,4 @@ -# -*- makefile -*- Time-stamp: <06/11/02 20:45:44 ptr> +# -*- makefile -*- Time-stamp: <06/11/03 11:45:22 ptr> # # Copyright (c) 1997-1999, 2002, 2003, 2005, 2006 # Petr Ovtchenkov @@ -32,26 +32,41 @@ fi endef +# Workaround for GNU make 3.80: it fail on 'eval' within 'if' +# directive after some level of complexity, i.e. after complex +# rules it fails on code: +# +# $(eval $(call do_so_links,cc,)) +# $(eval $(call do_so_links,cc,_DBG)) +# ifndef WITHOUT_STLPORT +# $(eval $(call do_so_links,cc,_STLDBG)) +# endif +# +# Put 'if' logic into defined macro looks as workaround. +# +# The GNU make 3.81 free from this problem, but it new... + define do_so_links -$${SO_NAME_OUT$(2)xxx}: $$(OBJ$(2)) $$(LIBSDEP) - $$(LINK.$(1)) $$(LINK_OUTPUT_OPTION) $${START_OBJ} $$(OBJ$(2)) $$(LDLIBS) $${STDLIBS} $${END_OBJ} - $(call do_so_links_1,$$(OUTPUT_DIR$(2)),$${SO_NAME$(2)xx},$${SO_NAME$(2)xxx}) - $(call do_so_links_1,$$(OUTPUT_DIR$(2)),$${SO_NAME$(2)x},$${SO_NAME$(2)xx}) - $(call do_so_links_1,$$(OUTPUT_DIR$(2)),$${SO_NAME$(2)},$${SO_NAME$(2)x}) +$${SO_NAME_OUT$(1)xxx}: $$(OBJ$(1)) $$(LIBSDEP) +ifeq ("${_C_SOURCES_ONLY}","") + $$(LINK.cc) $$(LINK_OUTPUT_OPTION) $${START_OBJ} $$(OBJ$(1)) $$(LDLIBS) $${STDLIBS} $${END_OBJ} +else + $$(LINK.c) $$(LINK_OUTPUT_OPTION) $$(OBJ$(1)) $$(LDLIBS) +endif + $(call do_so_links_1,$$(OUTPUT_DIR$(1)),$${SO_NAME$(1)xx},$${SO_NAME$(1)xxx}) + $(call do_so_links_1,$$(OUTPUT_DIR$(1)),$${SO_NAME$(1)x},$${SO_NAME$(1)xx}) + $(call do_so_links_1,$$(OUTPUT_DIR$(1)),$${SO_NAME$(1)},$${SO_NAME$(1)x}) endef -ifeq ("${_C_SOURCES_ONLY}","") -$(eval $(call do_so_links,cc,)) -$(eval $(call do_so_links,cc,_DBG)) +define do_so_links_wk +# expand to nothing, if WITHOUT_STLPORT ifndef WITHOUT_STLPORT -$(eval $(call do_so_links,cc,_STLDBG)) +$(call do_so_links,$(1)) endif -# _C_SOURCES_ONLY -else -$(eval $(call do_so_links,c,)) -$(eval $(call do_so_links,c,_DBG)) -ifndef WITHOUT_STLPORT -$(eval $(call do_so_links,c,_STLDBG)) -endif -# !_C_SOURCES_ONLY -endif +endef + +$(eval $(call do_so_links,)) +$(eval $(call do_so_links,_DBG)) +# ifndef WITHOUT_STLPORT +$(eval $(call do_so_links_wk,_STLDBG)) +# endif Modified: branches/Makefiles/explore/Makefiles/gmake/targets.mak =================================================================== --- branches/Makefiles/explore/Makefiles/gmake/targets.mak 2006-11-02 19:31:21 UTC (rev 1388) +++ branches/Makefiles/explore/Makefiles/gmake/targets.mak 2006-11-03 12:26:36 UTC (rev 1389) @@ -1,4 +1,4 @@ -# Time-stamp: <06/11/02 22:27:08 ptr> +# Time-stamp: <06/11/03 12:09:39 ptr> # # Copyright (c) 1997-1999, 2002, 2003, 2005, 2006 # Petr Ovtchenkov @@ -19,84 +19,77 @@ DIRS_UNIQUE_SRC := $(dir $(SRC_CPP) $(SRC_CC) $(SRC_CXX) $(SRC_C) $(SRC_S) ) ifeq (${OSNAME},cygming) -DIRS_UNIQUE_SRC += $(dir $(SRC_RC) ) +DIRS_UNIQUE_SRC := ${DIRS_UNIQUE_SRC} $(dir $(SRC_RC) ) endif DIRS_UNIQUE_SRC := $(sort $(DIRS_UNIQUE_SRC) ) -define rule_o_1 -$$(OUTPUT_DIR$(1))/%.o: $(4)%.$(2) - $$(COMPILE.$(3)) $$(OUTPUT_OPTION) $$< -endef +# The rules below may be even simpler (i.e. define macro that generate +# rules for COMPILE.xx), but this GNU make 3.80 unhappy with it; +# GNU make 3.81 work fine, but 3.81 is new... +# The code below verbose, but this is price for compatibility with 3.80 -define rule_d_1 -$$(OUTPUT_DIR$(1))/%.d: $(4)%.$(2) - @$$(COMPILE.$(3)) $$(CCDEPFLAGS) $$< $$(DP_OUTPUT_DIR$(1)) -endef - define rule_o -$(eval $(call rule_o_1,$(2),cpp,cc,$(1))) -$(eval $(call rule_o_1,$(2),cc,cc,$(1))) -$(eval $(call rule_o_1,$(2),cxx,cc,$(1))) -$(eval $(call rule_o_1,$(2),c,c,$(1))) -$(eval $(call rule_o_1,$(2),s,s,$(1))) -$(eval $(call rule_o_1,$(2),S,S,$(1))) -endef +$$(OUTPUT_DIR$(1))/%.o: $(2)%.cc + $$(COMPILE.cc) $$(OUTPUT_OPTION) $$< -define rule_d -$(eval $(call rule_d_1,$(2),cpp,cc,$(1))) -$(eval $(call rule_d_1,$(2),cc,cc,$(1))) -$(eval $(call rule_d_1,$(2),cxx,cc,$(1))) -$(eval $(call rule_d_1,$(2),c,c,$(1))) -$(eval $(call rule_d_1,$(2),s,s,$(1))) -$(eval $(call rule_d_1,$(2),S,S,$(1))) -endef +$$(OUTPUT_DIR$(1))/%.d: $(2)%.cc + @$$(COMPILE.cc) $$(CCDEPFLAGS) $$< $$(DP_OUTPUT_DIR$(1)) -ifeq ($(OSNAME),cygming) -define rule_rc_1 -$$(OUTPUT_DIR$(1))/%.res: $(4)%.$(2) - $$(COMPILE.$(3)) $$(RC_OUTPUT_OPTION) $$< +$$(OUTPUT_DIR$(1))/%.o: $(2)%.cpp + $$(COMPILE.cc) $$(OUTPUT_OPTION) $$< + +$$(OUTPUT_DIR$(1))/%.d: $(2)%.cpp + @$$(COMPILE.cc) $$(CCDEPFLAGS) $$< $$(DP_OUTPUT_DIR$(1)) + +$$(OUTPUT_DIR$(1))/%.o: $(2)%.cxx + $$(COMPILE.cc) $$(OUTPUT_OPTION) $$< + +$$(OUTPUT_DIR$(1))/%.d: $(2)%.cxx + @$$(COMPILE.cc) $$(CCDEPFLAGS) $$< $$(DP_OUTPUT_DIR$(1)) + +$$(OUTPUT_DIR$(1))/%.o: $(2)%.c + $$(COMPILE.c) $$(OUTPUT_OPTION) $$< + +$$(OUTPUT_DIR$(1))/%.d: $(2)%.c + @$$(COMPILE.c) $$(CCDEPFLAGS) $$< $$(DP_OUTPUT_DIR$(1)) + +$$(OUTPUT_DIR$(1))/%.o: $(2)%.s + $$(COMPILE.s) $$(OUTPUT_OPTION) $$< + +$$(OUTPUT_DIR$(1))/%.o: $(2)%.S + $$(COMPILE.S) $$(OUTPUT_OPTION) $$< + +$$(OUTPUT_DIR$(1))/%.d: $(2)%.S + @$$(COMPILE.S) $$(SDEPFLAGS) $$< $$(DP_OUTPUT_DIR$(1)) endef define rule_rc -$(eval $(call rule_rc_1,$(2),rc,rc,$(1))) +$$(OUTPUT_DIR$(1))/%.res: $(2)%.rc + $$(COMPILE.rc) $$(RC_OUTPUT_OPTION) $$< endef -endif define rules_ -# Rules for release output: -$(eval $(call rule_o,$(1),)) -$(eval $(call rule_d,$(1),)) - +$(call rule_o,,$(1)) ifneq ($(OUTPUT_DIR),$(OUTPUT_DIR_A)) -$(eval $(call rule_o,$(1),_A)) -$(eval $(call rule_d,$(1),_A)) +$(call rule_o,_A,$(1)) endif - -# Rules for debug output: -$(eval $(call rule_o,$(1),_DBG)) -$(eval $(call rule_d,$(1),_DBG)) - +$(call rule_o,_DBG,$(1)) ifneq ($(OUTPUT_DIR_DBG),$(OUTPUT_DIR_A_DBG)) -$(eval $(call rule_o,$(1),_A_DBG)) -$(eval $(call rule_d,$(1),_A_DBG)) +$(call rule_o,_A_DBG,$(1)) endif - ifndef WITHOUT_STLPORT -# Rules for STLport debug output: -$(eval $(call rule_o,$(1),_STLDBG)) -$(eval $(call rule_d,$(1),_STLDBG)) - +$(call rule_o,_STLDBG,$(1)) ifneq ($(OUTPUT_DIR_STLDBG),$(OUTPUT_DIR_A_STLDBG)) -$(eval $(call rule_o,$(1),_A_STLDBG)) -$(eval $(call rule_d,$(1),_A_STLDBG)) +$(call rule_o,_A_STLDBG,$(1)) endif endif - ifeq ($(OSNAME),cygming) -$(eval $(call rule_rc,$(1),)) -$(eval $(call rule_rc,$(1),_DBG)) -$(eval $(call rule_rc,$(1),_STLDBG)) +$(call rule_rc,,$(1)) +$(call rule_rc,_DBG,$(1)) +ifndef WITHOUT_STLPORT +$(call rule_rc,_STLDBG,$(1)) endif +endif endef $(foreach dir,$(DIRS_UNIQUE_SRC),$(eval $(call rules_,$(dir)))) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |