Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
/Release
/build
/config.*
/compile_commands.json
/makeobj/makeobj
/makeobj/makeobj.exe
*sim
Expand Down
9 changes: 8 additions & 1 deletion common.mk
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ DIRS := $(sort $(dir $(OBJS)))
# Make build directories
DUMMY := $(shell mkdir -p $(DIRS))

.PHONY: all clean
.PHONY: all clean compile-commands

.SUFFIXES: .rc

Expand All @@ -30,6 +30,13 @@ clean:

-include $(DEPS)

compile-commands:
@echo "[" > compile_commands.json
@for file in $(SOURCES); do \
echo "{ \"directory\": \"$(PROGDIR)\", \"command\": \"$(HOSTCXX) $(CXXFLAGS) -c -MMD $$(pwd)/$$file\", \"file\": \"$$(pwd)/$$file\" }," >> compile_commands.json; \
done;
@echo "{ \"directory\": \"no\", \"command\": \"trailing\", \"file\": \"comma\"}]" >> compile_commands.json

# Silence stale header dependency errors
%.h:
@true
Expand Down