Improved build commands

This commit is contained in:
thomas committed 2022-01-02 20:19:53 +01:00
1 parent e0979ed357
commit 271ab8860f
8 files changed
+54 -29

No files matched your search

+6 -1
View File
@@ -1,5 +1,8 @@
ifeq ($(BUILDROOT),)
$(error BUILDROOT IS NOT SET!)
endif
CC := x86_64-elf-gcc
CC := ${TARGET}-gcc
SRC := $(wildcard **/*.[cS])
OBJ := $(patsubst %, %.o, $(basename $(SRC)))
@@ -13,6 +16,7 @@ LDFLAGS := -n -nostdlib -lgcc -T Link.ld
kernel: $(OBJ)
$(LINK.c) $^ -o $@
# Automatic dependency tracking
DEP := $(OBJ:.o=.d)
DEPFLAGS = -MT $@ -MMD -MP -MF $*.d
$(OBJ): CPPFLAGS += $(DEPFLAGS)
@@ -30,4 +34,5 @@ clean:
.PHONY: install
# Include automatic dependency rules
include $(DEP)