Default options in config.mk, test targets

This commit is contained in:
Imbus 2025-01-11 17:43:29 +01:00
parent 9f92308131
commit e13dce000a

View file

@ -4,12 +4,22 @@ MAKEFLAGS += --no-print-directory
.PRECIOUS: %.o
.PRECIOUS: %.asm
TARGET ?= main.elf
SRCS ?= $(wildcard *.cc)
HDRS ?= $(wildcard *.h)
OBJS = $(SRCS:.cc=.o)
ASMS = $(SRCS:.cc=.asm)
all: $(TARGET) $(ASMS)
$(TARGET): $(OBJS)
test: $(TARGET)
./$(TARGET)
check: $(SRCS) $(HDRS)
cppcheck --language=c++ $^
asm: $(ASMS)
%.o: %.cc
@ -27,4 +37,4 @@ asm: $(ASMS)
clean:
rm -f *.elf *.asm *.o
.PHONY: clean all asm
.PHONY: clean all asm check test