Apparently, I did not attach the right file to the previous post. Here
it is.
In regards with our previous conversation, my make version is 3.80:
$ make -v
GNU Make 3.80
Copyright (C) 2002 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
Liviu
Liviu Nicoara wrote:
> Martin,
>
> I believe this is the patch we want. After we talked I realized that the
> order-only dependency actually is in effect and what we were seeing it
> was the correct behaviour. So, I am attaching it here. What it does is
> that the deps are depending on the existence on the config.h file (not
> its age).
>
> Addressing:
>
> http://issues.apache.org/jira/browse/STDCXX-85
>
> ChangeLog entry:
>
> 2005-12-30 Liviu Nicoara <[EMAIL PROTECTED]>
>
> * GNUMakefile: removed useless rules: all, builddir, added
> rule lib, added variable INCDIR
> * etc/config/makefile.rules: added order-only dependency
> on ($INCDIR)/config.h for .d files
>
> Happy New Year!
>
> Liviu
>
> Martin Sebor wrote:
>
>>Liviu Nicoara wrote:
>>[...]
>>
>>
>>>Please let me know if you see any more problems with it.
>>
>>[...]
>>
>>
>>>+config:
>>>+ $(MAKE) -C$(INCDIR)
>>>+
>>
>>
>>While this might be the right thing to do(*) I think it will become
>>a problem -- reading in and processing the entire GNUmakefile.cfg
>>every time make is invoked in either the examples or tests
>>subdirectories will be prohibitively expensive on slow systems.
>>
>>(*) If we did decide to go this route, we'd need to do the same
>>thing for the other dependencies, i.e., the library and, for tests,
>>the test driver. That will slow things down even more.
>>
>>
>>
>>># rule to make dependencies for C++ source files
>>>-$(DEPENDDIR)/%.d: %.cpp
>>>+$(DEPENDDIR)/%.d: %.cpp config
>>
>>
>>I would try this instead:
>>
>> $(DEPENDDIR)/%.d: %.cpp | config
>>
>>Martin
>>
>
>
>
Index: GNUmakefile
===================================================================
--- GNUmakefile (revision 360136)
+++ 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 360136)
+++ etc/config/makefile.rules (working copy)
@@ -146,6 +146,8 @@
endif # eq ($(findstring clean,$(MAKECMDGOALS)),)
+$(INCDIR)/config.h:
+ $(MAKE) -C$(INCDIR)
ifneq ($(DEPENDFLAGS),)
@@ -189,21 +191,19 @@
endef
# rule to make dependencies for C++ source files
-$(DEPENDDIR)/%.d: %.cpp
+$(DEPENDDIR)/%.d: %.cpp | $(INCDIR)/config.h
$(makedep)
# rule to make dependencies for assembly files
-$(DEPENDDIR)/%.d: %$(AS_EXT)
+$(DEPENDDIR)/%.d: %$(AS_EXT) | $(INCDIR)/config.h
$(makedep)
-
else # ifeq ($(DEPENDFLAGS),)
-$(DEPENDDIR)/%.d:
+$(DEPENDDIR)/%.d: | $(INCDIR)/config.h
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