aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuis Machado <luis.machado@linaro.org>2019-01-11 15:52:52 -0200
committerLisa Nguyen <lisa.nguyen@linaro.org>2019-01-13 15:06:45 -0800
commitddc01f0a1d52bd4af48fc8729ea778f68cc3999a (patch)
tree4a43cf4d4e9261a32ffe5491a8fec50c6d3c27fc
parent52f67262f603a935d063d4c8f6aa35a6e8836d5a (diff)
Adjust compiler flag variables
In order to pass additional compiler flags while still keeping the required flags intact (-pthread for example), we add a local set of flags on top of the exsiting CFLAGS. 2019-01-11 Luis Machado <luis.machado@linaro.org> * Test.mk (CFLAGS): Set to "-g -Wall" (FLAGS): New variable. Set to -pthread. Document variables. ($(EXEC): Use FLAGS. Signed-off-by: Luis Machado <luis.machado@linaro.org>
-rw-r--r--Test.mk11
1 files changed, 9 insertions, 2 deletions
diff --git a/Test.mk b/Test.mk
index 3c12a9e..86e59ab 100644
--- a/Test.mk
+++ b/Test.mk
@@ -24,7 +24,14 @@
SNT=$(wildcard *sanity.sh)
TST=$(sort $(wildcard *[!{sanity}].sh))
LOG=$(TST:.sh=.log)
-CFLAGS?=-g -Wall -pthread
+
+# Default flags passed to the compiler.
+CFLAGS?=-g -Wall
+
+# Required compiler flags to build the utils.
+FLAGS?=-pthread
+
+# Default compiler to build the utils.
CC?=gcc
# All utils' source files.
@@ -58,7 +65,7 @@ endif
# Target for building all the utils we need, from sources.
$(EXEC): $(SRC)
- $(CC) $(CFLAGS) $@.c -o $@
+ $(CC) $(CFLAGS) $(FLAGS) $@.c -o $@
clean:
rm -f *.o $(EXEC)