38 lines
644 B
Makefile
38 lines
644 B
Makefile
cflags += -nostdinc \
|
|
-nostdlib \
|
|
-ffreestanding \
|
|
-fno-builtin \
|
|
-std=c11 \
|
|
-pedantic \
|
|
-Wall \
|
|
-Wextra \
|
|
-mcmodel=kernel
|
|
|
|
cflags += -isystem . -isystem c_headers/include
|
|
|
|
cflags += -DPRINTF_INCLUDE_CONFIG_H=1
|
|
|
|
ifeq ($(buildtype),debug)
|
|
cflags += -O0 -g
|
|
endif
|
|
|
|
ifeq ($(buildtype),release)
|
|
cflags += -ffunction-sections -fdata-sections -Oz
|
|
endif
|
|
|
|
ldflags += -ffreestanding \
|
|
-nostdlib \
|
|
-fno-builtin \
|
|
-fuse-ld=lld \
|
|
-static
|
|
|
|
ifeq ($(buildtype),debug)
|
|
ldflags += -g
|
|
endif
|
|
|
|
ifeq ($(buildtype),release)
|
|
ldflags += -Wl,--gc-sections \
|
|
-Wl,--strip-all \
|
|
-flto
|
|
endif
|