From e13dce000acbf7fab6958f49016af45899fce48d Mon Sep 17 00:00:00 2001 From: Imbus <> Date: Sat, 11 Jan 2025 17:43:29 +0100 Subject: [PATCH] Default options in config.mk, test targets --- config.mk | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/config.mk b/config.mk index 70b49ee..4aef6e8 100644 --- a/config.mk +++ b/config.mk @@ -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