You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stdcxx.apache.org by se...@apache.org on 2006/11/15 02:39:09 UTC
svn commit: r475095 - in /incubator/stdcxx/trunk/etc/config: GNUmakefile.bin
makefile.common makefile.rules
Author: sebor
Date: Tue Nov 14 17:39:09 2006
New Revision: 475095
URL: http://svn.apache.org/viewvc?view=rev&rev=475095
Log:
2006-11-14 Martin Sebor <se...@roguewave.com>
STDCXX-302
* makefile.common (CXX.repo): New make function.
* makefile.rules (%.o, %): Used CXX.repo in rules.
* GNUmakefile.bin (exec, locale, localedef): Same.
Modified:
incubator/stdcxx/trunk/etc/config/GNUmakefile.bin
incubator/stdcxx/trunk/etc/config/makefile.common
incubator/stdcxx/trunk/etc/config/makefile.rules
Modified: incubator/stdcxx/trunk/etc/config/GNUmakefile.bin
URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/etc/config/GNUmakefile.bin?view=diff&rev=475095&r1=475094&r2=475095
==============================================================================
--- incubator/stdcxx/trunk/etc/config/GNUmakefile.bin (original)
+++ incubator/stdcxx/trunk/etc/config/GNUmakefile.bin Tue Nov 14 17:39:09 2006
@@ -8,7 +8,7 @@
include ../makefile.in
-SRCDIRS = $(TOPDIR)/util
+SRCDIRS = $(TOPDIR)/src/util
# include common variables setting for all makefiles
ONE_REPOSITORY = 1
@@ -58,22 +58,25 @@
# link the run utility
exec: runall.o cmdopt.o output.o util.o exec.o display.o
- @echo "$(LD) $^ -o $@ $(LDFLAGS.exec) $(LDLIBS)" >> $(LOGFILE)
- $(LD) $^ -o $@ $(LDFLAGS.exec) $(LDLIBS) $(TEEOPTS)
+ @echo "$(LD) $^ -o $@ $(LDFLAGS.exec) $(LDLIBS)" $(call CXX.repo,$<)
+ \>> $(LOGFILE)
+ $(LD) $^ -o $@ $(LDFLAGS.exec) $(LDLIBS) $(call CXX.repo,$<) $(TEEOPTS)
# link the localedef utility
localedef: localedef.o aliases.o charmap.o codecvt.o collate.o ctype.o \
def.o diagnostic.o messages.o monetary.o numeric.o path.o \
time.o scanner.o
- @echo "$(LD) $^ -o $@ $(LDFLAGS) $(LDLIBS)" >> $(LOGFILE)
- $(LD) $^ -o $@ $(LDFLAGS) $(LDLIBS) $(TEEOPTS)
+ @echo "$(LD) $^ -o $@ $(LDFLAGS) $(LDLIBS)" $(call CXX.repo,$<) \
+ >> $(LOGFILE)
+ $(LD) $^ -o $@ $(LDFLAGS) $(LDLIBS) $(call CXX.repo,$<) $(TEEOPTS)
# link the locale utility
locale: locale.o aliases.o charmap.o codecvt.o collate.o def.o ctype.o \
diagnostic.o memchk.o messages.o monetary.o numeric.o path.o \
scanner.o time.o
- @echo "$(LD) $^ -o $@ $(LDFLAGS) $(LDLIBS)" >> $(LOGFILE)
- $(LD) $^ -o $@ $(LDFLAGS) $(LDLIBS) $(TEEOPTS)
+ @echo "$(LD) $^ -o $@ $(LDFLAGS) $(LDLIBS)" $(call CXX.repo,$<) \
+ >> $(LOGFILE)
+ $(LD) $^ -o $@ $(LDFLAGS) $(LDLIBS) $(call CXX.repo,$<) $(TEEOPTS)
# build all locales with the localedef utility
locales: localedef $(LOCALE_LIST)
Modified: incubator/stdcxx/trunk/etc/config/makefile.common
URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/etc/config/makefile.common?view=diff&rev=475095&r1=475094&r2=475095
==============================================================================
--- incubator/stdcxx/trunk/etc/config/makefile.common (original)
+++ incubator/stdcxx/trunk/etc/config/makefile.common Tue Nov 14 17:39:09 2006
@@ -44,28 +44,27 @@
# SRCDIRS must be defined in GNUmakefile that includes this file
ifeq ($(ONE_REPOSITORY),)
+ # using a separate template instantiation repository for each source
+ # and object file (i.e., when each source produces one executable)
ifneq ($(CXX_REPOSITORY),)
- # compose the name of the template instantiation repository from
- # the name of the test and a unique suffix (so that each test has
- # its own and same names with different definitions do not cause
- # conflicts) and append it to the name of the compiler and linker
+ # define a function, CXX.repo, that returns the name of the template
+ # instantiation repository from the name of a source or object file
+ # and a unique suffix (so that each program has its own and the same
+ # names with different definitions do not cause conflicts)
#
# e.g., Compaq C++ where this will expand to something like
# -ptr foo.ti
- # or IBM VisualAge where it will be along the lines of
+ # or IBM VisualAge/XLC++ where it will be along the lines of
# --qtempinc=foo.ti
# or
# --qtemplateregistry=foo.ti
#
- repository_name = $(shell basename $(*F) 2>/dev/null).ti
-
- # add CPPFLAGS to LDFLAGS for compilers that implement implicit
- # inclusion but don't remember (save) the preprocessor flags used
- # during compilation
- # (e.g., IBM VisualAge)
- LDFLAGS += $(CPPFLAGS)
-
+ ifeq ($(findstring =,$(CXX_REPOSITORY)),=)
+ CXX.repo = $(CXX_REPOSITORY)$(basename $(notdir $(1))).ti
+ else
+ CXX.repo = $(CXX_REPOSITORY) $(basename $(notdir $(1))).ti
+ endif
else # ifeq ($(CXX_REPOSITORY),)
ifeq ($(CXX),CC)
ifeq ($(findstring SunOS,$(PLATFORM)),SunOS)
@@ -85,23 +84,18 @@
endif # SunPro
endif # neq ($(CXX_REPOSITORY),)
else # ifneq ($(ONE_REPOSITORY),)
-
ifneq ($(CXX_REPOSITORY),)
- repository_name = repository.ti
- endif
-endif
-ifneq ($(repository_name),)
- ifeq ($(findstring =,$(CXX_REPOSITORY)),=)
- # no space between '=' and the name of the repository
- CXXFLAGS += $(CXX_REPOSITORY)$(repository_name)
- LDFLAGS += $(CXX_REPOSITORY)$(repository_name)
- else # ifeq ($(repository_name),)
- # insert a space between the option and the name of the repository
- CXXFLAGS += $(CXX_REPOSITORY) $(repository_name)
- LDFLAGS += $(CXX_REPOSITORY) $(repository_name)
+ # using a template instantiation repository shared by all sources
+ # (i.e., when creating a single executable or library out of all
+ # the object files
+ ifeq ($(findstring =,$(CXX_REPOSITORY)),=)
+ CXX.repo = $(CXX_REPOSITORY)repository.ti
+ else
+ CXX.repo = $(CXX_REPOSITORY) repository.ti
+ endif
endif
-endif # ifeq ($(repository_name),)
+endif
CPPFLAGS += $(INCLUDES)
CXXFLAGS += $(WARNFLAGS)
Modified: incubator/stdcxx/trunk/etc/config/makefile.rules
URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/etc/config/makefile.rules?view=diff&rev=475095&r1=475094&r2=475095
==============================================================================
--- incubator/stdcxx/trunk/etc/config/makefile.rules (original)
+++ incubator/stdcxx/trunk/etc/config/makefile.rules Tue Nov 14 17:39:09 2006
@@ -66,10 +66,10 @@
endif # ifneq ($(AS_EXT),)
%.o: %.cpp
- $(CXX) -c $(CPPFLAGS) $(CXXFLAGS) $<
+ $(CXX) -c $(CPPFLAGS) $(CXXFLAGS) $(call CXX.repo,$<) $<
%: %.o
- $(LD) $< -o $@ $(LDFLAGS) $(LDLIBS)
+ $(LD) $< -o $@ $(LDFLAGS) $(LDLIBS) $(call CXX.repo,$<)
# disable compilation and linking in the same step
# %: %.cpp
@@ -78,7 +78,8 @@
# compile and link in one step to eliminate the space overhead of .o files
%: %.cpp
- $(CXX) $< -o $@ $(CPPFLAGS) $(CXXFLAGS) $(LDFLAGS) $(LDLIBS)
+ $(CXX) $< -o $@ $(CPPFLAGS) $(CXXFLAGS) $(LDFLAGS) $(LDLIBS) \
+ $(call CXX.repo,$<)
endif # eq ($(NO_DOT_O),)