from a .mk file i got from someone else, there's a fairly standard
define to recursively process subdirectories:

  define MAKE-SUBDIRS
  @for d in $(SUBDIRS); \
  do \
        if test -d $$d; then \
                echo $(MAKE) -C $$d $@; \
                $(MAKE) -C $$d $@; \
        else \
                echo DIR $$d skipped; \
        fi; \
  done
  endef

given this, obviously, you can define numerous targets of the form for
recursive processing:

  configure build clean:
          ${MAKE-SUBDIRS}

and subsequently invoke, say, "make clean".

  however, reading the make manual, i see an alternative form of
processing SUBDIRS that i prefer, since it supports parallel
processing and subdirectory dependencies:

  SUBDIRS = d1 d2 d3

  .PHONY: subdirs ${SUBDIRS}
  subdirs: ${SUBDIRS}

  ${SUBDIRS}:
          ${MAKE} -C $@

  d1: d2                # potential subdir dependency

but this second form doesn't accommodate a subdirectory target, such
as "configure" or "clean".

  is there a standard way to combine the best features of these two
techniques to get the best of both worlds?  it's probably obvious,
i'm just not seeing it.

rday



_______________________________________________
Help-make mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-make

Reply via email to