Hi, in a include *.mak a file is created and added to `mydir_DATA'. The including (super-/caller) Makefile should be able to change the default of this file name. If the Makefile takes no action (except directly or indirectly including this *.mak), the defaults should be used.
To ease maintenance, the order of inclusion of *.mak should not matter. We came closet to this goal by using: TO_BE_USED=$(firstword $(OVERWRITE) default) Makefile.am: ------------------------------------------------------------------->8======= LIST=$(firstword $(PREPEND) default) test_DATA=$(LIST) testdir=. testlist: @echo $(LIST) =======8<------------------------------------------------------------------- automake fails: test/Makefile.am:24: variable `PREPEND' not defined but `make -f Makefile.am testlist' works: default This try fails: ------------------------------------------------------------------->8======= LIST=2 LIST?=default testlist: @echo $(LIST) =======8<------------------------------------------------------------------- automake: test/Makefile.am:30: bad macro name `LIST?' but `make -f Makefile.am testlist' works: 2 This has also the disadvantage that because of ?= the value depends on the include order of the *.mak helpers. But in first inclusion order does not matter, even if PREPEND (or OVERWRITE) is defined later than LIST, i.e. Make can do: ------------------------------------------------------------------->8======= LIST=$(firstword $(PREPEND) default) PREPEND=overwritten_later_but_works! (only firstword, so _ used :)) testlist: @echo $(LIST) =======8<------------------------------------------------------------------- # make -f Makefile.am testlist overwritten_later_but_works! This also works with automake as long as PREPEND is defined: ------------------------------------------------------------------->8======= test_DATA=$(LIST) testdir=. LIST=$(firstword $(PREPEND) default) PREPEND=overwritten_later_but_works! (only firstword, so _ used :)) testlist: @echo $(LIST) =======8<------------------------------------------------------------------- make: *** No rule to make target `overwritten_later_but_works!', needed by `all- am'. Stop. so correctly tried to build overwritten_later_but_works!. With "if COND", configure.in must know about, even if COND isn't used (i.e. not set), because of `Makefile.am:31: COND does not appear in AM_CONDITIONAL') Because I didn't know how to handle I added to all Makefile.am with that problem a PREPEND= at the end, but I think there is a better way to archive this? Is there a way to archive the goal? What would be best to handle this? oki, Steffen