Makefile strip + toolchain

Kernel binary optionally stripped for final distribution (and upload via
slow serial cable)
Custom cross-toolchain variables
This commit is contained in:
giomba 2018-12-30 23:51:20 +01:00
parent c4bfb74eef
commit 660771a06b

View File

@ -1,6 +1,10 @@
.POSIX: .POSIX:
CCX=arm-none-eabi-g++
TOOLCHAIN=arm-none-eabi-
CCX=$(TOOLCHAIN)g++
CCFLAGS=-c -Wall -fno-stack-protector -ffreestanding -fno-exceptions -march=armv7-a -mno-unaligned-access -nostdlib -Iinclude -g CCFLAGS=-c -Wall -fno-stack-protector -ffreestanding -fno-exceptions -march=armv7-a -mno-unaligned-access -nostdlib -Iinclude -g
STRIP=$(TOOLCHAIN)strip
C_HDR=$(wildcard include/*.h) C_HDR=$(wildcard include/*.h)
C_SRC=$(wildcard src/*.cpp) C_SRC=$(wildcard src/*.cpp)
@ -13,6 +17,9 @@ A_OBJ=$(patsubst src/%.s, obj/s_%.o, $(A_SRC))
all: environ bin/kernel.elf all: environ bin/kernel.elf
strip: bin/kernel.elf
$(STRIP) -s bin/kernel.elf
environ: environ:
mkdir -p bin mkdir -p bin
mkdir -p obj mkdir -p obj