diff --git a/Makefile b/Makefile index 10c26a0..ad23202 100644 --- a/Makefile +++ b/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)