1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
SIMFILES=$(wildcard *.sm) CFILES=$(subst .sm,.c,$(SIMFILES)) OFILES=$(subst .sm,.o,$(SIMFILES)) EXES=$(subst .sm,,$(SIMFILES)) all: $(EXES) clean: rm -f $(CFILES) $(OFILES) $(EXES) *~ \#* %: %.o gcc -g -o $@ $< %.o: %.c gcc -g -c $< %.c: %.sm sim2c < $< > $@