Closed yamt closed 3 years ago
?=
is intended here and a feature, allowing to setQUIRC_MAX_REGIONS
for example (see the README).From the CFLAGS we set, I'm personally Ok with make and/or the system overriding
-Wall
and-03
. On the other hand,-fPIC
is not optional. So I could see something like this:CFLAGS ?= -O3 -Wall CFLAGS += -fPIC
you can override variables defined with =
.
@kaworu i guess i now understand what you meant. i updated the patch accordingly.
Out of curiosity, what are the default CFLAGS
defined by bmake installed by brew on your system?
-Os -pipe
.
it's from the default sys.mk. it can be disabled with bsdmake -r
.
Typically, I believe -Os -pipe
is reasonable to replace our default -O3 -Wall
. I don't know a build system that doesn't honor the environment CFLAGS or CC. The env might have some strong opinion on CFLAGS like -fstack-protector-strong
or cross compiling overriding CC as well etc.
Again, the only issue I see is about the -fPIC
which the patch doesn't address as-is.
Typically, I believe
-Os -pipe
is reasonable to replace our default-O3 -Wall
. I don't know a build system that doesn't honor the environment CFLAGS or CC. The env might have some strong opinion on CFLAGS like-fstack-protector-strong
or cross compiling overriding CC as well etc.
when you say the environment, you specifically mean the environment variables, and you are not happy with "make CFLAGS=${CFLAGS}", right?
Again, the only issue I see is about the
-fPIC
which the patch doesn't address as-is.
i want to make it use -Wall
by default too. also, i want to keep it overridable by user.
also, IMO, -fPIC should be overridable as well because it's very compiler/platform dependent.
after thinking a bit, i tend to think documentation is enough. https://github.com/dlbeer/quirc/pull/101
Some make (eg. BSD make I installed with "brew install bsdmake") have the default CFLAGS set. Using ?= here means to use the default. I guess it isn't the intention of this Makefile.
Also, update an example to override CFLAGS accordingly.