On Tue, May 20, 2008 at 4:32 PM, Peng Yu <[EMAIL PROTECTED]> wrote:
> What if I want to either include some file or define some other variables
> depending on whether the file is existed or not?

Use -include and then test for the presence of the filename in ${MAKEFILE_LIST}:

-include foo
ifeq ($(filter foo,${MAKEFILE_LIST}),)
$(info foo doesn't exist)
endif

MAKEFILE_LIST was added in 3.80, so you'll need at least that version
to do this.


Philip Guenther


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

Reply via email to