guess/Makefile

28 lines
449 B
Makefile

T ?= 6
SET = 5 6 7 8 9
VALID := $(or $(filter ${T},${SET}),$(error Attempts must be in the set ${SET}))
FLAG = --gstabs+ --defsym S=$(T)
SRCDIR = src/
SRC = $(wildcard $(SRCDIR)*.s)
OBJ = $(SRC:.s=.o)
TARGET = guess
all : $(TARGET)
$(TARGET) : $(OBJ)
ld -o $@ $^
%.o : %.s
as $(FLAG) -o $@ $<
.PHONY : clean, cleanup, ready
clean :
rm -f $(TARGET) src/*.o
cleanup :
rm -f $(TARGET) *~ .*~ src/*.o src/*~ src/.*~
ready :
strip $(TARGET)