Addressing:

http://issues.apache.org/jira/browse/STDCXX-85

ChangeLog entry:

2005-12-15  Liviu Nicoara  <[EMAIL PROTECTED]>

        * GNUMakefile: removed useless rules: all, builddir, added
          rule lib, added variable INCDIR
        * etc/config/GNUmakefile.lib: invoked make config when
          $(INCDIR)/config.h is missing at top of makedep macro

Index: GNUmakefile
===================================================================
--- GNUmakefile (revision 357098)
+++ GNUmakefile (working copy)
@@ -517,7 +517,10 @@
 
 ### TARGETS ##################################################################
 
-all: libstd
+# When invoked without any targets in TOPDIR, it will execute the 
+# first rule in the makefile which will build lib in BUILDDIR
+lib:
+       @$(MAKE) -C$(buildpath) $(MAKEFLAGS) lib BUILDDIR=$(buildpath)
 
 # make-builddir function: creates the build directory tree
 # defined as a single shell command to avoid executing each command
@@ -576,6 +579,7 @@
           && [ "$(MAPFILE)" = "" ]                                          \
           || echo "MAPFILE    = $$""(TOPDIR)/$(MAPFILE)" >> $(MAKEFILE_IN)  \
           && echo "RUNFLAGS   = -t 180"                  >> $(MAKEFILE_IN)  \
+          && echo "INCDIR     = $$""(BUILDDIR)/include"  >> $(MAKEFILE_IN)  \
           && echo "LIBDIR     = $$""(BUILDDIR)/lib"      >> $(MAKEFILE_IN)  \
           && echo "DEPENDDIR  = $(DEPENDDIR)"            >> $(MAKEFILE_IN)  \
           && echo "PHDIR      = $(PHDIR)"                >> $(MAKEFILE_IN)  \
@@ -599,21 +603,16 @@
           && echo "DEFAULT_SHROBJ = $(DEFAULT_SHROBJ)"   >> $(MAKEFILE_IN)  \
           && echo "CXX_REPOSITORY = $(CXX_REPOSITORY)"  >> $(MAKEFILE_IN));
 
-# creates the build directory tree and generates makefile.in
-builddir: $(MAKEFILE_IN)
-       @echo "build directory created: BUILDDIR=$(BUILDDIR)"
-
-
 # prevent trying to make makefile.in when $(BUILDDIR) is
 # not defined and -include $(BUILDDIR)/makefile.in fails
 makefile.in:
 
-
+# When invoked in TOPDIR with any targets which have no rules 
+# it will invoke make in BUILDDIR passing along the targets.
 .DEFAULT:
        @$(MAKE) -C$(buildpath) $(MAKEFLAGS) $(MAKECMDGOALS) \
                  BUILDDIR=$(buildpath)
 
-
 else   # ifneq ($(in_topdir),1) ##############################################
 
   ############################################################################
@@ -650,7 +649,6 @@
 examples:
        [EMAIL PROTECTED](MAKE) -C$(EXMDIR)
 
-
 # run all tests and examples, generate result file and post it in a revison
 # control system (unless the variable DRYRUN is non-empty) ; regressions
 # are computed with respect to last posted report (not just any report that's
Index: etc/config/makefile.rules
===================================================================
--- etc/config/makefile.rules   (revision 357098)
+++ etc/config/makefile.rules   (working copy)
@@ -157,7 +157,10 @@
 # move IBM xlC generated .u files to the respective .d files
 
 define makedep
-    -@(if [ ! -f $@ ] ; then                                                 \
+    -@(if [ ! -f $(INCDIR)/config.h ] ; then                                 \
+           $(MAKE) -C$(INCDIR);                                              \
+       fi;                                                                   \
+       if [ ! -f $@ ] ; then                                                 \
            if [ ! -d $(DEPENDDIR) ]; then                                    \
                mkdir -p $(DEPENDDIR);                                        \
            fi;                                                               \
@@ -196,14 +199,12 @@
 $(DEPENDDIR)/%.d: %$(AS_EXT)
        $(makedep)
 
-
 else   # ifeq ($(DEPENDFLAGS),)
 
 $(DEPENDDIR)/%.d:
 
 endif   # neq ($(DEPENDFLAGS),)
 
-
 # disable implicit rules from trying to compile .c and .cc files
 # under the include/ directory (e.g., istream.c to istream) due
 # to being listed as dependencies of .cpp files

Reply via email to