mirror of
https://github.com/linux-msm/qdl.git
synced 2026-02-25 13:12:25 -08:00
Makefile: Generate compile_commands.json
Introduce a make target for generating compile_commands.json to feed clangd and the Language Server Protocol, to gain better editor integration. Add the relevant files to .gitignore. Signed-off-by: Bjorn Andersson <quic_bjorande@quicinc.com>
This commit is contained in:
committed by
Konrad Dybcio
parent
7cc077d066
commit
a10d2bf57b
2
.gitignore
vendored
2
.gitignore
vendored
@@ -1,3 +1,5 @@
|
||||
*.o
|
||||
qdl
|
||||
ks
|
||||
compile_commands.json
|
||||
.cache
|
||||
|
||||
4
Makefile
4
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
|
||||
|
||||
Reference in New Issue
Block a user