Improved build commands
This commit is contained in:
@@ -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)
|
||||
Reference in New Issue
Block a user