[Swan-dev] makefle breakage #2 recursive make rules all over the place

Andrew Cagney andrew.cagney at gmail.com
Wed Feb 18 04:39:32 EET 2015


Anyone watching the commit messages will see I added mk/subdirs.mk as
a template for doing recursive makes:

- set SUBDIRS = directory list
- include mk/subdirs.mk

except I only changed the "simple cases" .  So what are some of the
complex cases?

1. where recursion is all over the place
For instance, the top-level Makefile, where checkprograms target
decends into $(srcdir)/$$d while programs target descends into
$(top_builddir)

2. where the "::" target feature is used (GNU Make documentation
strongly suggests not doing this).
For instance:
cleanall::
        rm -rf OBJ.*
which should be written:
cleanall: cleanall.local
.PHONY: cleanall.local
cleanall.local:
        rm -rf OBJ.*

3. where sub-directories include Makefile.top
For instance initsystems/Makefile; why, I don't know.

"Fixing" any of these is most likely going to change behaviour.  Sigh.
Please feel free to give it a go :-)

Andrew


More information about the Swan-dev mailing list