How to run some commands globally in a Gnu Make file
问题 I have a gnu Makefile that collects version information through environment variables. Now, I want to do "something" globally before any target is built using the gnumake syntax. As pseudo code, this means: when a specified file exists, delete it run through an array of strings and put their value into a specified file I tried this: $(shell if exist $(subst /,\,$(products)filenames.h) del /F/Q $(subst /,\,$(products)filenames.h)) $(foreach Item, $(EnvFilenames), @echo $(Item) >> $(subst /,\,$