Reputation:
I wrote this Makefile:
all: clean basedemo.exe
clean:
rm -f *.exe
%.exe: %.s
vasmm68k_mot -kick1hunks -Fhunkexe -o $@ -nosym $<
My goal would be to compile every .s
file in the current folder to a separate .exe
.
Right now, I have to append the new .exe
file name to the line: all: clean basedemo.exe new_file.exe
Is there a way to avoid having to do that?
Thank you
I tried using a wildcard:
all: clean $(wildcard *.exe)
But when I run make all
only the clean recipe runs.
Upvotes: 0
Views: 126
Reputation: 1311
$(wildcard *.exe)
searchs for existing .exe
files, but they do not exist yet when you run make
.
What you can do is to find all .s
files and substitute their extension to .exe
:
FILES_S:=$(wildcard *.s)
FILES_EXE:=$(FILES_S:%.s=%.exe)
all : clean $(FILES_EXE);
Upvotes: 1