-
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Makefile
51 lines (41 loc) · 1.92 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
.PHONY: all debug configure rtfm docsets crystal-docset gtk-docset test install uninstall
PREFIX ?= /usr
CR_FLAGS ?= -Dstrict_multi_assign -Duse_pcre2 -Dpreview_overload_order --link-flags='-Wl,--as-needed'
all: configure .WAIT rtfm docsets
debug:
shards build --debug $(CR_FLAGS) --error-trace
configure:
shards install
./bin/gi-crystal
rtfm:
shards build --release $(CR_FLAGS) rtfm
docsets: crystal-docset gtk-docset
crystal-docset:
crystal run src/doc2dash/create_crystal_docset.cr
gtk-docset:
crystal run src/doc2dash/create_gtk_docset.cr
test: crystal-docset gtk-docset
crystal spec
install:
install -D -m 0755 bin/rtfm $(DESTDIR)$(PREFIX)/bin/rtfm
install -D -m 0644 data/io.github.hugopl.rtfm.desktop $(DESTDIR)$(PREFIX)/share/applications/io.github.hugopl.rtfm.desktop
install -D -m 0644 data/icons/hicolor/scalable/apps/io.github.hugopl.rtfm.svg $(DESTDIR)$(PREFIX)/share/icons/hicolor/scalable/apps/io.github.hugopl.rtfm.svg
# Settings schema
install -D -m644 data/io.github.hugopl.rtfm.gschema.xml $(DESTDIR)$(PREFIX)/share/glib-2.0/schemas/io.github.hugopl.rtfm.gschema.xml
# docsets
mkdir -p $(DESTDIR)$(PREFIX)/share/rtfm/docsets/
cp -r data/Crystal.docset $(DESTDIR)$(PREFIX)/share/rtfm/docsets/
cp -r data/Gtk.docset $(DESTDIR)$(PREFIX)/share/rtfm/docsets/
# License
install -D -m0644 LICENSE $(DESTDIR)$(PREFIX)/share/licenses/rtfm/LICENSE
# Changelog
install -D -m0644 CHANGELOG.md $(DESTDIR)$(PREFIX)/share/doc/rtfm/CHANGELOG.md
gzip -9fn $(DESTDIR)$(PREFIX)/share/doc/rtfm/CHANGELOG.md
uninstall:
rm -f $(DESTDIR)$(PREFIX)/bin/rtfm
rm -f $(DESTDIR)$(PREFIX)/share/applications/io.github.hugopl.rtfm.desktop
rm -f $(DESTDIR)$(PREFIX)/share/icons/hicolor/scalable/apps/io.github.hugopl.rtfm.svg
rm -rf $(DESTDIR)$(PREFIX)/share/rtfm
rm -rf $(DESTDIR)$(PREFIX)/share/licenses/rtfm
rm -rf $(DESTDIR)$(PREFIX)/share/doc/rtfm
rm -f $(DESTDIR)$(PREFIX)/share/glib-2.0/schemas/io.github.hugopl.rtfm.gschema.xml