0

After reading this answer for "How do I check if file exists in Makefile?" question, I decided to try. I have a file tact1.pdf in the same folder with the makefile.

Code:

FILE = 'tact1.pdf'
all:
ifneq ("$(wildcard $(FILE))","")
    @echo "File exists"
else
    @echo "No file"
endif

Output:

$ make
No file

I tried the full path to the file: same result. What's wrong? OS: Windows XP, using cygwin.

user4035
  • 22,508
  • 11
  • 59
  • 94

1 Answers1

0

Drop the quotes around the filename. They might be okay in bash or perl, but in a makefile, they are considered the first and last characters of the filename.

FILE = tact1.pdf

Mischa
  • 2,240
  • 20
  • 18