mirror of
https://github.com/urbit/shrub.git
synced 2024-12-24 03:14:30 +03:00
Merge pull request #5880 from midlyx-hatrys/compdb
vere: build: add ability to create compdb (for Clangd etc.)
This commit is contained in:
commit
f9e4822026
5
pkg/urbit/.gitignore
vendored
5
pkg/urbit/.gitignore
vendored
@ -3,3 +3,8 @@
|
||||
/include/config.h
|
||||
/include/ca-bundle.h
|
||||
/include/ivory.h
|
||||
|
||||
# indexing
|
||||
/.cache/
|
||||
compile_commands.json
|
||||
tags
|
||||
|
@ -1,5 +1,6 @@
|
||||
include config.mk
|
||||
include $(foreach dir,$(compat),$(wildcard compat/$(dir)/*.mk))
|
||||
compat_mks := $(foreach dir,$(compat),$(wildcard compat/$(dir)/*.mk))
|
||||
include $(compat_mks)
|
||||
|
||||
jets = jets/tree.c $(wildcard jets/*/*.c)
|
||||
noun = $(wildcard noun/*.c)
|
||||
@ -53,7 +54,7 @@ clean:
|
||||
rm -f ./tags $(all_objs) $(all_exes)
|
||||
|
||||
mrproper: clean
|
||||
rm -f config.mk include/config.h
|
||||
rm -f config.mk include/config.h compile_commands.json
|
||||
|
||||
################################################################################
|
||||
|
||||
@ -80,3 +81,15 @@ build/urbit: $(common_objs) $(daemon_objs) $(worker_objs)
|
||||
|
||||
tags: $(all_srcs) $(headers)
|
||||
ctags $^
|
||||
|
||||
compile_commands.json: Makefile config.mk $(compat_mks)
|
||||
@echo "[" > $@ && sep= && \
|
||||
for src in $(all_srcs); do \
|
||||
echo "$$sep{" >> $@; \
|
||||
printf '"directory": "%s",\n' $$(pwd) >> $@; \
|
||||
printf '"command": "%s",\n' "$(CC) -I./include $(CFLAGS) $$src $(CCEXTRA) -c" >> $@; \
|
||||
printf '"file": "%s",\n' $$src >> $@; \
|
||||
echo "}" >> $@; \
|
||||
sep=','; \
|
||||
done && \
|
||||
echo "]" >> $@
|
||||
|
Loading…
Reference in New Issue
Block a user