Makefile: debug is default target, make sure include path is set to project root, better clean
This commit is contained in:
parent
948aeab825
commit
4a90d24069
1 changed files with 9 additions and 7 deletions
16
Makefile
16
Makefile
|
@ -1,19 +1,21 @@
|
|||
# SPDX-License-Identifier: MIT
|
||||
|
||||
CC = gcc
|
||||
CFLAGS = -Wall -Wextra -Werror -Wno-unused-parameter
|
||||
CFLAGS += -Wno-unused-variable -Wno-unused-function
|
||||
CFLAGS = -Wall -Wextra -Werror -Wno-unused-parameter
|
||||
CFLAGS += -Wno-unused-variable -Wno-unused-function
|
||||
CFLAGS += -Wno-unused-but-set-variable -Wno-unused-value -Wno-unused-label
|
||||
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-unwind-tables -fno-stack-protector -fno-plt -fno-pic
|
||||
CFLAGS += -O3 -std=c99 -march=native -mtune=native -fomit-frame-pointer
|
||||
CFLAGS += -fshort-enums
|
||||
else
|
||||
CFLAGS += -g -O0 -std=c99 -march=native -mtune=native
|
||||
CFLAGS += -DDEBUG
|
||||
endif # DEBUG
|
||||
|
||||
LDFLAGS = -lm
|
||||
|
@ -50,7 +52,7 @@ install:
|
|||
@cp ringbuf.h /usr/local/include
|
||||
|
||||
clean:
|
||||
rm -f $(OBJECTS) $(ASMS) driver librbuf.a librbuf.so
|
||||
rm -f $(OBJECTS) $(ASMS) driver librbuf.a librbuf.so **/*.o **/*.elf
|
||||
|
||||
asm: $(ASMS) $(OBJECTS)
|
||||
wc -l $(ASMS)
|
||||
|
|
Loading…
Reference in a new issue