First of all thank you both for your replies.
The original problem I was trying to solve was the following.
I have a makefile like this:
Code:
ALL_FILES = $(DIR)*.txt
target: $(ALL_FILES)
command -o $@
If I run make the makefile checks all the txt files in $(DIR) and if it finds a file with timestamp newer than target it executes the command. If I add a new txt file in $(DIR) make runs the command and does the compile. However if I remove a txt file from $(DIR) there is no file with timestamp newer than target and therefore make won't do the compile. Is there a way to make it run when I delete a txt file from $(DIR)?
I came up to a code like the one in my first post but I'm not sure if I am in the right way or if there is any other solution.
neonsignal as you say my problem is that I am changing the dependencies after the make has evaluated them.