Martin,
Could you please take a look at this patch and let me know if it meets
your approval?
I have removed the all target, replaced it with a lib, which being first
in the makefile is picked when building w/ no goals and configures and
builds the library (no examples and/or tests which I believe it was the
intention).
I removed the useless builddir target in TOPDIR.
I added comments.
I added dependencies in the BUILDDIR invocations of make (else branch).
Thanks,
Liviu
==== //stdlib/dev/etc/stdlib/config/GNUmakefile#71 -
/build/nicoara/dev/stdlib/GNUmakefile ====
@@ -517,7 +517,10 @@
### TARGETS ##################################################################
-all: libstd
+# When invoked without any goals 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
@@ -599,55 +602,50 @@
&& 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 with any goals in TOPDIR for which there are no
+# rules it will invoke make in BUILDDIR passing along the goals.
.DEFAULT:
@$(MAKE) -C$(buildpath) $(MAKEFLAGS) $(MAKECMDGOALS) \
BUILDDIR=$(buildpath)
-
else # ifneq ($(in_topdir),1) ##############################################
############################################################################
# THIS BLOCK IS EVALUATED ONLY WHEN MAKE IS INVOKED IN BUILDDIR
############################################################################
-all: config lib examples util rwtest tests $(PHDTSTDIR)
+all: util examples rwtest tests $(PHDTSTDIR)
# configure (create config.h)
config:
@$(MAKE) -C$(BUILDDIR)/include
# build utilities
-util:
+util: config lib
@$(MAKE) -C$(BUILDDIR)/bin
# build library
-lib:
+lib: config
@$(MAKE) -C$(LIBDIR)
# build the test library
-rwtest:
+rwtest: config
@$(MAKE) -C$(BUILDDIR)/rwtest
# build tests, ignore failures
-tests:
+tests: config lib
-$(MAKE) -C$(TSTDIR)
# build the Plum Hall test suite, ignore failures
-phtst:
+phtst: config lib
[EMAIL PROTECTED](MAKE) -C$(PHTSTDIR)
# make examples, ignore failures
-examples:
+examples: config lib
[EMAIL PROTECTED](MAKE) -C$(EXMDIR)