From f944f887470713b737cfe0bd704fd4c97318754b Mon Sep 17 00:00:00 2001 From: aqua Date: Tue, 1 Nov 2022 15:20:17 +0200 Subject: makefile: add Makefile.config --- i686/Makefile | 2 +- i686/toolchain.mk | 20 ++++++++++++-------- 2 files changed, 13 insertions(+), 9 deletions(-) (limited to 'i686') diff --git a/i686/Makefile b/i686/Makefile index 04257dc..431db77 100644 --- a/i686/Makefile +++ b/i686/Makefile @@ -1,4 +1,4 @@ -include ../${ARCH}/toolchain.mk +include ../Makefile.config CCFLAGS += -I../grub/include -I../lib diff --git a/i686/toolchain.mk b/i686/toolchain.mk index 7bef9bc..1c0d922 100644 --- a/i686/toolchain.mk +++ b/i686/toolchain.mk @@ -1,12 +1,16 @@ +ARCH=i686 + # define compiler, linker, archiver and strip and their flags # -AS = i686-elf-as -CC = i686-elf-gcc -CCFLAGS = -Wall -Wextra -Wpedantic -fanalyzer -ffreestanding -std=gnu11 -mgeneral-regs-only -LD = i686-elf-ld -LDFLAGS = -static -nostdlib -AR = i686-elf-ar -ARFLAGS = -crus -STRIP = i686-elf-strip +AS := i686-elf-as +CC := i686-elf-gcc +CCFLAGS := -Wall -Wextra -Wpedantic -fanalyzer -ffreestanding -std=gnu11 -mgeneral-regs-only +CCFLAGS += $(shell echo ${CONFIG_CCFLAGS}) +LD := i686-elf-ld +LDFLAGS := -static -nostdlib +LDFLAGS += $(shell echo ${CONFIG_LDFLAGS}) +AR := i686-elf-ar +ARFLAGS := -crus +STRIP := i686-elf-strip -- cgit v1.2.1