First/Makefile

41 lines
802 B
Makefile
Raw Normal View History

2024-01-29 13:03:43 +00:00
QUIET=1
all:first
OBJECT_FILES=gui.o main.o simdata.o assembly.o cpu.o
make.deps: $(subst .o,.c,${OBJECT_FILES}) $(wildcard *.h)
@$(CC) -MM $(subst .o,.c,${OBJECT_FILES}) > make.deps
include make.deps
2024-01-29 13:03:43 +00:00
ifeq "${QUIET}" "1"
QUIET_CC = @echo ' CC '$@;
QUIET_LINK = @echo ' LINK '$@;
QUIET_FAS = @echo ' FAS '$@;
2024-01-29 13:03:43 +00:00
QUIET_CLEAN = @echo ' CLEAN .';
Q = @
else
Q =
endif
all:test.rom
2024-01-29 13:03:43 +00:00
first: ${OBJECT_FILES}
${QUIET_LINK}
${Q}gcc -ggdb $^ -fsanitize=address -lncurses -ltinfo -o $@
%.rom:%.asm first
$(QUIET_FAS)
${Q}./first -i test.asm -a test.rom
%.o:%.c
2024-01-29 13:03:43 +00:00
${QUIET_CC}
${Q} gcc -ggdb -c $< -Wall -Wextra -Werror -fsanitize=address
.PHONY: clean
clean:
2024-01-29 13:03:43 +00:00
${QUIET_CLEAN}
${Q} rm -f ${OBJECT_FILES} first