From 804ec24df93338c85f9d4e0fc51bfe3a8f5695f1 Mon Sep 17 00:00:00 2001 From: Sylvain Munaut Date: Mon, 5 Aug 2019 15:29:00 +0200 Subject: [PATCH] build: Apply OPT_FLAGS after platform Makefile.inc include This allows the platform to specify another optimization level than the default (like -Os if space is limited) Signed-off-by: Sylvain Munaut --- src/Makefile | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/Makefile b/src/Makefile index 7213244..ec34d36 100644 --- a/src/Makefile +++ b/src/Makefile @@ -8,12 +8,9 @@ MAKEFLAGS += --no-print-dir Q := @ endif -OPT_FLAGS ?= -O2 - CFLAGS += -Wall -Wextra -Werror -Wno-char-subscripts -Wno-cast-function-type \ - $(OPT_FLAGS) -std=gnu99 -g3 -MD \ + -std=gnu99 -g3 -MD \ -I. -Iinclude -Iplatforms/common -I$(PLATFORM_DIR) -LDFLAGS += $(OPT_FLAGS) ifeq ($(ENABLE_DEBUG), 1) CFLAGS += -DENABLE_DEBUG @@ -60,6 +57,10 @@ SRC = \ include $(PLATFORM_DIR)/Makefile.inc +OPT_FLAGS ?= -O2 +CFLAGS += $(OPT_FLAGS) +LDFLAGS += $(OPT_FLAGS) + ifndef TARGET TARGET=blackmagic endif