From ca697724df0c2ccdaacb7313eabaaf1355f4aa8b Mon Sep 17 00:00:00 2001 From: Bryce Kwon Date: Thu, 29 Oct 2026 15:43:47 -1000 Subject: Add a development build script cgit's objects are compiled by its own rule rather than git's, so they took no -MJ flag and a compilation database held only git's sources. --- source/cgit.mk | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'source') diff --git a/source/cgit.mk b/source/cgit.mk index d0c9e68..876e353 100644 --- a/source/cgit.mk +++ b/source/cgit.mk @@ -164,9 +164,12 @@ $(CGIT_BUILD)/CGIT-CFLAGS: FORCE echo "$$FLAGS" >$(CGIT_BUILD)/CGIT-CFLAGS; \ fi +# compdb_args and missing_compdb_dir are git's, and stay empty unless +# GENERATE_COMPILATION_DATABASE asks clang for a -MJ entry per object, which +# puts cgit's sources in the database beside git's. $(CGIT_OBJS): $(CGIT_BUILD)/%.o: $(CGIT_SRC)/%.c GIT-CFLAGS $(CGIT_BUILD)/CGIT-CFLAGS \ - $(missing_dep_dirs) - $(QUIET_CC)$(CC) -o $@ -c $(dep_args) $(ALL_CFLAGS) $(EXTRA_CPPFLAGS) $(CGIT_CFLAGS) $< + $(missing_dep_dirs) $(missing_compdb_dir) + $(QUIET_CC)$(CC) -o $@ -c $(dep_args) $(compdb_args) $(ALL_CFLAGS) $(EXTRA_CPPFLAGS) $(CGIT_CFLAGS) $< $(CGIT_BUILD)/cgit: $(CGIT_OBJS) GIT-LDFLAGS $(GITLIBS) @echo 1>&2 " * $(LUA_MESSAGE)" -- cgit