I'm trying to create a Makefile that will download and process file a file to generate targets, this is a simplified version:
default: all
.PHONY: all clean filelist.d
clean:
@rm -fv *.date *.d
#The actual list comes from a FTP file, but let's simplify things a bit
filelist.d:
@echo "Getting updated filelist..."
@echo "LIST=$(shell date +\%M)1.date $(shell date +\%M)2.date" > $@
@echo 'all: $$(LIST)' >> $@
%.date:
touch $@
-include filelist.d
Unfortunately the target all doesn't get updated properly on the first run, it needs to be run again to get the files. This is the output I get from it:
$ make
Getting updated filelist...
make: Nothing to be done for `default'.
$ make
Getting updated filelist...
touch 141.date
touch 142.date
touch 143.date
I'm using GNU Make 3.81 whose documentation states that it reloads the whole thing if the included files get changed. What is going wrong?