mirror of
https://github.com/urbit/shrub.git
synced 2024-12-20 09:21:42 +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/config.h
|
||||||
/include/ca-bundle.h
|
/include/ca-bundle.h
|
||||||
/include/ivory.h
|
/include/ivory.h
|
||||||
|
|
||||||
|
# indexing
|
||||||
|
/.cache/
|
||||||
|
compile_commands.json
|
||||||
|
tags
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
include config.mk
|
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)
|
jets = jets/tree.c $(wildcard jets/*/*.c)
|
||||||
noun = $(wildcard noun/*.c)
|
noun = $(wildcard noun/*.c)
|
||||||
@ -53,7 +54,7 @@ clean:
|
|||||||
rm -f ./tags $(all_objs) $(all_exes)
|
rm -f ./tags $(all_objs) $(all_exes)
|
||||||
|
|
||||||
mrproper: clean
|
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)
|
tags: $(all_srcs) $(headers)
|
||||||
ctags $^
|
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