-
Notifications
You must be signed in to change notification settings - Fork 401
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Makefile enhancement #388
Comments
With |
Agreed that there is no need for But having an |
Yes, one can override CFLAGS with command-line arguments, but with = instead of ?=, make will not respect CFLAGS in the environment (or in m[ak]e.conf on some systems), which is how many package building systems provide them. Hence, I always set non-essential flags with ?= so they are only default values that the user or package manager can override, and append project-specific essential flags with +=. I'm not sure what the issue is with ?= anyway. For me, CFLAGS+=-Wextra has the same effect with or without the patch I provided: Original Makefile:
Patched Makefile:
|
Yes, that's why I said |
Sorry, hadn't had my morning tea yet and forgot to address the -e comment. To answer your question, because -e is also a command-line argument, which would have to be explicitly inserted into each package building framework, whereas ?= achieves the same goal without any additional flags. There's a strong tradition among package developers to make the build system as clean as possible, largely by pushing patches upstream to eliminate unnecessary cruft in the next release. When you're part of a team maintaining 30,000+ packages, every little bit helps. Can you provide an example where ?= causes a problem that's avoided by using make -e? |
The commands and their flags invoked by a Makefile are clear and predictable, because they are written down right there in the Makefile. If I want my repeatable build commands to be influenced by external sources like environment variables, I will explicitly ask for that via (I'm not interested in you trying to change my mind on this, thanks. I understand your argument.) |
I understand what you're saying. That's why only non-essential flags like "-g -Wall -O2" should be set with ?= and all essential arguments added with +=. This gives the caller control over local preferences without risk of breaking the build. |
The Makefile patch below adds an install target and allows the caller to control compiler flags.
This will make it easier to add minimap2 to various package managers.
If you prefer a pull request, I can do that too.
Regards,
Jason
The text was updated successfully, but these errors were encountered: