Hello Roumen, * Roumen Petrov wrote on Thu, Jun 28, 2007 at 10:26:31PM CEST: > Please find attached test case "bootstrap.sh". > > How to write Makefile.am so that created makefiles to contain > dependencies for conditional sources ?
For example, you coud use this Makefile.am instead: --- snip --- noinst_PROGRAMS = target target_SOURCES = main.c if WITH_CASE1 target_SOURCES += case1.c endif if WITH_CASE2 target_SOURCES += case2.c endif --- snip --- With the above, there is no need to set target_LDADD or target_DEPENDENCIES. Does that work for you? If no, there is also the possibility to do something like this: --- snip --- if WITH_CASE1 DEPS1=case1.lo else DEPS1= endif if WITH_CASE2 DEPS2= else DEPS2=case2.lo endif noinst_PROGRAMS=target target_SOURCES = main.c EXTRA_target_SOURCES = case1.c case2.c target_LDADD= $(DEPS1) $(DEPS2) --- snip --- But you would still not need to set target_DEPENDENCIES: automake is smart enough to figure it out itself. Cheers, Ralf