File tree 13 files changed +18
-235
lines changed
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
6
6
Ex-0.1.vapi
7
7
test-c
8
8
test-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
11
2
12
3
RUST_SOURCES = \
13
4
src/lib.rs \
@@ -45,14 +36,22 @@ export LD_LIBRARY_PATH=$(PWD)/target/debug
45
36
target/debug/libgobject_example.so : $(RUST_SOURCES )
46
37
cargo build
47
38
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 )
49
48
g-ir-scanner -v --warn-all \
50
49
--namespace Ex --nsversion=0.1 \
51
50
-Iinclude --c-include " ex/ex.h" \
52
51
--library=gobject_example --library-path=target/debug \
53
52
--include=GObject-2.0 -pkg gobject-2.0 \
54
53
--output $@ \
55
- $(HEADERS )
54
+ $(HEADER )
56
55
57
56
Ex-0.1.typelib : Ex-0.1.gir
58
57
g-ir-compiler \
@@ -86,7 +85,7 @@ test-vala: test.vala Ex-0.1.vapi
86
85
run-vala : test-vala
87
86
./test-vala
88
87
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 )
90
89
$(CC ) -Wall $< ` pkg-config --cflags --libs Ex-0.1` -o $@
91
90
92
91
run-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.
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