old-MTGos-old/user/GNUmakefile

24 lines
805 B
Text
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
2016-06-28 09:32:24 +00:00
LDFLAGS = -Ttest-$(arch).ld -L/opt/lib/gcc/$(libpath)/6.1.0/
ifeq ($(arch),3ds)
ASFLAGS += -mcpu=mpcore -mlittle-endian
CPPFLAGS += -mcpu=mpcore -mlittle-endian
endif
test.elf: $(OBJS) $(arch)/syscall.o
2016-06-28 09:32:24 +00:00
$(LD) $(LDFLAGS) -o $@ $^ -lgcc
2016-04-26 18:43:12 +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:
rm $(OBJS) $(arch)/syscall.o
2016-04-26 18:43:12 +00:00
.PHONY: clean