2016-04-26 18:43:12 +00:00
|
|
|
include ../kernel.settings
|
2016-05-22 18:13:06 +00:00
|
|
|
SRCS = $(shell find -name '*.cpp')
|
2016-04-26 18:43:12 +00:00
|
|
|
OBJS = $(addsuffix .o,$(basename $(SRCS)))
|
2016-05-22 18:13:06 +00:00
|
|
|
AS = $(PREFIX)gcc
|
|
|
|
CPP = $(PREFIX)g++
|
2016-04-26 18:43:12 +00:00
|
|
|
LD = $(PREFIX)ld
|
2016-06-17 19:39:43 +00:00
|
|
|
ASFLAGS = $(ARCHFLAGS)
|
|
|
|
CPPFLAGS = $(ARCHFLAGS) -Wall -fno-stack-protector -nostdinc -std=c++14 -Iinclude/ -Ic_include/ -fno-rtti -fno-exceptions -ffreestanding -fno-builtin -Werror -nostdlib -fno-use-cxa-atexit -Wextra -Wno-unused -g -fpie
|
|
|
|
LDFLAGS = -Ttest-$(arch).ld
|
2016-05-22 18:13:06 +00:00
|
|
|
test.elf: $(OBJS) $(arch)/syscall.o
|
2016-04-26 18:43:12 +00:00
|
|
|
$(LD) $(LDFLAGS) -o $@ $^
|
|
|
|
|
2016-05-22 18:13:06 +00:00
|
|
|
%.o: %.cpp
|
|
|
|
$(CPP) $(CPPFLAGS) -c -o $@ $^
|
|
|
|
$(arch)/syscall.o: $(arch)/syscall.S
|
|
|
|
$(AS) $(ASFLAGS) -c -o $@ $^
|
2016-04-26 18:43:12 +00:00
|
|
|
clean:
|
2016-05-22 18:13:06 +00:00
|
|
|
rm $(OBJS) $(arch)/syscall.o
|
2016-04-26 18:43:12 +00:00
|
|
|
.PHONY: clean
|