Quick and dirty IDT setup

This commit is contained in:
2017-12-06 16:53:12 +01:00
parent 25ef5f4688
commit cbcc67fc31
6 changed files with 219 additions and 2 deletions

View File

@@ -2,8 +2,8 @@ ifeq ($(MITTOS64),)
$(error Unsupported environment! See README)
endif
SRC := $(wildcard **/*.[cS])
OBJ := $(patsubst %, %.o, $(basename $(SRC)))
SRC := $(wildcard **/*.[cS]*)
OBJ := $(patsubst %, %.o, $(basename $(basename $(SRC))))
CFLAGS ?= -Wall -Wextra -pedantic
CFLAGS += -ffreestanding -mcmodel=large
@@ -20,6 +20,9 @@ LDFLAGS := -n -nostdlib -lgcc -T Link.ld
kernel: $(OBJ)
$(LINK.c) $^ -o $@
%.S: %.S.py
python $^ > $@
# Automatically generate dependency files
# Those keep track of which header files are used by which source files
DEP := $(OBJ:.o=.d)
@@ -39,6 +42,7 @@ clean:
rm -rf $(OBJ) $(DEP) kernel
.PHONY: install clean
.INTERMEDIATE: $(basename $(filter %.py, $(SRC)))
# Include generated dependency files
include $(DEP)