summaryrefslogtreecommitdiffstats
path: root/Makefile
blob: 8e136b786a7fa4c635aade29bd62e0a826aaf763 (plain)
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
ifeq ($(PREFIX),)
    PREFIX := /usr/local
endif

ifdef NOWEBKIT2GTK
    FEATURES := --no-default-features
endif

build:
	cargo build --release $(FEATURES)

syntect-pack:
	git submodule update --init
	find sublime-syntaxes/sources \
	    -name '*.sublime-syntax' \
	    -exec cp -- "{}" sublime-syntaxes/syntaxes/ \;
	cargo run --example build-syntect-pack

install:
	install -d "$(DESTDIR)$(PREFIX)/bin"
	install -t "$(DESTDIR)$(PREFIX)/bin" ./target/release/gnvim
	install -d "$(DESTDIR)$(PREFIX)/share/gnvim"
	cp -r ./runtime "$(DESTDIR)$(PREFIX)/share/gnvim"
	install -d "$(DESTDIR)$(PREFIX)/share/applications"
	sed -e "s|Exec=gnvim|Exec=$(PREFIX)/bin/gnvim|" \
	    "./desktop/gnvim.desktop" \
	    >"$(DESTDIR)$(PREFIX)/share/applications/gnvim.desktop"
	install -d "$(DESTDIR)$(PREFIX)/share/icons/hicolor/48x48/apps"
	install -d "$(DESTDIR)$(PREFIX)/share/icons/hicolor/128x128/apps"
	cp ./desktop/gnvim_128.png "$(DESTDIR)$(PREFIX)/share/icons/hicolor/128x128/apps/gnvim.png"
	cp ./desktop/gnvim_48.png "$(DESTDIR)$(PREFIX)/share/icons/hicolor/48x48/apps/gnvim.png"

uninstall:
	rm "$(DESTDIR)$(PREFIX)/bin/gnvim"
	rm -rf "$(DESTDIR)$(PREFIX)/share/gnvim"