build(lib): allow overriding CFLAGS on the commandline

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>
This commit is contained in:
Andreas Schneider 2024-03-12 06:50:56 +01:00 committed by GitHub
parent 2e596e379e
commit d4862ff9f7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -19,7 +19,7 @@ OBJ := $(SRC:.c=.o)
# define default flags, and override to append mandatory flags
ARFLAGS := rcs
CFLAGS := -O3 -Wall -Wextra -Wshadow -pedantic
CFLAGS ?= -O3 -Wall -Wextra -Wshadow -pedantic
override CFLAGS += -std=c11 -fPIC -fvisibility=hidden
override CFLAGS += -Ilib/src -Ilib/src/wasm -Ilib/include