stdcxx-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From se...@apache.org
Subject svn commit: r292348 - in /incubator/stdcxx/trunk: GNUmakefile etc/config/GNUmakefile.bin etc/config/GNUmakefile.exm etc/config/GNUmakefile.lib etc/config/GNUmakefile.tst etc/config/makefile.common
Date Wed, 28 Sep 2005 23:32:09 GMT
Author: sebor
Date: Wed Sep 28 16:32:02 2005
New Revision: 292348

URL: http://svn.apache.org/viewcvs?rev=292348&view=rev
Log:
2005-09-28  Martin Sebor  <sebor@roguewave.com>

	* GNUmakefile: Used the := operator instead of = in expensive
	assignments (such as those involving the $(shell) function for
	efficiency.
	* GNUmakefile.exm (SRCDIRS): Explicitly listed source directories.
	Adjusted indentation in conditionals and removed redundant spaces.
	* GNUmakefile.tst (SUBDIRS): Replaced with SRCDIRS and simplified
	the definition of the variable to avoid the expensive $(shell)
	function.
	(OMIT_SRCS): Simplified and avoided using the $(shell) function.
	(VPATH): Avoided unnecessarily appending to the variable.
	* makefile.common: Used the := operator instead of =.
	(ALL_FILES): Avoided using the expensive $(shell) function.
	(VPATH): Defined to $(SRCDIRS) instead of using	$(shell) to do
	the same thing.


Modified:
    incubator/stdcxx/trunk/GNUmakefile
    incubator/stdcxx/trunk/etc/config/GNUmakefile.bin
    incubator/stdcxx/trunk/etc/config/GNUmakefile.exm
    incubator/stdcxx/trunk/etc/config/GNUmakefile.lib
    incubator/stdcxx/trunk/etc/config/GNUmakefile.tst
    incubator/stdcxx/trunk/etc/config/makefile.common

Modified: incubator/stdcxx/trunk/GNUmakefile
URL: http://svn.apache.org/viewcvs/incubator/stdcxx/trunk/GNUmakefile?rev=292348&r1=292347&r2=292348&view=diff
==============================================================================
--- incubator/stdcxx/trunk/GNUmakefile (original)
+++ incubator/stdcxx/trunk/GNUmakefile Wed Sep 28 16:32:02 2005
@@ -136,12 +136,12 @@
 
 SHELL = /bin/sh
 
-# Set the value of OSNAME here
-OSNAME = $(shell uname)
+# define the value of OSNAME first so that it can be used in *.config files
+OSNAME := $(shell uname)
 
 # provide a value if it isn't already set by (an older version of) make
 ifeq ($(CURDIR),)
-  CURDIR = $(shell pwd)
+  CURDIR := $(shell pwd)
 endif
 
 
@@ -469,7 +469,7 @@
   endif
 
   # platform is determined as {OS-name}-{OS-version}-{hardware}
-  PLATFORM = $(shell uname -srm | sed "s/[ \/]/-/g")
+  PLATFORM := $(shell uname -srm | sed "s/[ \/]/-/g")
 
   ifeq ($(OSNAME),SunOS)
     # Sun recommends to use uname -p rather than the POSIX uname -m
@@ -508,7 +508,7 @@
 
   # obtain library version number from the macro _RWSTD_VER
   # #defined in the rw/_config.h library header
-  LIBVER = $(shell awk '/^.define _RWSTD_VER / { major = substr ($$3, 3, 2); minor = substr
($$3, 5, 2); micro = substr ($$3, 7, 2); print (major + 0) "." (minor + 0) "." (micro + 0)
}' $(TOPDIR)/include/rw/_config.h)
+  LIBVER := $(shell awk '/^.define _RWSTD_VER / { major = substr ($$3, 3, 2); minor = substr
($$3, 5, 2); micro = substr ($$3, 7, 2); print (major + 0) "." (minor + 0) "." (micro + 0)
}' $(TOPDIR)/include/rw/_config.h)
 
 ### TARGETS ##################################################################
 

Modified: incubator/stdcxx/trunk/etc/config/GNUmakefile.bin
URL: http://svn.apache.org/viewcvs/incubator/stdcxx/trunk/etc/config/GNUmakefile.bin?rev=292348&r1=292347&r2=292348&view=diff
==============================================================================
--- incubator/stdcxx/trunk/etc/config/GNUmakefile.bin (original)
+++ incubator/stdcxx/trunk/etc/config/GNUmakefile.bin Wed Sep 28 16:32:02 2005
@@ -1,6 +1,6 @@
 # -*- Makefile -*-
 #
-# $Id: //stdlib/dev/etc/stdlib/config/GNUmakefile.bin#27 $
+# $Id$
 #
 # makefile to build the C++ Standard library utility programs
 #
@@ -8,14 +8,14 @@
 
 include ../makefile.in
 
-SRCDIRS      = $(TOPDIR)/util
+SRCDIRS = $(TOPDIR)/src/util
 
 # include common variables setting for all makefiles
 ONE_REPOSITORY = 1
 include ../makefile.common
 
-INCLUDES    += -I$(TOPDIR)/include/loc
-TARGET       = localedef locale
+INCLUDES += -I$(TOPDIR)/include/loc
+TARGET    = localedef locale
 
 # locale sources and related 
 NLSDIR = $(TOPDIR)/etc/nls
@@ -28,9 +28,9 @@
 # list of locales  to be built; first compose a  full name from gen_list
 # in the form of <locale name>.<codeset> then move the modifier @euro at
 # the end of the name
-LOCALE_LIST = $(shell cat $(NLSDIR)/gen_list |                               \
-                      sed -e s:"^\([^ ]*\) *\([^ ]*\)":"\1\.\2":g            \
-                      -e s:"\([^.]*\)\(.euro\)\([^ ]*\)":"\1\3@euro":g       \
+LOCALE_LIST := $(shell cat $(NLSDIR)/gen_list |                              \
+                       sed -e s:"^\([^ ]*\) *\([^ ]*\)":"\1\.\2":g           \
+                           -e s:"\([^.]*\)\(.euro\)\([^ ]*\)":"\1\3@euro":g  \
                       -e s:"\([^.]*\)\(.cyrillic\)\([^ ]*\)":"\1\3@cyrillic":g)
 
 ## Filter from RUNTARGET only the scripts

Modified: incubator/stdcxx/trunk/etc/config/GNUmakefile.exm
URL: http://svn.apache.org/viewcvs/incubator/stdcxx/trunk/etc/config/GNUmakefile.exm?rev=292348&r1=292347&r2=292348&view=diff
==============================================================================
--- incubator/stdcxx/trunk/etc/config/GNUmakefile.exm (original)
+++ incubator/stdcxx/trunk/etc/config/GNUmakefile.exm Wed Sep 28 16:32:02 2005
@@ -1,6 +1,6 @@
 # -*- Makefile -*-
 #
-# $Id: //stdlib/dev/etc/stdlib/config/GNUmakefile.exm#33 $
+# $Id$
 #
 # makefile to build the C++ Standard library examples
 #
@@ -8,21 +8,20 @@
 
 include  ../makefile.in
 
-EXMDIR       = $(TOPDIR)/examples
-
-SRCDIRS      = $(EXMDIR)
+EXMDIR  = $(TOPDIR)/examples
+SRCDIRS = $(EXMDIR)/manual $(EXMDIR)/tutorial
 
 # do not compile these sources...
-OMIT_SRCS   += rwstdmessages.cpp
+OMIT_SRCS += rwstdmessages.cpp
 
 # override setting from makefile.in (examples only)
-CATFILE      = rwstdmessages.cat
+CATFILE = rwstdmessages.cat
 
 include ../makefile.common
 
-INCLUDES    += -I$(EXMDIR)/include
+INCLUDES += -I$(EXMDIR)/include
 
-RUNFLAGS    += -x $(EXMDIR)
+RUNFLAGS += -x $(EXMDIR)
 
 ##############################################################################
 #  TARGETS

Modified: incubator/stdcxx/trunk/etc/config/GNUmakefile.lib
URL: http://svn.apache.org/viewcvs/incubator/stdcxx/trunk/etc/config/GNUmakefile.lib?rev=292348&r1=292347&r2=292348&view=diff
==============================================================================
--- incubator/stdcxx/trunk/etc/config/GNUmakefile.lib (original)
+++ incubator/stdcxx/trunk/etc/config/GNUmakefile.lib Wed Sep 28 16:32:02 2005
@@ -1,6 +1,6 @@
 # -*- Makefile -*-
 #
-# $Id: //stdlib/dev/etc/stdlib/config/GNUmakefile.lib#35 $
+# $Id$
 #
 # makefile to build the C++ Standard library
 #

Modified: incubator/stdcxx/trunk/etc/config/GNUmakefile.tst
URL: http://svn.apache.org/viewcvs/incubator/stdcxx/trunk/etc/config/GNUmakefile.tst?rev=292348&r1=292347&r2=292348&view=diff
==============================================================================
--- incubator/stdcxx/trunk/etc/config/GNUmakefile.tst (original)
+++ incubator/stdcxx/trunk/etc/config/GNUmakefile.tst Wed Sep 28 16:32:02 2005
@@ -24,47 +24,49 @@
 #   $ make SRCS="...sources..." [ run | runall | run_all ]
 #
 #   Same as above, but considerably faster since SRCS doesn't have to be
-#   found in $(TOPDIR)/test, and only the necessary .d files are included.
+#   found in $(TOPDIR)/tests, and only the necessary .d files are included.
 #
 ##############################################################################
 
 include ../makefile.in
 
-# tests & test library directories
-TESTDIR      = $(TOPDIR)/tests
-SRCDIRS      = $(TESTDIR)
-
-# get the test suite subdirectories
-SUBDIRS      = $(shell cd $(TESTDIR) && echo *)
+# tests & rwtest library directories
+RWTESTDIR = $(TOPDIR)/../rwtest
+TESTDIR   = $(TOPDIR)/tests
+
+# get the test suite subdirectories minus those known
+# not to contain any source (i.e., .cpp) files
+SRCDIRS := $(filter-out $(TESTDIR)/docs    \
+                        $(TESTDIR)/etc     \
+                        $(TESTDIR)/include \
+                        $(TESTDIR)/src     \
+                        %.C %.c %.cc %.cpp \
+                        %.h %.hpp,         \
+                        $(wildcard $(TESTDIR)/*))
 
 # do not compile these sources
-OMIT_SRCS   += $(shell cd $(TESTDIR)/src && echo *.cpp) 22_locale.cpp
+# OMIT_SRCS   += $(shell cd $(TESTDIR)/src && echo *.cpp) 22_locale.cpp
+OMIT_SRCS += $(notdir $(wildcard $(TESTDIR)/src/*.cpp)) 22_locale.cpp
 
 # override setting from makefile.in (tests only)
-CATFILE      = rwstdmessages.cat
+CATFILE = rwstdmessages.cat
 
 include ../makefile.common
 
-# test library 
-TESTLIBBASE   = rwtest$(BUILDTYPE)
-TESTLIBNAME   = lib$(TESTLIBBASE).a
+# RW test library 
+RWTLIBBASE   = rwtest$(BUILDTYPE)
+RWTLIBNAME   = lib$(RWTLIBBASE).a
 
 # Add to include dirs and link flags:
-INCLUDES    += -I$(TESTDIR)/include
-LDFLAGS     := -L$(BUILDDIR)/rwtest -l$(TESTLIBBASE) $(LDFLAGS)
-
-# VPATH to look for sources in (appended dir for test.cpp)
-VPATH       += $(TESTDIR)/src
-
-# compile-only tests generated in the cwd
-COMPILE_SRCS = $(shell echo *.cpp 2>/dev/null)
-COMPILE_OBJS = $(patsubst %.cpp,%.o,$(COMPILE_SRCS))
+INCLUDES    += -I$(RWTESTDIR) -I$(RWTESTDIR)/include -I$(TESTDIR)/include
+LDFLAGS     := -L$(BUILDDIR)/rwtest -l$(RWTLIBBASE) $(LDFLAGS)
 
-# Targets to be built
-TARGET	     = $(patsubst %.cpp,%,$(SRCS))
-TARGET      += $(COMPILE_OBJS)
+# targets to be built: object files for sources in the source directories
+TARGET := $(patsubst %.cpp,%,$(SRCS))
+# add to targets objects for any sources in the current working directory
+TARGET += $(patsubst %.cpp,%.o,$(wildcard *.cpp))
 
-RUNFLAGS    += -X "-C $(CXX)-$(CCVER)" 
+RUNFLAGS += -X "-C $(CXX)-$(CCVER)" 
 
 ##############################################################################
 #  TARGETS
@@ -72,12 +74,12 @@
 
 all: $(TARGET)
 
-$(TARGET): $(LIBDIR)/$(LIBNAME) $(BUILDDIR)/rwtest/$(TESTLIBNAME)
+$(TARGET): $(LIBDIR)/$(LIBNAME) $(BUILDDIR)/rwtest/$(RWTLIBNAME)
 
 $(LIBDIR)/$(LIBNAME):
 	@$(MAKE) -C $(LIBDIR) MAKEOVERRIDES= 
 
-$(BUILDDIR)/rwtest/$(TESTLIBNAME):
+$(BUILDDIR)/rwtest/$(RWTLIBNAME):
 	@$(MAKE) -C $(BUILDDIR)/rwtest MAKEOVERRIDES=
 
 # do any directory specific cleanup using the realclean target
@@ -85,7 +87,7 @@
 	rm -f _*.cpp
 
 # build all tests in the given subdirectory (subsection of the standard)
-$(SUBDIRS):
+$(SRCDIRS):
 	$(MAKE) SRCS="`cd $(TESTDIR)/$@/ && echo *.cpp`"
 
 
@@ -104,7 +106,7 @@
           done ;                                                        \
           echo ; )
 
-.PHONY: $(SUBDIRS) rwtest
+.PHONY: $(SRCDIRS) rwtest
 
 # Common rules for all Makefile_s
 include ../makefile.rules

Modified: incubator/stdcxx/trunk/etc/config/makefile.common
URL: http://svn.apache.org/viewcvs/incubator/stdcxx/trunk/etc/config/makefile.common?rev=292348&r1=292347&r2=292348&view=diff
==============================================================================
--- incubator/stdcxx/trunk/etc/config/makefile.common (original)
+++ incubator/stdcxx/trunk/etc/config/makefile.common Wed Sep 28 16:32:02 2005
@@ -13,7 +13,7 @@
 
 # provide a value if it isn't already set by make
 ifeq ($(CURDIR),)
-CURDIR       = $(shell pwd)
+  CURDIR := $(shell pwd)
 endif
 
 INCLUDES     = -I$(BUILDDIR)/include -I$(TOPDIR)/include
@@ -22,7 +22,7 @@
 ifeq ($(ONE_REPOSITORY),)
 
   # traverse all subdirectories and get the names of all regular files
-  ALL_FILES = $(shell $(FIND) $(SRCDIRS) -type f -print)
+  ALL_FILES := $(foreach dir,$(SRCDIRS),$(wildcard $(dir)/*.cpp))
 
   ifneq ($(CXX_REPOSITORY),)
 
@@ -101,12 +101,12 @@
 CPPFLAGS    += $(INCLUDES)
 CXXFLAGS    += $(WARNFLAGS)
 
-VPATH        = $(shell $(FIND) $(SRCDIRS) -type d -print)
+VPATH       := $(SRCDIRS)
 
-SRCS         = $(notdir $(filter %.cpp %.s %.S,$(ALL_FILES)))
+SRCS        := $(notdir $(filter %.cpp %.s %.S,$(ALL_FILES)))
 SRCS        := $(sort $(filter-out $(OMIT_SRCS),$(SRCS)))
 
-OBJS         = $(patsubst %.cpp,%.o,$(filter %.cpp,$(SRCS)))
+OBJS        := $(patsubst %.cpp,%.o,$(filter %.cpp,$(SRCS)))
 OBJS        += $(patsubst %.s,%.o,$(filter %.s,$(SRCS)))
 OBJS        += $(patsubst %.S,%.o,$(filter %.S,$(SRCS)))
 OBJS        := $(sort $(OBJS))
@@ -116,33 +116,33 @@
 
 
 ifeq ($(TARGET),)
-# generate binaries or scripts (in constrained environments)
-ifeq ($(NO_A_DOT_OUT),)
-TARGET       = $(patsubst %.o,%,$(OBJS))
-else
-TARGET       = $(patsubst %.o,%.sh,$(OBJS))
-endif
+  # generate binaries or scripts (in constrained environments)
+  ifeq ($(NO_A_DOT_OUT),)
+    TARGET := $(patsubst %.o,%,$(OBJS))
+  else
+    TARGET := $(patsubst %.o,%.sh,$(OBJS))
+  endif
 endif #ifneq ($(TARGET),)
 
 # link with the produced library and the math library
 # (take care not to try to link the library with itself)
 ifeq ($(findstring $(LIBNAME),$(TARGET)),)
-  LDFLAGS  += -L$(LIBDIR) -l$(LIBBASE)
-  LDLIBS   += -lm
+  LDFLAGS += -L$(LIBDIR) -l$(LIBBASE)
+  LDLIBS  += -lm
 endif  # ifneq ($(LIBNAME),$findstring ($(LIBNAME),$(TARGET)))
 
 
 # file to write log of the build to
-LOGFILE     = /dev/null
+LOGFILE = /dev/null
 
 # if LOGFILE is being created, tee command output into it
 # IMPORTANT: $(TEEOPTS) must be last on the command line
 ifneq ($(LOGFILE),/dev/null)
-TEEOPTS      = 2>&1 | tee -a $(LOGFILE)
+  TEEOPTS = 2>&1 | tee -a $(LOGFILE)
 endif
 
 # determine the name of the results file against which to compute regressions
-REGRESS_FILE = $(shell                                       \
+REGRESS_FILE := $(shell                                      \
     if [ -z "$(REGRESS)" ] ; then                            \
         ls -tr1 ../$(REPORTFILE)* 2> /dev/null | tail -1 ;   \
     elif [ -f $(REGRESS) ] ; then                            \
@@ -152,18 +152,18 @@
     fi)
 
 ifeq ($(REGRESS_FILE),)
-REGRESS_FILE = "$(TOPDIR)/results/$(REPORTFILE)"
+  REGRESS_FILE = "$(TOPDIR)/results/$(REPORTFILE)"
 endif
 
 # set the RUNTARGET variable to command line args if $RUN isn't set
 ifeq ($(RUN),)
-RUNTARGET   = $(filter-out run_all runall run,$(MAKECMDGOALS))
+  RUNTARGET := $(filter-out run_all runall run,$(MAKECMDGOALS))
 else
-RUNTARGET   = $(RUN)
+  RUNTARGET := $(RUN)
 endif
 
 ifeq ($(RUNTARGET),)
-RUNTARGET    = $(shell echo ./$(TARGET) | sed "s/ / .\//g")
+  RUNTARGET := $(shell echo ./$(TARGET) | sed "s/ / .\//g")
 endif
 
 



Mime
View raw message