Makefile: clean up CFLAGS and LDFLAGS
Nobody has claimed this yet.
- Dominant language
- C
- Stars
- 732
- Forks
- 67
- PR merge metrics
- No merged PRs in 30d
Description
The way the Makefile treads CFLAGS and LDFLAGS is confusing.
Currently DEFAULT_CFLAGS and DEFAULT_LDFLAGS apply to both debug and release builds, but CFLAGS and LDFLAGS apply only to release builds. Also the DEFAULT_ flavor may be prepended-to via environment variables, but the non-default ones cannot.
Let's try to simplify it and make it more comprehensible.
One idea:
- remove the
DEFAULT_flavored ones CFLAGSandLDFLAGScan be initialized from the environment- the difference between debug and release builds appears only in the relevant make targets
This could also be a place to simplify the sanitizer settings, e.g. by having a single SANITIZE environment variable, e.g. SANITIZE=memory which gets rendered via make to both CFLAGS and LDFLAGS -fsanitize=memory etc.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading the repository's Makefile and trace how DEFAULT_CFLAGS, DEFAULT_LDFLAGS, CFLAGS, LDFLAGS, debug/release targets, and sanitizer settings are used. Clarify the intended environment-variable behavior and whether sanitizer simplification is included; done means the build flags are comprehensible and debug, release, and sanitizer builds still work.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c
- Domain
- build-system
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100