Makefile: debug is default target, make sure include path is set to project root, better clean

This commit is contained in:
Imbus 2024-12-25 14:01:55 +01:00
parent 948aeab825
commit 4a90d24069

View file

@ -6,14 +6,16 @@ CFLAGS += -Wno-unused-variable -Wno-unused-function
CFLAGS += -Wno-unused-but-set-variable -Wno-unused-value -Wno-unused-label CFLAGS += -Wno-unused-but-set-variable -Wno-unused-value -Wno-unused-label
CFLAGS += -Wno-unused-result -Wno-unused-const-variable CFLAGS += -Wno-unused-result -Wno-unused-const-variable
ifneq ($(DEBUG), 1) CFLAGS += -I.
ifneq ($(RELEASE), 1)
CFLAGS += -g -O0 -std=c99 -march=native -mtune=native
CFLAGS += -DDEBUG
else
CFLAGS += -fno-exceptions -fno-asynchronous-unwind-tables -fno-ident CFLAGS += -fno-exceptions -fno-asynchronous-unwind-tables -fno-ident
CFLAGS += -fno-unwind-tables -fno-stack-protector -fno-plt -fno-pic CFLAGS += -fno-unwind-tables -fno-stack-protector -fno-plt -fno-pic
CFLAGS += -O3 -std=c99 -march=native -mtune=native -fomit-frame-pointer CFLAGS += -O3 -std=c99 -march=native -mtune=native -fomit-frame-pointer
CFLAGS += -fshort-enums CFLAGS += -fshort-enums
else
CFLAGS += -g -O0 -std=c99 -march=native -mtune=native
CFLAGS += -DDEBUG
endif # DEBUG endif # DEBUG
LDFLAGS = -lm LDFLAGS = -lm
@ -50,7 +52,7 @@ install:
@cp ringbuf.h /usr/local/include @cp ringbuf.h /usr/local/include
clean: clean:
rm -f $(OBJECTS) $(ASMS) driver librbuf.a librbuf.so rm -f $(OBJECTS) $(ASMS) driver librbuf.a librbuf.so **/*.o **/*.elf
asm: $(ASMS) $(OBJECTS) asm: $(ASMS) $(OBJECTS)
wc -l $(ASMS) wc -l $(ASMS)