sashidown: keep -Iinclude when parent make overrides CFLAGS

CI passes CFLAGS=-Werror on the command line; that wiped the library's
CFLAGS ?= ... -Iinclude -Isrc, so fsm.h could not find sashidown.h.
Always append the include paths via override CPPFLAGS.
This commit is contained in:
WHC
2026-10-07 01:52:42 +08:00
parent 9ec21b7fc0
commit 77de812207
+5 -2
View File
@@ -1,5 +1,8 @@
CC ?= gcc CC ?= gcc
CFLAGS ?= -std=c11 -Wall -Wextra -O2 -Iinclude -Isrc CFLAGS ?= -std=c11 -Wall -Wextra -O2
# Keep include paths when a parent make passes CFLAGS=... on the command
# line (CI uses -Werror that way); plain CFLAGS ?= would be overridden.
override CPPFLAGS += -Iinclude -Isrc
SRCS = src/fsm.c src/table_stats.c src/line_index.c src/block_scan.c \ SRCS = src/fsm.c src/table_stats.c src/line_index.c src/block_scan.c \
src/ansi_style.c src/render.c src/render_ansi.c src/render_json.c \ src/ansi_style.c src/render.c src/render_ansi.c src/render_json.c \
src/sashidown.c src/compat_cmark.c src/stream.c src/sashidown.c src/compat_cmark.c src/stream.c
@@ -11,6 +14,6 @@ all: $(LIB)
$(LIB): $(OBJS) $(LIB): $(OBJS)
$(AR) rcs $@ $(OBJS) $(AR) rcs $@ $(OBJS)
src/%.o: src/%.c src/%.o: src/%.c
$(CC) $(CFLAGS) -c -o $@ $< $(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $<
clean: clean:
rm -f $(OBJS) $(LIB) rm -f $(OBJS) $(LIB)