diff --git a/.gitignore b/.gitignore index f12beef..0faf217 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ *.o qdl ks +compile_commands.json +.cache diff --git a/Makefile b/Makefile index e0dec0d..6b035ad 100644 --- a/Makefile +++ b/Makefile @@ -19,9 +19,13 @@ $(OUT): $(OBJS) $(KS_OUT): $(KS_OBJS) $(CC) -o $@ $^ $(LDFLAGS) +compile_commands.json: $(SRCS) $(KS_SRCS) + @echo -n $^ | jq -snR "[inputs|split(\" \")[]|{directory:\"$(PWD)\", command: \"$(CC) $(CFLAGS) -c \(.)\", file:.}]" > $@ + clean: rm -f $(OUT) $(OBJS) rm -f $(KS_OUT) $(KS_OBJS) + rm -f compile_commands.json install: $(OUT) $(KS_OUT) install -d $(DESTDIR)$(prefix)/bin