File tree Expand file tree Collapse file tree 13 files changed +18
-235
lines changed Expand file tree Collapse file tree 13 files changed +18
-235
lines changed Original file line number Diff line number Diff line change @@ -6,3 +6,4 @@ Ex-0.1.typelib
66Ex-0.1.vapi
77test-c
88test-vala
9+ /include /
Original file line number Diff line number Diff line change 1+ [submodule "cbindgen "]
2+ path = cbindgen
3+ url = https://github.com/elmarco/cbindgen.git
4+ branch = gbindgen
Original file line number Diff line number Diff line change 1- HEADERS = \
2- include/ex/ex.h \
3- include/ex/error.h \
4- include/ex/flags.h \
5- include/ex/color.h \
6- include/ex/foo.h \
7- include/ex/bar.h \
8- include/ex/nameable.h \
9- include/ex/rstring.h \
10- include/ex/shared-rstring.h \
1+ HEADER = include/ex/ex.h
112
123RUST_SOURCES = \
134 src/lib.rs \
@@ -45,14 +36,22 @@ export LD_LIBRARY_PATH=$(PWD)/target/debug
4536target/debug/libgobject_example.so : $(RUST_SOURCES )
4637 cargo build
4738
48- Ex-0.1.gir : target/debug/libgobject_example.so $(HEADERS )
39+ GBINDGEN = cbindgen/target/debug/gbindgen
40+
41+ $(GBINDGEN ) :
42+ cargo build --all-features --manifest-path=cbindgen/Cargo.toml
43+
44+ $(HEADER ) : $(GBINDGEN ) $(RUST_SOURCES )
45+ $(GBINDGEN ) -o $(HEADER )
46+
47+ Ex-0.1.gir : target/debug/libgobject_example.so $(HEADER )
4948 g-ir-scanner -v --warn-all \
5049 --namespace Ex --nsversion=0.1 \
5150 -Iinclude --c-include " ex/ex.h" \
5251 --library=gobject_example --library-path=target/debug \
5352 --include=GObject-2.0 -pkg gobject-2.0 \
5453 --output $@ \
55- $(HEADERS )
54+ $(HEADER )
5655
5756Ex-0.1.typelib : Ex-0.1.gir
5857 g-ir-compiler \
@@ -86,7 +85,7 @@ test-vala: test.vala Ex-0.1.vapi
8685run-vala : test-vala
8786 ./test-vala
8887
89- test-c : test.c target/debug/libgobject_example.so Ex-0.1.pc $(HEADERS )
88+ test-c : test.c target/debug/libgobject_example.so Ex-0.1.pc $(HEADER )
9089 $(CC ) -Wall $< ` pkg-config --cflags --libs Ex-0.1` -o $@
9190
9291run-c : test-c
Load Diff This file was deleted.
Load Diff This file was deleted.
Load Diff This file was deleted.
Load Diff This file was deleted.
Load Diff This file was deleted.
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments