SYMSRCS = $(wildcard *.s) OBJS = $(SYMSRCS:.s=.o) PROGS = $(SYMSRCS:.s=) DEBUGFLAGS ?= -g .SUFFIXES: all: $(PROGS) clean: rm -f $(OBJS) $(PROGS) %.o: %.s $(wildcard include/*.s) as $(DEBUGFLAGS) $< -o $@ %: %.o ld $(DEBUGFLAGS) $@.o -o $@