summaryrefslogtreecommitdiff
path: root/Makefile
blob: 5560fbddbcf3231dba5978bfcf7c95aa13938127 (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
36
37
38
INSTALL_PREFIX?=/usr/local

camlet.debug: meson.build *.[ch] 3rd_party/*.[ch] debug/setup
	meson compile -C debug
	ln -sf debug/camlet camlet.debug
	cp debug/compile_commands.json .
camlet_icon.c: camlet.bmp
	xxd -i camlet.bmp > $@
debug/setup:
	rm -rf debug
	meson setup debug
	touch debug/setup
release: release/camlet
release/camlet: meson.build *.[ch] 3rd_party/*.[ch] release/setup2
	meson compile -C release
release/setup2:
	rm -rf release
	meson setup --buildtype=release release
	touch release/setup2
camlet.deb: release control.sh
	rm -rf tmp
	mkdir -p tmp/camlet/usr/bin tmp/camlet/DEBIAN tmp/camlet/usr/share/applications tmp/camlet/usr/share/icons/hicolor/48x48/apps
	cp release/camlet tmp/camlet/usr/bin/
	cp camlet.desktop tmp/camlet/usr/share/applications/
	cp camlet.png tmp/camlet/usr/share/icons/hicolor/48x48/apps
	sh control.sh > tmp/camlet/DEBIAN/control
	dpkg-deb --build tmp/camlet
	mv tmp/camlet.deb .
	rm -rf tmp
install: release
	@[ -w $(INSTALL_PREFIX) ] || { echo "You need permission to write to $(INSTALL_PREFIX). Try running with sudo/as root." && exit 1; }
	mkdir -p $(INSTALL_PREFIX)/bin $(INSTALL_PREFIX)/share/applications $(INSTALL_PREFIX)/share/icons/hicolor/48x48/apps
	install -m 755 release/camlet $(INSTALL_PREFIX)/bin
	install -m 644 camlet.desktop $(INSTALL_PREFIX)/share/applications
	install -m 644 camlet.png $(INSTALL_PREFIX)/share/icons/hicolor/48x48/apps
uninstall:
	@[ -w $(INSTALL_PREFIX) ] || { echo "You need permission to write to $(INSTALL_PREFIX). Try running with sudo/as root." && exit 1; }
	rm -f $(INSTALL_PREFIX)/bin/camlet $(INSTALL_PREFIX)/share/applications/camlet.desktop $(INSTALL_PREFIX)/share/icons/hicolor/48x48/apps/camlet.png