Default options in config.mk, test targets
This commit is contained in:
parent
9f92308131
commit
e13dce000a
1 changed files with 11 additions and 1 deletions
12
config.mk
12
config.mk
|
@ -4,12 +4,22 @@ MAKEFLAGS += --no-print-directory
|
||||||
.PRECIOUS: %.o
|
.PRECIOUS: %.o
|
||||||
.PRECIOUS: %.asm
|
.PRECIOUS: %.asm
|
||||||
|
|
||||||
|
TARGET ?= main.elf
|
||||||
|
SRCS ?= $(wildcard *.cc)
|
||||||
|
HDRS ?= $(wildcard *.h)
|
||||||
|
|
||||||
OBJS = $(SRCS:.cc=.o)
|
OBJS = $(SRCS:.cc=.o)
|
||||||
ASMS = $(SRCS:.cc=.asm)
|
ASMS = $(SRCS:.cc=.asm)
|
||||||
|
|
||||||
all: $(TARGET) $(ASMS)
|
all: $(TARGET) $(ASMS)
|
||||||
$(TARGET): $(OBJS)
|
$(TARGET): $(OBJS)
|
||||||
|
|
||||||
|
test: $(TARGET)
|
||||||
|
./$(TARGET)
|
||||||
|
|
||||||
|
check: $(SRCS) $(HDRS)
|
||||||
|
cppcheck --language=c++ $^
|
||||||
|
|
||||||
asm: $(ASMS)
|
asm: $(ASMS)
|
||||||
|
|
||||||
%.o: %.cc
|
%.o: %.cc
|
||||||
|
@ -27,4 +37,4 @@ asm: $(ASMS)
|
||||||
clean:
|
clean:
|
||||||
rm -f *.elf *.asm *.o
|
rm -f *.elf *.asm *.o
|
||||||
|
|
||||||
.PHONY: clean all asm
|
.PHONY: clean all asm check test
|
||||||
|
|
Loading…
Reference in a new issue