GNU Make - Set a flag if multiple files exist
<p>In my Makefile, I check if a file exists, and execute different code depending on the result of that check.</p>

<p>Previously, there was only one relevant file, <code>OUTLIB_CACHE</code>.</p>

<pre><code>OUTLIB_CACHE := filename
OUTLIB_CACHE_EXITS := $(shell if [ -f $(OUTLIB_CACHE) ]; then echo "1"; fi;)
ifneq ($(OUTLIB_CACHE_EXISTS),1)    
    # do something
endif
</code></pre>

<p>Now I am introducing a second relevant file, storing both of the file names in a list:</p>

<pre><code>OUTLIB_CACHE_LIST := filename1 filename2
</code></pre>

<p>I want to set the <code>OUTLIB_CACHE_EXISTS</code> flag to true if and only if all the files in <code>OUTLIB_CACHE_LIST</code> exist. What would be the best way to do this?</p>