2015-10-14 18:02:41 +00:00
|
|
|
include ../kernel.settings
|
2016-01-28 18:50:04 +00:00
|
|
|
SRCS = $(shell find hal/$(arch) -name '*.cpp' -o -name '*.[cS]')
|
2016-02-04 11:57:35 +00:00
|
|
|
KERNSRCS = $(shell find kernel -name '*.cpp' -o -name '*.c')
|
2015-10-13 14:11:06 +00:00
|
|
|
OBJS = $(addsuffix .o,$(basename $(SRCS)))
|
2016-02-04 11:57:35 +00:00
|
|
|
OBJS += $(addsuffix .o,$(basename $(KERNSRCS)))
|
2015-10-14 18:02:41 +00:00
|
|
|
LD = $(PREFIX)g++
|
2016-01-28 18:50:04 +00:00
|
|
|
LDFLAGS = -nostdlib -nodefaultlibs -nostdlib -fno-builtin
|
|
|
|
ifeq ($(arch),x86)
|
|
|
|
LDFLAGS += -m32 -T kernel.ld
|
|
|
|
endif
|
2016-02-04 11:57:35 +00:00
|
|
|
all: hal kernel
|
2015-10-13 14:11:06 +00:00
|
|
|
$(LD) $(LDFLAGS) -o mtgos $(OBJS)
|
2015-10-10 12:59:23 +00:00
|
|
|
hal:
|
|
|
|
make -C hal
|
2016-02-04 11:57:35 +00:00
|
|
|
kernel:
|
|
|
|
make -C kernel
|
2015-10-10 12:59:23 +00:00
|
|
|
clean:
|
|
|
|
make -C hal clean
|
2016-02-04 11:57:35 +00:00
|
|
|
make -C kernel clean
|
2015-10-10 12:59:23 +00:00
|
|
|
|
2016-02-04 11:57:35 +00:00
|
|
|
.PHONY: all hal kernel clean
|