[complement-svn] SF.net SVN: complement: [1390] trunk/complement/explore/Makefiles
Status: Pre-Alpha
Brought to you by:
complement
From: <com...@us...> - 2006-11-03 13:38:21
|
Revision: 1390 http://svn.sourceforge.net/complement/?rev=1390&view=rev Author: complement Date: 2006-11-03 05:38:09 -0800 (Fri, 03 Nov 2006) Log Message: ----------- generate rules with macro expansion---real metaprogramming within make; recursive file inclusion to build rules for few catalogs not required more. Notes: this changes may confuse GNU make 3.79.x; I check this with GNU make 3.80 and 3.81---support of 3.80 has required few workarounds relative smooth code for 3.81. Modified Paths: -------------- trunk/complement/explore/Makefiles/ChangeLog trunk/complement/explore/Makefiles/gmake/linux/rules-install-so.mak trunk/complement/explore/Makefiles/gmake/linux/rules-so.mak trunk/complement/explore/Makefiles/gmake/targets.mak Removed Paths: ------------- trunk/complement/explore/Makefiles/gmake/dirsrc.mak trunk/complement/explore/Makefiles/rules-d.mak trunk/complement/explore/Makefiles/rules-o.mak trunk/complement/explore/Makefiles/rules-res.mak Modified: trunk/complement/explore/Makefiles/ChangeLog =================================================================== --- trunk/complement/explore/Makefiles/ChangeLog 2006-11-03 12:26:36 UTC (rev 1389) +++ trunk/complement/explore/Makefiles/ChangeLog 2006-11-03 13:38:09 UTC (rev 1390) @@ -1,3 +1,20 @@ +2006-11-03 Petr Ovtchenkov <pt...@is...> + + * gmake/linux/rules-so.mak, gmake/linux/rules-install-so.mak: + generate rules with macro expansion---real metaprogramming + within make; + + * gmake/targets.mak: generate rules with macro expansion, + recursive file inclusion to build rules for few catalogs not + required more. + + * rules-d.mak, rules-res.mak, rules-o.mak, gmake/dirsrc.mak: + removed + + * Notes: this changes may confuse GNU make 3.79.x; I check + this with GNU make 3.80 and 3.81---support of 3.80 has required + few workarounds relative smooth code for 3.81. + 2006-11-02 Petr Ovtchenkov <pt...@is...> * gmake/app/rules-install.mak, gmake/app/rules.mak: Deleted: trunk/complement/explore/Makefiles/gmake/dirsrc.mak =================================================================== --- trunk/complement/explore/Makefiles/gmake/dirsrc.mak 2006-11-03 12:26:36 UTC (rev 1389) +++ trunk/complement/explore/Makefiles/gmake/dirsrc.mak 2006-11-03 13:38:09 UTC (rev 1390) @@ -1,24 +0,0 @@ -# -*- Makefile -*- Time-stamp: <03/10/27 18:07:14 ptr> -# $Id$ - -# Some trick to build implicit rules for sources in some different -# subdirectories. I remove catalogs from path to sources, with this -# names I build output object path, and provide dependency from -# source in directory. Due to no loops for rules definition, I should -# use recursion here; - -# try take directory from list: -WORD1 := $(word 1,$(DIRS_UNIQUE_SRC)) - -# is still directory in the list? -ifneq "$(WORD1)" "" -include ${RULESBASE}/rules-o.mak -include ${RULESBASE}/rules-d.mak -ifeq ($(OSNAME),cygming) -include ${RULESBASE}/rules-res.mak -endif -# remove processed directory from list -DIRS_UNIQUE_SRC := $(filter-out $(WORD1),$(DIRS_UNIQUE_SRC)) -# recursive include here: -include ${RULESBASE}/${USE_MAKE}/dirsrc.mak -endif Modified: trunk/complement/explore/Makefiles/gmake/linux/rules-install-so.mak =================================================================== --- trunk/complement/explore/Makefiles/gmake/linux/rules-install-so.mak 2006-11-03 12:26:36 UTC (rev 1389) +++ trunk/complement/explore/Makefiles/gmake/linux/rules-install-so.mak 2006-11-03 13:38:09 UTC (rev 1390) @@ -1,4 +1,4 @@ -# -*- makefile -*- Time-stamp: <06/11/02 10:43:02 ptr> +# -*- makefile -*- Time-stamp: <06/11/03 11:47:01 ptr> # # Copyright (c) 1997-1999, 2002, 2003, 2005, 2006 # Petr Ovtchenkov @@ -19,97 +19,35 @@ install: $(INSTALL_TAGS) -$(INSTALL_LIB_DIR)/${SO_NAMExxx}: ${SO_NAME_OUTxxx} - $(INSTALL_SO) ${SO_NAME_OUTxxx} $(INSTALL_LIB_DIR) - @if [ -h $(INSTALL_LIB_DIR)/${SO_NAMExx} ] ; then \ - if [ `readlink $(INSTALL_LIB_DIR)/${SO_NAMExx}` != "${SO_NAMExxx}" ]; then \ - rm $(INSTALL_LIB_DIR)/${SO_NAMExx}; \ - ln -s ${SO_NAMExxx} $(INSTALL_LIB_DIR)/${SO_NAMExx}; \ - fi \ - else \ - ln -s ${SO_NAMExxx} $(INSTALL_LIB_DIR)/${SO_NAMExx}; \ - fi - @if [ -h $(INSTALL_LIB_DIR)/${SO_NAMEx} ] ; then \ - if [ `readlink $(INSTALL_LIB_DIR)/${SO_NAMEx}` != "${SO_NAMExx}" ]; then \ - rm $(INSTALL_LIB_DIR)/${SO_NAMEx}; \ - ln -s ${SO_NAMExx} $(INSTALL_LIB_DIR)/${SO_NAMEx}; \ - fi \ - else \ - ln -s ${SO_NAMExx} $(INSTALL_LIB_DIR)/${SO_NAMEx}; \ - fi - @if [ -h $(INSTALL_LIB_DIR)/${SO_NAME} ] ; then \ - if [ `readlink $(INSTALL_LIB_DIR)/${SO_NAME}` != "${SO_NAMEx}" ]; then \ - rm $(INSTALL_LIB_DIR)/${SO_NAME}; \ - ln -s ${SO_NAMEx} $(INSTALL_LIB_DIR)/${SO_NAME}; \ - fi \ - else \ - ln -s ${SO_NAMEx} $(INSTALL_LIB_DIR)/${SO_NAME}; \ - fi +# 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)) + $(call do_so_links_1,$$(INSTALL_LIB_DIR$(1)),$${SO_NAME$(1)xx},$${SO_NAME$(1)xxx}) + $(call do_so_links_1,$$(INSTALL_LIB_DIR$(1)),$${SO_NAME$(1)x},$${SO_NAME$(1)xx}) + $(call do_so_links_1,$$(INSTALL_LIB_DIR$(1)),$${SO_NAME$(1)},$${SO_NAME$(1)x}) +endef +define do_install_so_links_wk +# expand to nothing, if WITHOUT_STLPORT +ifndef WITHOUT_STLPORT +$(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} -$(INSTALL_LIB_DIR_DBG)/${SO_NAME_DBGxxx}: ${SO_NAME_OUT_DBGxxx} - $(INSTALL_SO) ${SO_NAME_OUT_DBGxxx} $(INSTALL_LIB_DIR_DBG) - @if [ -h $(INSTALL_LIB_DIR_DBG)/${SO_NAME_DBGxx} ] ; then \ - if [ `readlink $(INSTALL_LIB_DIR_DBG)/${SO_NAME_DBGxx}` != "${SO_NAME_DBGxxx}" ]; then \ - rm $(INSTALL_LIB_DIR_DBG)/${SO_NAME_DBGxx}; \ - ln -s ${SO_NAME_DBGxxx} $(INSTALL_LIB_DIR_DBG)/${SO_NAME_DBGxx}; \ - fi \ - else \ - ln -s ${SO_NAME_DBGxxx} $(INSTALL_LIB_DIR_DBG)/${SO_NAME_DBGxx}; \ - fi - @if [ -h $(INSTALL_LIB_DIR_DBG)/${SO_NAME_DBGx} ] ; then \ - if [ `readlink $(INSTALL_LIB_DIR_DBG)/${SO_NAME_DBGx}` != "${SO_NAME_DBGxx}" ]; then \ - rm $(INSTALL_LIB_DIR_DBG)/${SO_NAME_DBGx}; \ - ln -s ${SO_NAME_DBGxx} $(INSTALL_LIB_DIR_DBG)/${SO_NAME_DBGx}; \ - fi \ - else \ - ln -s ${SO_NAME_DBGxx} $(INSTALL_LIB_DIR_DBG)/${SO_NAME_DBGx}; \ - fi - @if [ -h $(INSTALL_LIB_DIR_DBG)/${SO_NAME_DBG} ] ; then \ - if [ `readlink $(INSTALL_LIB_DIR_DBG)/${SO_NAME_DBG}` != "${SO_NAME_DBGx}" ]; then \ - rm $(INSTALL_LIB_DIR_DBG)/${SO_NAME_DBG}; \ - ln -s ${SO_NAME_DBGx} $(INSTALL_LIB_DIR_DBG)/${SO_NAME_DBG}; \ - fi \ - else \ - ln -s ${SO_NAME_DBGx} $(INSTALL_LIB_DIR_DBG)/${SO_NAME_DBG}; \ - fi - - install-dbg-shared: dbg-shared $(INSTALL_LIB_DIR_DBG) $(INSTALL_LIB_DIR_DBG)/${SO_NAME_DBGxxx} ${POST_INSTALL_DBG} ifndef WITHOUT_STLPORT -$(INSTALL_LIB_DIR_STLDBG)/${SO_NAME_STLDBGxxx}: ${SO_NAME_OUT_STLDBGxxx} - $(INSTALL_SO) ${SO_NAME_OUT_STLDBGxxx} $(INSTALL_LIB_DIR_STLDBG) - @if [ -h $(INSTALL_LIB_DIR_STLDBG)/${SO_NAME_STLDBGxx} ] ; then \ - if [ `readlink $(INSTALL_LIB_DIR_STLDBG)/${SO_NAME_STLDBGxx}` != "${SO_NAME_STLDBGxxx}" ]; then \ - rm $(INSTALL_LIB_DIR_STLDBG)/${SO_NAME_STLDBGxx}; \ - ln -s ${SO_NAME_STLDBGxxx} $(INSTALL_LIB_DIR_STLDBG)/${SO_NAME_STLDBGxx}; \ - fi \ - else \ - ln -s ${SO_NAME_STLDBGxxx} $(INSTALL_LIB_DIR_STLDBG)/${SO_NAME_STLDBGxx}; \ - fi - @if [ -h $(INSTALL_LIB_DIR_STLDBG)/${SO_NAME_STLDBGx} ] ; then \ - if [ `readlink $(INSTALL_LIB_DIR_STLDBG)/${SO_NAME_STLDBGx}` != "${SO_NAME_STLDBGxx}" ]; then \ - rm $(INSTALL_LIB_DIR_STLDBG)/${SO_NAME_STLDBGx}; \ - ln -s ${SO_NAME_STLDBGxx} $(INSTALL_LIB_DIR_STLDBG)/${SO_NAME_STLDBGx}; \ - fi \ - else \ - ln -s ${SO_NAME_STLDBGxx} $(INSTALL_LIB_DIR_STLDBG)/${SO_NAME_STLDBGx}; \ - fi - @if [ -h $(INSTALL_LIB_DIR_STLDBG)/${SO_NAME_STLDBG} ] ; then \ - if [ `readlink $(INSTALL_LIB_DIR_STLDBG)/${SO_NAME_STLDBG}` != "${SO_NAME_STLDBGx}" ]; then \ - rm $(INSTALL_LIB_DIR_STLDBG)/${SO_NAME_STLDBG}; \ - ln -s ${SO_NAME_STLDBGx} $(INSTALL_LIB_DIR_STLDBG)/${SO_NAME_STLDBG}; \ - fi \ - else \ - ln -s ${SO_NAME_STLDBGx} $(INSTALL_LIB_DIR_STLDBG)/${SO_NAME_STLDBG}; \ - fi - install-stldbg-shared: stldbg-shared $(INSTALL_LIB_DIR_STLDBG) $(INSTALL_LIB_DIR_STLDBG)/${SO_NAME_STLDBGxxx} ${POST_INSTALL_STLDBG} - -# WITHOUT_STLPORT endif Modified: trunk/complement/explore/Makefiles/gmake/linux/rules-so.mak =================================================================== --- trunk/complement/explore/Makefiles/gmake/linux/rules-so.mak 2006-11-03 12:26:36 UTC (rev 1389) +++ trunk/complement/explore/Makefiles/gmake/linux/rules-so.mak 2006-11-03 13:38:09 UTC (rev 1390) @@ -1,4 +1,4 @@ -# -*- makefile -*- Time-stamp: <06/11/02 10:40:52 ptr> +# -*- makefile -*- Time-stamp: <06/11/03 11:45:22 ptr> # # Copyright (c) 1997-1999, 2002, 2003, 2005, 2006 # Petr Ovtchenkov @@ -18,187 +18,55 @@ dbg-shared: $(OUTPUT_DIR_DBG) ${SO_NAME_OUT_DBGxxx} ifndef WITHOUT_STLPORT - stldbg-shared: $(OUTPUT_DIR_STLDBG) ${SO_NAME_OUT_STLDBGxxx} - endif -ifeq ("${_C_SOURCES_ONLY}","") +define do_so_links_1 +@if [ -h $(1)/$(2)} ] ; then \ + if [ `readlink $(1)/$(2)` != "$(3)" ]; then \ + rm $(1)/$(2); \ + ln -s $(3) $(1)/$(2); \ + fi \ +else \ + ln -s $(3) $(1)/$(2); \ +fi +endef -${SO_NAME_OUTxxx}: $(OBJ) $(LIBSDEP) - $(LINK.cc) $(LINK_OUTPUT_OPTION) ${START_OBJ} $(OBJ) $(LDLIBS) ${STDLIBS} ${END_OBJ} - @if [ -h $(OUTPUT_DIR)/${SO_NAMExx} ] ; then \ - if [ `readlink $(OUTPUT_DIR)/${SO_NAMExx}` != "${SO_NAMExxx}" ]; then \ - rm $(OUTPUT_DIR)/${SO_NAMExx}; \ - ln -s ${SO_NAMExxx} $(OUTPUT_DIR)/${SO_NAMExx}; \ - fi \ - else \ - ln -s ${SO_NAMExxx} $(OUTPUT_DIR)/${SO_NAMExx}; \ - fi - @if [ -h $(OUTPUT_DIR)/${SO_NAMEx} ] ; then \ - if [ `readlink $(OUTPUT_DIR)/${SO_NAMEx}` != "${SO_NAMExx}" ]; then \ - rm $(OUTPUT_DIR)/${SO_NAMEx}; \ - ln -s ${SO_NAMExx} $(OUTPUT_DIR)/${SO_NAMEx}; \ - fi \ - else \ - ln -s ${SO_NAMExx} $(OUTPUT_DIR)/${SO_NAMEx}; \ - fi - @if [ -h $(OUTPUT_DIR)/${SO_NAME} ] ; then \ - if [ `readlink $(OUTPUT_DIR)/${SO_NAME}` != "${SO_NAMEx}" ]; then \ - rm $(OUTPUT_DIR)/${SO_NAME}; \ - ln -s ${SO_NAMEx} $(OUTPUT_DIR)/${SO_NAME}; \ - fi \ - else \ - ln -s ${SO_NAMEx} $(OUTPUT_DIR)/${SO_NAME}; \ - fi +# 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... -${SO_NAME_OUT_DBGxxx}: $(OBJ_DBG) $(LIBSDEP) - $(LINK.cc) $(LINK_OUTPUT_OPTION) ${START_OBJ} $(OBJ_DBG) $(LDLIBS) ${STDLIBS} ${END_OBJ} - @if [ -h $(OUTPUT_DIR_DBG)/${SO_NAME_DBGxx} ] ; then \ - if [ `readlink $(OUTPUT_DIR_DBG)/${SO_NAME_DBGxx}` != "${SO_NAME_DBGxxx}" ]; then \ - rm $(OUTPUT_DIR_DBG)/${SO_NAME_DBGxx}; \ - ln -s ${SO_NAME_DBGxxx} $(OUTPUT_DIR_DBG)/${SO_NAME_DBGxx}; \ - fi \ - else \ - ln -s ${SO_NAME_DBGxxx} $(OUTPUT_DIR_DBG)/${SO_NAME_DBGxx}; \ - fi - @if [ -h $(OUTPUT_DIR_DBG)/${SO_NAME_DBGx} ] ; then \ - if [ `readlink $(OUTPUT_DIR_DBG)/${SO_NAME_DBGx}` != "${SO_NAME_DBGxx}" ]; then \ - rm $(OUTPUT_DIR_DBG)/${SO_NAME_DBGx}; \ - ln -s ${SO_NAME_DBGxx} $(OUTPUT_DIR_DBG)/${SO_NAME_DBGx}; \ - fi \ - else \ - ln -s ${SO_NAME_DBGxx} $(OUTPUT_DIR_DBG)/${SO_NAME_DBGx}; \ - fi - @if [ -h $(OUTPUT_DIR_DBG)/${SO_NAME_DBG} ] ; then \ - if [ `readlink $(OUTPUT_DIR_DBG)/${SO_NAME_DBG}` != "${SO_NAME_DBGx}" ]; then \ - rm $(OUTPUT_DIR_DBG)/${SO_NAME_DBG}; \ - ln -s ${SO_NAME_DBGx} $(OUTPUT_DIR_DBG)/${SO_NAME_DBG}; \ - fi \ - else \ - ln -s ${SO_NAME_DBGx} $(OUTPUT_DIR_DBG)/${SO_NAME_DBG}; \ - fi - -ifndef WITHOUT_STLPORT - -${SO_NAME_OUT_STLDBGxxx}: $(OBJ_STLDBG) $(LIBSDEP) - $(LINK.cc) $(LINK_OUTPUT_OPTION) ${START_OBJ} $(OBJ_STLDBG) $(LDLIBS) ${STDLIBS} ${END_OBJ} - @if [ -h $(OUTPUT_DIR_STLDBG)/${SO_NAME_STLDBGxx} ] ; then \ - if [ `readlink $(OUTPUT_DIR_STLDBG)/${SO_NAME_STLDBGxx}` != "${SO_NAME_STLDBGxxx}" ]; then \ - rm $(OUTPUT_DIR_STLDBG)/${SO_NAME_STLDBGxx}; \ - ln -s ${SO_NAME_STLDBGxxx} $(OUTPUT_DIR_STLDBG)/${SO_NAME_STLDBGxx}; \ - fi \ - else \ - ln -s ${SO_NAME_STLDBGxxx} $(OUTPUT_DIR_STLDBG)/${SO_NAME_STLDBGxx}; \ - fi - @if [ -h $(OUTPUT_DIR_STLDBG)/${SO_NAME_STLDBGx} ] ; then \ - if [ `readlink $(OUTPUT_DIR_STLDBG)/${SO_NAME_STLDBGx}` != "${SO_NAME_STLDBGxx}" ]; then \ - rm $(OUTPUT_DIR_STLDBG)/${SO_NAME_STLDBGx}; \ - ln -s ${SO_NAME_STLDBGxx} $(OUTPUT_DIR_STLDBG)/${SO_NAME_STLDBGx}; \ - fi \ - else \ - ln -s ${SO_NAME_STLDBGxx} $(OUTPUT_DIR_STLDBG)/${SO_NAME_STLDBGx}; \ - fi - @if [ -h $(OUTPUT_DIR_STLDBG)/${SO_NAME_STLDBG} ] ; then \ - if [ `readlink $(OUTPUT_DIR_STLDBG)/${SO_NAME_STLDBG}` != "${SO_NAME_STLDBGx}" ]; then \ - rm $(OUTPUT_DIR_STLDBG)/${SO_NAME_STLDBG}; \ - ln -s ${SO_NAME_STLDBGx} $(OUTPUT_DIR_STLDBG)/${SO_NAME_STLDBG}; \ - fi \ - else \ - ln -s ${SO_NAME_STLDBGx} $(OUTPUT_DIR_STLDBG)/${SO_NAME_STLDBG}; \ - fi - -# WITHOUT_STLPORT +define do_so_links +$${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 -# _C_SOURCES_ONLY -else - -${SO_NAME_OUTxxx}: $(OBJ) $(LIBSDEP) - $(LINK.c) $(LINK_OUTPUT_OPTION) $(OBJ) $(LDLIBS) - @if [ -h $(OUTPUT_DIR)/${SO_NAMExx} ] ; then \ - if [ `readlink $(OUTPUT_DIR)/${SO_NAMExx}` != "${SO_NAMExxx}" ]; then \ - rm $(OUTPUT_DIR)/${SO_NAMExx}; \ - ln -s ${SO_NAMExxx} $(OUTPUT_DIR)/${SO_NAMExx}; \ - fi \ - else \ - ln -s ${SO_NAMExxx} $(OUTPUT_DIR)/${SO_NAMExx}; \ - fi - @if [ -h $(OUTPUT_DIR)/${SO_NAMEx} ] ; then \ - if [ `readlink $(OUTPUT_DIR)/${SO_NAMEx}` != "${SO_NAMExx}" ]; then \ - rm $(OUTPUT_DIR)/${SO_NAMEx}; \ - ln -s ${SO_NAMExx} $(OUTPUT_DIR)/${SO_NAMEx}; \ - fi \ - else \ - ln -s ${SO_NAMExx} $(OUTPUT_DIR)/${SO_NAMEx}; \ - fi - @if [ -h $(OUTPUT_DIR)/${SO_NAME} ] ; then \ - if [ `readlink $(OUTPUT_DIR)/${SO_NAME}` != "${SO_NAMEx}" ]; then \ - rm $(OUTPUT_DIR)/${SO_NAME}; \ - ln -s ${SO_NAMEx} $(OUTPUT_DIR)/${SO_NAME}; \ - fi \ - else \ - ln -s ${SO_NAMEx} $(OUTPUT_DIR)/${SO_NAME}; \ - fi - -${SO_NAME_OUT_DBGxxx}: $(OBJ_DBG) $(LIBSDEP) - $(LINK.c) $(LINK_OUTPUT_OPTION) $(OBJ_DBG) $(LDLIBS) - @if [ -h $(OUTPUT_DIR_DBG)/${SO_NAME_DBGxx} ] ; then \ - if [ `readlink $(OUTPUT_DIR_DBG)/${SO_NAME_DBGxx}` != "${SO_NAME_DBGxxx}" ]; then \ - rm $(OUTPUT_DIR_DBG)/${SO_NAME_DBGxx}; \ - ln -s ${SO_NAME_DBGxxx} $(OUTPUT_DIR_DBG)/${SO_NAME_DBGxx}; \ - fi \ - else \ - ln -s ${SO_NAME_DBGxxx} $(OUTPUT_DIR_DBG)/${SO_NAME_DBGxx}; \ - fi - @if [ -h $(OUTPUT_DIR_DBG)/${SO_NAME_DBGx} ] ; then \ - if [ `readlink $(OUTPUT_DIR_DBG)/${SO_NAME_DBGx}` != "${SO_NAME_DBGxx}" ]; then \ - rm $(OUTPUT_DIR_DBG)/${SO_NAME_DBGx}; \ - ln -s ${SO_NAME_DBGxx} $(OUTPUT_DIR_DBG)/${SO_NAME_DBGx}; \ - fi \ - else \ - ln -s ${SO_NAME_DBGxx} $(OUTPUT_DIR_DBG)/${SO_NAME_DBGx}; \ - fi - @if [ -h $(OUTPUT_DIR_DBG)/${SO_NAME_DBG} ] ; then \ - if [ `readlink $(OUTPUT_DIR_DBG)/${SO_NAME_DBG}` != "${SO_NAME_DBGx}" ]; then \ - rm $(OUTPUT_DIR_DBG)/${SO_NAME_DBG}; \ - ln -s ${SO_NAME_DBGx} $(OUTPUT_DIR_DBG)/${SO_NAME_DBG}; \ - fi \ - else \ - ln -s ${SO_NAME_DBGx} $(OUTPUT_DIR_DBG)/${SO_NAME_DBG}; \ - fi - +define do_so_links_wk +# expand to nothing, if WITHOUT_STLPORT ifndef WITHOUT_STLPORT - -${SO_NAME_OUT_STLDBGxxx}: $(OBJ_STLDBG) $(LIBSDEP) - $(LINK.c) $(LINK_OUTPUT_OPTION) $(OBJ_STLDBG) $(LDLIBS) - @if [ -h $(OUTPUT_DIR_STLDBG)/${SO_NAME_STLDBGxx} ] ; then \ - if [ `readlink $(OUTPUT_DIR_STLDBG)/${SO_NAME_STLDBGxx}` != "${SO_NAME_STLDBGxxx}" ]; then \ - rm $(OUTPUT_DIR_STLDBG)/${SO_NAME_STLDBGxx}; \ - ln -s ${SO_NAME_STLDBGxxx} $(OUTPUT_DIR_STLDBG)/${SO_NAME_STLDBGxx}; \ - fi \ - else \ - ln -s ${SO_NAME_STLDBGxxx} $(OUTPUT_DIR_STLDBG)/${SO_NAME_STLDBGxx}; \ - fi - @if [ -h $(OUTPUT_DIR_STLDBG)/${SO_NAME_STLDBGx} ] ; then \ - if [ `readlink $(OUTPUT_DIR_STLDBG)/${SO_NAME_STLDBGx}` != "${SO_NAME_STLDBGxx}" ]; then \ - rm $(OUTPUT_DIR_STLDBG)/${SO_NAME_STLDBGx}; \ - ln -s ${SO_NAME_STLDBGxx} $(OUTPUT_DIR_STLDBG)/${SO_NAME_STLDBGx}; \ - fi \ - else \ - ln -s ${SO_NAME_STLDBGxx} $(OUTPUT_DIR_STLDBG)/${SO_NAME_STLDBGx}; \ - fi - @if [ -h $(OUTPUT_DIR_STLDBG)/${SO_NAME_STLDBG} ] ; then \ - if [ `readlink $(OUTPUT_DIR_STLDBG)/${SO_NAME_STLDBG}` != "${SO_NAME_STLDBGx}" ]; then \ - rm $(OUTPUT_DIR_STLDBG)/${SO_NAME_STLDBG}; \ - ln -s ${SO_NAME_STLDBGx} $(OUTPUT_DIR_STLDBG)/${SO_NAME_STLDBG}; \ - fi \ - else \ - ln -s ${SO_NAME_STLDBGx} $(OUTPUT_DIR_STLDBG)/${SO_NAME_STLDBG}; \ - fi - -# WITHOUT_STLPORT +$(call do_so_links,$(1)) endif +endef -# !_C_SOURCES_ONLY -endif +$(eval $(call do_so_links,)) +$(eval $(call do_so_links,_DBG)) +# ifndef WITHOUT_STLPORT +$(eval $(call do_so_links_wk,_STLDBG)) +# endif Modified: trunk/complement/explore/Makefiles/gmake/targets.mak =================================================================== --- trunk/complement/explore/Makefiles/gmake/targets.mak 2006-11-03 12:26:36 UTC (rev 1389) +++ trunk/complement/explore/Makefiles/gmake/targets.mak 2006-11-03 13:38:09 UTC (rev 1390) @@ -1,5 +1,13 @@ -# Time-stamp: <05/04/15 17:23:30 ptr> -# $Id$ +# Time-stamp: <06/11/03 12:09:39 ptr> +# +# Copyright (c) 1997-1999, 2002, 2003, 2005, 2006 +# Petr Ovtchenkov +# +# Portion Copyright (c) 1999-2001 +# Parallel Graphics Ltd. +# +# Licensed under the Academic Free License version 3.0 +# # If we have no C++ sources, let's use C compiler for linkage instead of C++. ifeq ("$(sort ${SRC_CC} ${SRC_CPP} ${SRC_CXX})","") @@ -7,16 +15,85 @@ _C_SOURCES_ONLY := true endif -# if sources disposed in several dirs, calculate -# appropriate rules; here is recursive call! +# if sources disposed in several dirs, calculate appropriate rules 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) ) -include ${RULESBASE}/${USE_MAKE}/dirsrc.mak +# 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_o +$$(OUTPUT_DIR$(1))/%.o: $(2)%.cc + $$(COMPILE.cc) $$(OUTPUT_OPTION) $$< + +$$(OUTPUT_DIR$(1))/%.d: $(2)%.cc + @$$(COMPILE.cc) $$(CCDEPFLAGS) $$< $$(DP_OUTPUT_DIR$(1)) + +$$(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 +$$(OUTPUT_DIR$(1))/%.res: $(2)%.rc + $$(COMPILE.rc) $$(RC_OUTPUT_OPTION) $$< +endef + +define rules_ +$(call rule_o,,$(1)) +ifneq ($(OUTPUT_DIR),$(OUTPUT_DIR_A)) +$(call rule_o,_A,$(1)) +endif +$(call rule_o,_DBG,$(1)) +ifneq ($(OUTPUT_DIR_DBG),$(OUTPUT_DIR_A_DBG)) +$(call rule_o,_A_DBG,$(1)) +endif +ifndef WITHOUT_STLPORT +$(call rule_o,_STLDBG,$(1)) +ifneq ($(OUTPUT_DIR_STLDBG),$(OUTPUT_DIR_A_STLDBG)) +$(call rule_o,_A_STLDBG,$(1)) +endif +endif +ifeq ($(OSNAME),cygming) +$(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)))) + ALLBASE := $(basename $(notdir $(SRC_CC) $(SRC_CPP) $(SRC_CXX) $(SRC_C) $(SRC_S))) ifeq (${OSNAME},cygming) RCBASE += $(basename $(notdir $(SRC_RC))) Deleted: trunk/complement/explore/Makefiles/rules-d.mak =================================================================== --- trunk/complement/explore/Makefiles/rules-d.mak 2006-11-03 12:26:36 UTC (rev 1389) +++ trunk/complement/explore/Makefiles/rules-d.mak 2006-11-03 13:38:09 UTC (rev 1390) @@ -1,92 +0,0 @@ -# -*- Makefile -*- Time-stamp: <05/08/04 07:42:06 ptr> -# $Id$ - -# Rules for release output: - -$(OUTPUT_DIR)/%.d: $(WORD1)%.cpp - @$(COMPILE.cc) $(CCDEPFLAGS) $< $(DP_OUTPUT_DIR) - -$(OUTPUT_DIR)/%.d: $(WORD1)%.cc - @$(COMPILE.cc) $(CCDEPFLAGS) $< $(DP_OUTPUT_DIR) - -$(OUTPUT_DIR)/%.d: $(WORD1)%.cxx - @$(COMPILE.cc) $(CCDEPFLAGS) $< $(DP_OUTPUT_DIR) - -$(OUTPUT_DIR)/%.d: $(WORD1)%.c - @$(COMPILE.c) $(CDEPFLAGS) $< $(DP_OUTPUT_DIR) - -ifneq ($(OUTPUT_DIR),$(OUTPUT_DIR_A)) - -$(OUTPUT_DIR_A)/%.d: $(WORD1)%.cpp - @$(COMPILE.cc) $(CCDEPFLAGS) $< $(DP_OUTPUT_DIR) - -$(OUTPUT_DIR_A)/%.d: $(WORD1)%.cc - @$(COMPILE.cc) $(CCDEPFLAGS) $< $(DP_OUTPUT_DIR) - -$(OUTPUT_DIR_A)/%.d: $(WORD1)%.cxx - @$(COMPILE.cc) $(CCDEPFLAGS) $< $(DP_OUTPUT_DIR) - -$(OUTPUT_DIR_A)/%.d: $(WORD1)%.c - @$(COMPILE.c) $(CDEPFLAGS) $< $(DP_OUTPUT_DIR) - -endif - -# Rules for debug output: - -$(OUTPUT_DIR_DBG)/%.d: $(WORD1)%.cpp - @$(COMPILE.cc) $(CCDEPFLAGS) $< $(DP_OUTPUT_DIR_DBG) - -$(OUTPUT_DIR_DBG)/%.d: $(WORD1)%.cc - @$(COMPILE.cc) $(CCDEPFLAGS) $< $(DP_OUTPUT_DIR_DBG) - -$(OUTPUT_DIR_DBG)/%.d: $(WORD1)%.cxx - @$(COMPILE.cc) $(CCDEPFLAGS) $< $(DP_OUTPUT_DIR_DBG) - -$(OUTPUT_DIR_DBG)/%.d: $(WORD1)%.c - @$(COMPILE.c) $(CDEPFLAGS) $< $(DP_OUTPUT_DIR_DBG) - -ifneq ($(OUTPUT_DIR_DBG),$(OUTPUT_DIR_A_DBG)) - -$(OUTPUT_DIR_A_DBG)/%.d: $(WORD1)%.cpp - @$(COMPILE.cc) $(CCDEPFLAGS) $< $(DP_OUTPUT_DIR_DBG) - -$(OUTPUT_DIR_A_DBG)/%.d: $(WORD1)%.cc - @$(COMPILE.cc) $(CCDEPFLAGS) $< $(DP_OUTPUT_DIR_DBG) - -$(OUTPUT_DIR_A_DBG)/%.d: $(WORD1)%.cxx - @$(COMPILE.cc) $(CCDEPFLAGS) $< $(DP_OUTPUT_DIR_DBG) - -$(OUTPUT_DIR_A_DBG)/%.d: $(WORD1)%.c - @$(COMPILE.c) $(CDEPFLAGS) $< $(DP_OUTPUT_DIR_DBG) - -endif - -# Rules for STLport debug output: - -$(OUTPUT_DIR_STLDBG)/%.d: $(WORD1)%.cpp - @$(COMPILE.cc) $(CCDEPFLAGS) $< $(DP_OUTPUT_DIR_STLDBG) - -$(OUTPUT_DIR_STLDBG)/%.d: $(WORD1)%.cc - @$(COMPILE.cc) $(CCDEPFLAGS) $< $(DP_OUTPUT_DIR_STLDBG) - -$(OUTPUT_DIR_STLDBG)/%.d: $(WORD1)%.cxx - @$(COMPILE.cc) $(CCDEPFLAGS) $< $(DP_OUTPUT_DIR_STLDBG) - -$(OUTPUT_DIR_STLDBG)/%.d: $(WORD1)%.c - @$(COMPILE.c) $(CDEPFLAGS) $< $(DP_OUTPUT_DIR_STLDBG) - -ifneq ($(OUTPUT_DIR_STLDBG),$(OUTPUT_DIR_A_STLDBG)) - -$(OUTPUT_DIR_A_STLDBG)/%.d: $(WORD1)%.cpp - @$(COMPILE.cc) $(CCDEPFLAGS) $< $(DP_OUTPUT_DIR_STLDBG) - -$(OUTPUT_DIR_A_STLDBG)/%.d: $(WORD1)%.cc - @$(COMPILE.cc) $(CCDEPFLAGS) $< $(DP_OUTPUT_DIR_STLDBG) - -$(OUTPUT_DIR_A_STLDBG)/%.d: $(WORD1)%.cxx - @$(COMPILE.cc) $(CCDEPFLAGS) $< $(DP_OUTPUT_DIR_STLDBG) - -$(OUTPUT_DIR_A_STLDBG)/%.d: $(WORD1)%.c - @$(COMPILE.c) $(CDEPFLAGS) $< $(DP_OUTPUT_DIR_STLDBG) - -endif Deleted: trunk/complement/explore/Makefiles/rules-o.mak =================================================================== --- trunk/complement/explore/Makefiles/rules-o.mak 2006-11-03 12:26:36 UTC (rev 1389) +++ trunk/complement/explore/Makefiles/rules-o.mak 2006-11-03 13:38:09 UTC (rev 1390) @@ -1,128 +0,0 @@ -# -*- Makefile -*- Time-stamp: <05/04/18 08:02:06 ptr> -# $Id$ - -# Rules for release output: - -$(OUTPUT_DIR)/%.o: $(WORD1)%.cpp - $(COMPILE.cc) $(OUTPUT_OPTION) $< - -$(OUTPUT_DIR)/%.o: $(WORD1)%.cc - $(COMPILE.cc) $(OUTPUT_OPTION) $< - -$(OUTPUT_DIR)/%.o: $(WORD1)%.cxx - $(COMPILE.cc) $(OUTPUT_OPTION) $< - -$(OUTPUT_DIR)/%.o: $(WORD1)%.c - $(COMPILE.c) $(OUTPUT_OPTION) $< - -$(OUTPUT_DIR)/%.o: $(WORD1)%.s - $(COMPILE.s) $(OUTPUT_OPTION) $< - -$(OUTPUT_DIR)/%.o: $(WORD1)%.S - $(COMPILE.S) $(OUTPUT_OPTION) $< - -ifneq ($(OUTPUT_DIR),$(OUTPUT_DIR_A)) - -$(OUTPUT_DIR_A)/%.o: $(WORD1)%.cpp - $(COMPILE.cc) $(OUTPUT_OPTION) $< - -$(OUTPUT_DIR_A)/%.o: $(WORD1)%.cc - $(COMPILE.cc) $(OUTPUT_OPTION) $< - -$(OUTPUT_DIR_A)/%.o: $(WORD1)%.cxx - $(COMPILE.cc) $(OUTPUT_OPTION) $< - -$(OUTPUT_DIR_A)/%.o: $(WORD1)%.c - $(COMPILE.c) $(OUTPUT_OPTION) $< - -$(OUTPUT_DIR_A)/%.o: $(WORD1)%.s - $(COMPILE.s) $(OUTPUT_OPTION) $< - -$(OUTPUT_DIR_A)/%.o: $(WORD1)%.S - $(COMPILE.S) $(OUTPUT_OPTION) $< - -endif - -# Rules for debug output: - -$(OUTPUT_DIR_DBG)/%.o: $(WORD1)%.cpp - $(COMPILE.cc) $(OUTPUT_OPTION) $< - -$(OUTPUT_DIR_DBG)/%.o: $(WORD1)%.cc - $(COMPILE.cc) $(OUTPUT_OPTION) $< - -$(OUTPUT_DIR_DBG)/%.o: $(WORD1)%.cxx - $(COMPILE.cc) $(OUTPUT_OPTION) $< - -$(OUTPUT_DIR_DBG)/%.o: $(WORD1)%.c - $(COMPILE.c) $(OUTPUT_OPTION) $< - -$(OUTPUT_DIR_DBG)/%.o: $(WORD1)%.s - $(COMPILE.s) $(OUTPUT_OPTION) $< - -$(OUTPUT_DIR_DBG)/%.o: $(WORD1)%.S - $(COMPILE.S) $(OUTPUT_OPTION) $< - -ifneq ($(OUTPUT_DIR_DBG),$(OUTPUT_DIR_A_DBG)) - -$(OUTPUT_DIR_A_DBG)/%.o: $(WORD1)%.cpp - $(COMPILE.cc) $(OUTPUT_OPTION) $< - -$(OUTPUT_DIR_A_DBG)/%.o: $(WORD1)%.cc - $(COMPILE.cc) $(OUTPUT_OPTION) $< - -$(OUTPUT_DIR_A_DBG)/%.o: $(WORD1)%.cxx - $(COMPILE.cc) $(OUTPUT_OPTION) $< - -$(OUTPUT_DIR_A_DBG)/%.o: $(WORD1)%.c - $(COMPILE.c) $(OUTPUT_OPTION) $< - -$(OUTPUT_DIR_A_DBG)/%.o: $(WORD1)%.s - $(COMPILE.s) $(OUTPUT_OPTION) $< - -$(OUTPUT_DIR_A_DBG)/%.o: $(WORD1)%.S - $(COMPILE.S) $(OUTPUT_OPTION) $< - -endif - -# Rules for STLport debug output: - -$(OUTPUT_DIR_STLDBG)/%.o: $(WORD1)%.cpp - $(COMPILE.cc) $(OUTPUT_OPTION) $< - -$(OUTPUT_DIR_STLDBG)/%.o: $(WORD1)%.cc - $(COMPILE.cc) $(OUTPUT_OPTION) $< - -$(OUTPUT_DIR_STLDBG)/%.o: $(WORD1)%.cxx - $(COMPILE.cc) $(OUTPUT_OPTION) $< - -$(OUTPUT_DIR_STLDBG)/%.o: $(WORD1)%.c - $(COMPILE.c) $(OUTPUT_OPTION) $< - -$(OUTPUT_DIR_STLDBG)/%.o: $(WORD1)%.s - $(COMPILE.s) $(OUTPUT_OPTION) $< - -$(OUTPUT_DIR_STLDBG)/%.o: $(WORD1)%.S - $(COMPILE.S) $(OUTPUT_OPTION) $< - -ifneq ($(OUTPUT_DIR_STLDBG),$(OUTPUT_DIR_A_STLDBG)) - -$(OUTPUT_DIR_A_STLDBG)/%.o: $(WORD1)%.cpp - $(COMPILE.cc) $(OUTPUT_OPTION) $< - -$(OUTPUT_DIR_A_STLDBG)/%.o: $(WORD1)%.cc - $(COMPILE.cc) $(OUTPUT_OPTION) $< - -$(OUTPUT_DIR_A_STLDBG)/%.o: $(WORD1)%.cxx - $(COMPILE.cc) $(OUTPUT_OPTION) $< - -$(OUTPUT_DIR_A_STLDBG)/%.o: $(WORD1)%.c - $(COMPILE.c) $(OUTPUT_OPTION) $< - -$(OUTPUT_DIR_A_STLDBG)/%.o: $(WORD1)%.s - $(COMPILE.s) $(OUTPUT_OPTION) $< - -$(OUTPUT_DIR_A_STLDBG)/%.o: $(WORD1)%.S - $(COMPILE.S) $(OUTPUT_OPTION) $< - -endif Deleted: trunk/complement/explore/Makefiles/rules-res.mak =================================================================== --- trunk/complement/explore/Makefiles/rules-res.mak 2006-11-03 12:26:36 UTC (rev 1389) +++ trunk/complement/explore/Makefiles/rules-res.mak 2006-11-03 13:38:09 UTC (rev 1390) @@ -1,19 +0,0 @@ -# -*- Makefile -*- Time-stamp: <03/10/27 18:12:46 ptr> -# $Id$ - -# Rules for release output: - -$(OUTPUT_DIR)/%.res: $(WORD1)%.rc - $(COMPILE.rc) $(RC_OUTPUT_OPTION) $< - -# Rules for debug output: - -$(OUTPUT_DIR_DBG)/%.res: $(WORD1)%.rc - $(COMPILE.rc) $(RC_OUTPUT_OPTION) $< - -# Rules for STLport debug output: - -$(OUTPUT_DIR_STLDBG)/%.res: $(WORD1)%.rc - $(COMPILE.rc) $(RC_OUTPUT_OPTION) $< - - This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |