Is there a way to reevaluate a variable's definition upon each use? For example:
MAP_FILES = $(shell find $(TMP) -name "*.map")
all: generate_map_files work_with_map_files
generate_map_files:
./map-builder
work\_with\_map_files: $(MAP_FILES)
./map-user
%.map:
./map-edit $@
So, MAP_FILES will be evaluated when the makefile is read, and if there are no .map files in the directory $TMP the variable will be empty. However after the generate_map_files rule is completed there will be .map files in the directory and I would like the list of those .map files to be prerequisites to the work_with_map_files rule.
I don't know the filenames of the .map files before they are generated so I can not declare a variable with filenames explicitly. I need the variable to be set with the list of map files once they have been generated. Any suggestions would be very helpful. Thanks.