diff options
author | Damien George <damien.p.george@gmail.com> | 2020-01-24 11:51:21 +1100 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2020-01-24 11:51:21 +1100 |
commit | 96716b46e1c4945d3fe08d9ba91920ca28f9c986 (patch) | |
tree | 9943d77ea21047904a256a3da9c74257a059d086 | |
parent | cb4472df42e6f34df2fe57f4f85786f6669171f7 (diff) | |
download | micropython-96716b46e1c4945d3fe08d9ba91920ca28f9c986.tar.gz micropython-96716b46e1c4945d3fe08d9ba91920ca28f9c986.zip |
unix/Makefile: Reserve CFLAGS_EXTRA/LDFLAGS_EXTRA for external use.
When CFLAGS_EXTRA/LDFLAGS_EXTRA (or anything) is set on the command line of
a make invocation then it will completely override any setting or appending
of these variables in the makefile(s). This means builds like the coverage
variant will have their mpconfigvariant.mk settings overridden. Fix this
by using CFLAGS/LDFLAGS exclusively in the makefile(s), reserving the
CFLAGS_EXTRA/LDFLAGS_EXTRA variables for external command-line use only.
-rw-r--r-- | ports/unix/Makefile | 4 | ||||
-rw-r--r-- | ports/unix/variants/coverage/mpconfigvariant.mk | 4 | ||||
-rw-r--r-- | ports/unix/variants/freedos/mpconfigvariant.mk | 2 |
3 files changed, 5 insertions, 5 deletions
diff --git a/ports/unix/Makefile b/ports/unix/Makefile index 567b1d5c22..23ea6d1fe5 100644 --- a/ports/unix/Makefile +++ b/ports/unix/Makefile @@ -40,7 +40,7 @@ INC += -I$(BUILD) # compiler settings CWARN = -Wall -Werror CWARN += -Wpointer-arith -Wuninitialized -CFLAGS = $(INC) $(CWARN) -std=gnu99 -DUNIX $(CFLAGS_MOD) $(COPT) -I$(VARIANT_DIR) $(CFLAGS_EXTRA) +CFLAGS += $(INC) $(CWARN) -std=gnu99 -DUNIX $(CFLAGS_MOD) $(COPT) -I$(VARIANT_DIR) $(CFLAGS_EXTRA) # Debugging/Optimization ifdef DEBUG @@ -91,7 +91,7 @@ else # Use gcc syntax for map file LDFLAGS_ARCH = -Wl,-Map=$@.map,--cref -Wl,--gc-sections endif -LDFLAGS = $(LDFLAGS_MOD) $(LDFLAGS_ARCH) -lm $(LDFLAGS_EXTRA) +LDFLAGS += $(LDFLAGS_MOD) $(LDFLAGS_ARCH) -lm $(LDFLAGS_EXTRA) # Flags to link with pthread library LIBPTHREAD = -lpthread diff --git a/ports/unix/variants/coverage/mpconfigvariant.mk b/ports/unix/variants/coverage/mpconfigvariant.mk index 077e7e11ac..056a5fd3f1 100644 --- a/ports/unix/variants/coverage/mpconfigvariant.mk +++ b/ports/unix/variants/coverage/mpconfigvariant.mk @@ -2,13 +2,13 @@ PROG ?= micropython-coverage COPT = -O0 -CFLAGS_EXTRA += \ +CFLAGS += \ -fprofile-arcs -ftest-coverage \ -Wdouble-promotion -Wformat -Wmissing-declarations -Wmissing-prototypes -Wsign-compare \ -Wold-style-definition -Wpointer-arith -Wshadow -Wuninitialized -Wunused-parameter \ -DMICROPY_UNIX_COVERAGE -LDFLAGS_EXTRA += -fprofile-arcs -ftest-coverage +LDFLAGS += -fprofile-arcs -ftest-coverage FROZEN_MANIFEST = manifest_coverage.py diff --git a/ports/unix/variants/freedos/mpconfigvariant.mk b/ports/unix/variants/freedos/mpconfigvariant.mk index f7e5ed5162..a30db3e0c1 100644 --- a/ports/unix/variants/freedos/mpconfigvariant.mk +++ b/ports/unix/variants/freedos/mpconfigvariant.mk @@ -4,7 +4,7 @@ STRIP = i586-pc-msdosdjgpp-strip SIZE = i586-pc-msdosdjgpp-size -CFLAGS_EXTRA = \ +CFLAGS += \ -DMICROPY_NLR_SETJMP \ -Dtgamma=gamma \ -DMICROPY_EMIT_X86=0 \ |