Created
March 22, 2016 09:23
-
-
Save mstrehler/32bbadb7483cbe6574d7 to your computer and use it in GitHub Desktop.
the snippet checks for the existence of a file from within a Makefile.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# from make documentation. | |
# $(wildcard pattern): 'pattern' is a file name pattern [...]. | |
# The result of wildcard is a space-separated | |
# list of the names of existing files that match the pattern. | |
path2file = test.txt | |
ifneq ("$(wildcard $(path2file))","") | |
fileexists = 1 | |
else | |
fileexists = 0 | |
endif |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment