Skip to content

Commit 1c3b478

Browse files
committed
Generate compile_commands.json
1 parent 4c8892f commit 1c3b478

3 files changed

Lines changed: 15 additions & 9 deletions

File tree

.gitignore

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,2 @@
1-
.*.swp
2-
.merlin
3-
*.install
41
_build
2+
lib/compile_commands\.json

Makefile

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
.PHONY: all clean doc
22

33
all:
4-
dune build @install
4+
@dune build @install
5+
@make -C lib compile_commands.json
56

67
clean:
7-
dune clean
8+
@dune clean
9+
@make -C lib clean-compile-commands
810

911
doc:
10-
dune build @doc
12+
@dune build @doc

lib/Makefile

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,15 @@
11
TARGETS = sqlite3.cma libsqlite3_stubs.a
22

3-
.PHONY: all clean
3+
.PHONY: all clean clean-compile-commands
44

5-
all:
5+
all: compile_commands.json
66
@dune build $(TARGETS)
77

8-
clean:
8+
clean: clean-compile-commands
99
@dune clean
10+
11+
compile_commands.json: config/dune config/discover.ml sqlite3_stubs.c
12+
@dune rules | dune-compiledb
13+
14+
clean-compile-commands:
15+
@rm -f compile_commands.json

0 commit comments

Comments
 (0)