If you package tree-sitter for a distribution, the distribution is
setting the CFLAGS which should be used for all packages. Allow those
flags to be used.
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Quality of life improvements:
- automatically use `gh auth token` when running `make changelog`
- Add full links to related pull requests
- Include non-conventional commits
- Force group order by adding html comments
Production builds shouldn't include -Werror by default since that could
cause spurious build failures when there are toolchain updates.
CI uses -Werror to prevent warnings, so that should be sufficient.
This produces static/shared libraries as well as a pkg-config file, and
installs them to the standard Unix hierarchy. GNU Make is assumed as
features like $(wildcard ...) or $(shell uname) may not work elsewhere,
but it should otherwise build on most/all Unix platforms.
Note that we assume the following POSIX default rules/macros exist, so
we don't bother redefining them:
- pattern rules for compiling .c -> .o
- $(CC)
- $(AR)
Special note on the .pc file generation: we do most variable
replacements in one go, but delay @PREFIX@ so that we can first find
existing substring instances of the prefix value (if libdir/includedir
reside within the prefix), and update them to use a literal pkg-config
variable '${prefix}'. This is fairly compact (one single sed) while
still letting us produce pkg-config files that support runtime
redefinition à la cross-compilation.