From 2a47450d0557f13eb75c118204b69ca775e2d5d4 Mon Sep 17 00:00:00 2001 From: Erik de Castro Lopo Date: Thu, 12 May 2016 18:13:22 +1000 Subject: [PATCH] Makefile.lite: Pick up `CFLAGS` from the environment This allows extra CFLAGS to be set on the command line. Eg CFLAGS=Werror make -f Makefile.lite --- build/exe.mk | 8 +++----- build/lib.mk | 9 +++------ 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/build/exe.mk b/build/exe.mk index 2d16cb66..7f3bf4dd 100644 --- a/build/exe.mk +++ b/build/exe.mk @@ -47,12 +47,10 @@ PROGRAM = $(BINPATH)/$(PROGRAM_NAME) DEBUG_PROGRAM = $(DEBUG_BINPATH)/$(PROGRAM_NAME) RELEASE_PROGRAM = $(RELEASE_BINPATH)/$(PROGRAM_NAME) -debug : CFLAGS = -g -O0 -DDEBUG $(CONFIG_CFLAGS) $(DEBUG_CFLAGS) -W -Wall -DVERSION=$(VERSION) $(DEFINES) $(INCLUDES) -valgrind: CFLAGS = -g -O0 -DDEBUG $(CONFIG_CFLAGS) $(DEBUG_CFLAGS) -DFLAC__VALGRIND_TESTING -W -Wall -DVERSION=$(VERSION) $(DEFINES) $(INCLUDES) -release : CFLAGS = -O3 -fomit-frame-pointer -funroll-loops -finline-functions -DNDEBUG $(CONFIG_CFLAGS) $(RELEASE_CFLAGS) -W -Wall -Winline -DFLaC__INLINE=__inline__ -DVERSION=$(VERSION) $(DEFINES) $(INCLUDES) +debug : CFLAGS := -g -O0 -DDEBUG $(CONFIG_CFLAGS) $(DEBUG_CFLAGS) -Wall -Wextra $(CFLAGS) -DVERSION=$(VERSION) $(DEFINES) $(INCLUDES) +valgrind: CFLAGS := -g -O0 -DDEBUG $(CONFIG_CFLAGS) $(DEBUG_CFLAGS) -DFLAC__VALGRIND_TESTING -Wall -Wextra $(CFLAGS)-DVERSION=$(VERSION) $(DEFINES) $(INCLUDES) +release : CFLAGS := -O3 -fomit-frame-pointer -funroll-loops -finline-functions -DNDEBUG $(CONFIG_CFLAGS) $(RELEASE_CFLAGS) -Wall -Wextra $(CFLAGS) -DFLaC__INLINE=__inline__ -DVERSION=$(VERSION) $(DEFINES) $(INCLUDES) -CFLAGS = $(CFLAGS) -Wmissing-prototypes -Wstrict-prototypes -CXXFLAGS = $(CFLAGS) LFLAGS = -L$(LIBPATH) diff --git a/build/lib.mk b/build/lib.mk index 09191089..d46db1b9 100644 --- a/build/lib.mk +++ b/build/lib.mk @@ -66,12 +66,9 @@ else LINKD = $(CC) -shared endif -debug : CFLAGS = -g -O0 -DDEBUG $(CONFIG_CFLAGS) $(DEBUG_CFLAGS) -W -Wall -DVERSION=$(VERSION) $(DEFINES) $(INCLUDES) -valgrind: CFLAGS = -g -O0 -DDEBUG $(CONFIG_CFLAGS) $(DEBUG_CFLAGS) -DFLAC__VALGRIND_TESTING -W -Wall -DVERSION=$(VERSION) $(DEFINES) $(INCLUDES) -release : CFLAGS = -O3 -fomit-frame-pointer -funroll-loops -finline-functions -DNDEBUG $(CONFIG_CFLAGS) $(RELEASE_CFLAGS) -W -Wall -Winline -DFLaC__INLINE=__inline__ -DVERSION=$(VERSION) $(DEFINES) $(INCLUDES) - -CFLAGS = $(CFLAGS) -Wmissing-prototypes -Wstrict-prototypes -CXXFLAGS = $(CFLAGS) +debug : CFLAGS := -g -O0 -DDEBUG $(CONFIG_CFLAGS) $(DEBUG_CFLAGS) -Wall -Wextra $(CFLAGS) -DVERSION=$(VERSION) $(DEFINES) $(INCLUDES) +valgrind: CFLAGS := -g -O0 -DDEBUG $(CONFIG_CFLAGS) $(DEBUG_CFLAGS) -DFLAC__VALGRIND_TESTING -Wall -Wextra $(CFLAGS) -DVERSION=$(VERSION) $(DEFINES) $(INCLUDES) +release : CFLAGS := -O3 -fomit-frame-pointer -funroll-loops -finline-functions -DNDEBUG $(CONFIG_CFLAGS) $(RELEASE_CFLAGS) -Wall -Wextra $(CFLAGS) -DFLaC__INLINE=__inline__ -DVERSION=$(VERSION) $(DEFINES) $(INCLUDES) LFLAGS = -L$(LIBPATH)