old-MTGos-old/user/Makefile

20 lines
656 B
Makefile
Raw Normal View History

2016-04-26 18:43:12 +00:00
include ../kernel.settings
SRCS = $(shell find -name '*.cpp')
2016-04-26 18:43:12 +00:00
OBJS = $(addsuffix .o,$(basename $(SRCS)))
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
test.elf: $(OBJS) $(arch)/syscall.o
2016-04-26 18:43:12 +00:00
$(LD) $(LDFLAGS) -o $@ $^
%.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:
rm $(OBJS) $(arch)/syscall.o
2016-04-26 18:43:12 +00:00
.PHONY: clean