Update Makefile

This commit is contained in:
mintsuki 2022-05-26 08:12:46 +02:00
parent c2376b388f
commit c522b3f832

View file

@ -17,12 +17,8 @@ endef
# the host system's toolchain, but this is not guaranteed. # the host system's toolchain, but this is not guaranteed.
$(eval $(call DEFAULT_VAR,CC,cc)) $(eval $(call DEFAULT_VAR,CC,cc))
# Likewise, "ld" here is just a placeholder and your mileage may vary if using the
# host's "ld".
$(eval $(call DEFAULT_VAR,LD,ld))
# User controllable CFLAGS. # User controllable CFLAGS.
CFLAGS ?= -O2 -g -Wall -Wextra -pipe CFLAGS ?= -O2 -g -Wall -Wextra -Wpedantic -pipe
# User controllable linker flags. We set none by default. # User controllable linker flags. We set none by default.
LDFLAGS ?= LDFLAGS ?=
@ -48,10 +44,10 @@ override INTERNALCFLAGS := \
# Internal linker flags that should not be changed by the user. # Internal linker flags that should not be changed by the user.
override INTERNALLDFLAGS := \ override INTERNALLDFLAGS := \
-Tlinker.ld \
-nostdlib \ -nostdlib \
-zmax-page-size=0x1000 \ -static \
-static -Wl,-z,max-page-size=0x1000 \
-Wl,-T,linker.ld
# Use find to glob all *.c files in the directory and extract the object names. # Use find to glob all *.c files in the directory and extract the object names.
override CFILES := $(shell find ./ -type f -name '*.c') override CFILES := $(shell find ./ -type f -name '*.c')
@ -67,7 +63,7 @@ limine.h:
# Link rules for the final kernel executable. # Link rules for the final kernel executable.
$(KERNEL): $(OBJ) $(KERNEL): $(OBJ)
$(LD) $(OBJ) $(LDFLAGS) $(INTERNALLDFLAGS) -o $@ $(CC) $(OBJ) $(LDFLAGS) $(INTERNALLDFLAGS) -o $@
# Compilation rules for *.c files. # Compilation rules for *.c files.
-include $(HEADER_DEPS) -include $(HEADER_DEPS)