The $(cc-option) macro was being executed multiple times for each compiler invocation. That's a waste of time.
Signed-off-by: Kevin O'Connor kevin@koconnor.net --- Makefile | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/Makefile b/Makefile index 8e32670..fa30bb3 100644 --- a/Makefile +++ b/Makefile @@ -25,7 +25,7 @@ SRC32SEG=util.c output.c pci.c pcibios.c apm.c stacks.c cc-option=$(shell if test -z "`$(1) $(2) -S -o /dev/null -xc /dev/null 2>&1`" \ ; then echo "$(2)"; else echo "$(3)"; fi ;)
-COMMONCFLAGS = -I$(OUT) -Os -MD -g \ +COMMONCFLAGS := -I$(OUT) -Os -MD -g \ -Wall -Wno-strict-aliasing -Wold-style-definition \ $(call cc-option,$(CC),-Wtype-limits,) \ -m32 -march=i386 -mregparm=3 -mpreferred-stack-boundary=2 \ @@ -36,14 +36,14 @@ COMMONCFLAGS += $(call cc-option,$(CC),-nopie,) COMMONCFLAGS += $(call cc-option,$(CC),-fno-stack-protector,) COMMONCFLAGS += $(call cc-option,$(CC),-fno-stack-protector-all,)
-CFLAGS32FLAT = $(COMMONCFLAGS) -DMODE16=0 -DMODESEGMENT=0 -fomit-frame-pointer -CFLAGSSEG = $(COMMONCFLAGS) -DMODESEGMENT=1 -fno-defer-pop \ +CFLAGS32FLAT := $(COMMONCFLAGS) -DMODE16=0 -DMODESEGMENT=0 -fomit-frame-pointer +CFLAGSSEG := $(COMMONCFLAGS) -DMODESEGMENT=1 -fno-defer-pop \ $(call cc-option,$(CC),-fno-jump-tables,-DMANUAL_NO_JUMP_TABLE) \ $(call cc-option,$(CC),-fno-tree-switch-conversion,) -CFLAGS32SEG = $(CFLAGSSEG) -DMODE16=0 -fomit-frame-pointer -CFLAGS16INC = $(CFLAGSSEG) -DMODE16=1 -Wa,src/code16gcc.s \ +CFLAGS32SEG := $(CFLAGSSEG) -DMODE16=0 -fomit-frame-pointer +CFLAGS16INC := $(CFLAGSSEG) -DMODE16=1 -Wa,src/code16gcc.s \ $(call cc-option,$(CC),--param large-stack-frame=4,-fno-inline) -CFLAGS16 = $(CFLAGS16INC) -fomit-frame-pointer +CFLAGS16 := $(CFLAGS16INC) -fomit-frame-pointer
# Run with "make V=1" to see the actual compile commands ifdef V