Dear all, I am trying to design a nice way for a Makefile to include sub-makefiles.
For the moment I have written code like this: define INCLUDE curdir := $(1) include $(1)/Makefile unset curdir endef # List of subdirectories containing a Makefile that should be included subdirectories := foo bar baz # Include all the specified sub-makefiles $(foreach subdirectory, $(subdirectories), $(call INCLUDE, $(subdirectory))) This does not quite work and I guess it is not possible at all in makefiles to define INCLUDE-like macros. Is there a recommended way to achieve a similar result out of repeating the three lines in the macro for each subdirectory? The idea behind this is also that each su-makefile knows its relative directory and can make use it to generate paths that are relative to the toplevel source directory. Any advice greatly appreciated. Sébastien. _______________________________________________ Help-make mailing list Help-make@gnu.org https://lists.gnu.org/mailman/listinfo/help-make