forked from flobrosch/valadoc-org
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
149 lines (117 loc) · 4.73 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
VALAC_VERSION = 0.32
PREFIX = "stable"
gee-version = 0.18.0
gee-pc-version = 0.8
default: generator doclet.so update-girs configgen example-gen example-tester
datadir = $(shell dirname $(CURDIR)/$(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST)))
clean:
rm -f documentation/*/wiki/example-listing.valadoc
rm -f documentation/*/wiki/example-listing-*.valadoc
rm -f documentation/*/wiki/widget-gallery.valadoc
rm -f documentation/*/wiki/devhelp-index.valadoc
rm -f documentation/*/wiki/index.valadoc
rm -f documentation/%s/%s.valadoc.metadata
rm -R -f documentation/*/gallery-images
rm -R -f documentation/*/gir-images
rm -f examples/*-examples.valadoc
rm -f valadoc-example-tester
rm -f valadoc-example-gen
rm -f configgen
rm -f generator
rm -R -f extra-vapis
rm -R -f girs
rm -R -f tmp
rm -f *.so
rm -f LOG
example-gen:
valac -o valadoc-example-gen src/valadoc-example-parser.vala src/valadoc-example-gen.vala -X -w
example-tester:
valac -o valadoc-example-tester src/valadoc-example-parser.vala src/valadoc-example-tester.vala -X -w
doclet.so:
valac src/doclet.vala src/linkhelper.vala --pkg gee-0.8 --pkg valadoc-1.0 -C
gcc -shared -fPIC `pkg-config --cflags --libs glib-2.0 gmodule-2.0 gee-0.8 valadoc-1.0` -o libdoclet.so src/doclet.c src/linkhelper.c -w
rm -R -f src/*.c
generator: doclet.so
valac -o generator src/doclet.vala src/linkhelper.vala src/generator.vala --pkg gee-0.8 --pkg valadoc-1.0 --pkg gio-2.0 --enable-experimental -X -w
configgen:
valac -o configgen src/configgen.vala -X -D -X datadir=\"$(datadir)\" --vapidir src/ --pkg config -X -w --enable-experimental
update-girs:
if test -d girs; then \
cd girs ; \
git pull ; \
cd .. ; \
else \
git clone https://github.com/nemequ/vala-girs.git girs ; \
fi
if test -d extra-vapis; then \
cd extra-vapis ; \
git pull ; \
cd .. ; \
else \
git clone https://github.com/nemequ/vala-extra-vapis.git extra-vapis ; \
fi
#
# Example checks:
#
check-examples:
./valadoc-example-tester --keep-running --force \
examples/cairo/cairo.valadoc.examples \
examples/gio-2.0/gio-2.0.valadoc.examples \
examples/glib-2.0/glib-2.0.valadoc.examples \
examples/gmodule-2.0/gmodule-2.0.valadoc.examples \
examples/gmodule-2.0/gmodule-2.0.valadoc.examples \
examples/gobject-2.0/gobject-2.0.valadoc.examples \
examples/gstreamer-1.0/gstreamer-1.0.valadoc.examples \
examples/gstreamer-video-1.0/gstreamer-video-1.0.valadoc.examples \
examples/gtk+-3.0/gtk+-3.0.valadoc.examples \
examples/json-glib-1.0/json-glib-1.0.valadoc.examples \
examples/libnotify/libnotify.valadoc.examples \
examples/libsoup-2.4/libsoup-2.4.valadoc.examples \
examples/libxml-2.0/libxml-2.0.valadoc.examples \
examples/rest-0.7/rest-0.7.valadoc.examples \
examples/sqlite3/sqlite3.valadoc.examples
#
# Documentation generation:
#
build-docs:
rm -r -f tmp/
./generator \
--vapidir /usr/share/vala-$(VALAC_VERSION)/vapi/ \
--vapidir "extra-vapis/" --vapidir "girs/vala/vapi/" \
--driver $(VALAC_VERSION) \
--prefix $(PREFIX) \
--target-glib 2.99 \
--download-images \
--skip-existing \
--no-check-certificate \
--all
if ! test -d valadoc.org/gee-$(gee-pc-version); then \
wget https://git.gnome.org/browse/libgee/snapshot/libgee-$(gee-version).zip ; \
unzip libgee-$(gee-version).zip ; \
valadoc -o libgee-$(gee-version)/gee-$(gee-pc-version) --target-glib=2.99 --pkg gio-2.0 libgee-$(gee-version)/gee/*.vala libgee-$(gee-version)/utils/geeutils.vapi --wiki libgee-$(gee-version)/doc/ --doclet . ; \
mv libgee-$(gee-version)/gee-$(gee-pc-version)/gee-$(gee-pc-version) valadoc.org/ ; \
rm -r libgee-$(gee-version) libgee-$(gee-version).zip ; \
fi
build-docs-mini:
rm -r -f tmp/
./generator \
--vapidir /usr/share/vala-$(VALAC_VERSION)/vapi/ \
--vapidir "extra-vapis/" --vapidir "girs/vala/vapi/" \
--driver $(VALAC_VERSION) \
--prefix $(PREFIX) \
--target-glib 2.99 \
--download-images \
--skip-existing \
--no-check-certificate \
--disable-devhelp \
"glib-2.0" "gio-2.0"
test-examples:
-./valadoc-example-tester examples/*/*.valadoc.examples
rm -f -R tmp/
#
# Run a local webserver serving valadoc.org
#
serve: default build-docs
FWD_SEARCH=1 FWD_TOOLTIP=1 php -S localhost:7777 -t ./valadoc.org
serve-mini: default build-docs-mini
FWD_SEARCH=1 FWD_TOOLTIP=1 php -S localhost:7777 -t ./valadoc.org