On 2006-4-6 0:04 UTC, Louie McCrady wrote:
> In the example below I'm having trouble defining or setting the variable
> "sourceFiles".  I want it to contain a list of all the .cpp files that
> are newer than my target, or have missing .o files, or have other
> dependencies that have been touched.

I think I'd use
        $(MAKE) -n
then capture the output and parse out the '*.cpp' files.
Something like this (not extensively tested):

what_to_make = \
  $(shell $(MAKE) -n \
    |sed -e 's/ /\n/g' \
    |sed -e '/\.cpp$$/!d' \
  )

.PHONY: what
what:
        g++ $(what_to_make)

Well, it doesn't handle the nothing-to-build case elegantly.


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

Reply via email to