stkarm/Makefile

34 lines
682 B
Makefile
Raw Normal View History

2018-12-28 08:20:09 +00:00
.POSIX:
CCX=arm-none-eabi-g++
CCFLAGS=-c -Wall -fno-stack-protector -ffreestanding -march=armv7-a -nostdlib -Iinclude -g
C_HDR=$(wildcard include/*.h)
C_SRC=$(wildcard src/*.cpp)
C_OBJ=$(patsubst src/%.cpp, obj/c_%.o, $(C_SRC))
A_SRC=$(wildcard src/*.s)
A_OBJ=$(patsubst src/%.s, obj/s_%.o, $(A_SRC))
.PHONY: all environ clean
all: environ bin/kernel.elf
environ:
mkdir -p bin
mkdir -p obj
bin/kernel.elf: environ $(A_OBJ) $(C_OBJ)
arm-none-eabi-ld --nmagic -nostdlib -T src/linker.ld -o bin/kernel.elf obj/*.o
# maybe -msomearch
obj/s_%.o: src/%.s
$(CCX) $(CCFLAGS) -o $@ $<
obj/c_%.o: src/%.cpp $(C_HDR)
$(CCX) $(CCFLAGS) -o $@ $<
clean:
rm -f bin/*
rm -f obj/*