From dacba3ca2e73a32ee78d9b53df98851361bcf032 Mon Sep 17 00:00:00 2001 From: Kevin Shanahan Date: Mon, 11 Feb 2013 18:47:47 +1030 Subject: [PATCH] build: make build skip the strip step if STRIP is empty Signed-off-by: Kevin Shanahan --- Makefile | 46 +++++++++++++++++++++++++--------------------- 1 file changed, 25 insertions(+), 21 deletions(-) diff --git a/Makefile b/Makefile index d34ad596..006ea0eb 100644 --- a/Makefile +++ b/Makefile @@ -50,6 +50,27 @@ endif #BIN_PFX ?= tyr- BIN_PFX ?= +# --------------------------------------- +# Define some build variables +# --------------------------------------- + +STRIP ?= strip +CFLAGS := $(CFLAGS) -Wall -Wno-trigraphs + +ifeq ($(DEBUG),Y) +CFLAGS += -g +else +ifeq ($(OPTIMIZED_CFLAGS),Y) +CFLAGS += -O2 +# -funit-at-a-time is buggy for MinGW GCC > 3.2 +# I'm assuming it's fixed for MinGW GCC >= 4.0 when that comes about +CFLAGS += $(call cc-option,-fno-unit-at-a-time,) +CFLAGS += $(call cc-option,-fweb,) +CFLAGS += $(call cc-option,-frename-registers,) +CFLAGS += $(call cc-option,-ffast-math,) +endif +endif + # ============================================================================ # Helper functions # ============================================================================ @@ -136,11 +157,15 @@ quiet_cmd_strip = ' STRIP $(1)' ifeq ($(DEBUG),Y) do_strip= else +ifeq ($(STRIP),) +do_strip = +else define do_strip @echo $(call $(quiet)cmd_strip,$(1)); @$(call cmd_strip,$(1)); endef endif +endif DEPFILES = \ $(wildcard $(BUILD_DIR)/bspinfo/.*.d) \ @@ -154,27 +179,6 @@ ifneq ($(DEPFILES),) -include $(DEPFILES) endif -# --------------------------------------- -# Define some build variables -# --------------------------------------- - -STRIP ?= strip -CFLAGS := $(CFLAGS) -Wall -Wno-trigraphs - -ifeq ($(DEBUG),Y) -CFLAGS += -g -else -ifeq ($(OPTIMIZED_CFLAGS),Y) -CFLAGS += -O2 -# -funit-at-a-time is buggy for MinGW GCC > 3.2 -# I'm assuming it's fixed for MinGW GCC >= 4.0 when that comes about -CFLAGS += $(call cc-option,-fno-unit-at-a-time,) -CFLAGS += $(call cc-option,-fweb,) -CFLAGS += $(call cc-option,-frename-registers,) -CFLAGS += $(call cc-option,-ffast-math,) -endif -endif - # -------------------------------------------------------------------------- # Build in separate directories for now to avoid problems with name/symbol # clashes, etc. Qbsp may never be merged because we use doubles instead of