Diff options
Diffstat (limited to 'source')
-rw-r--r--source/cgit.mk7
1 file changed, 5 insertions, 2 deletions
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)"