aboutsummaryrefslogtreecommitdiff
path: root/makefile
blob: dabe5d216914893ecb56ab37771618aed660b7df (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
ifeq ($(PREFIX),)
	PREFIX := /usr/local
endif

build:
	cc -Isrc/include `pkg-config --cflags gtk+-3.0` src/*.c src/ss/*.c -o zenmonitor `pkg-config --libs gtk+-3.0` -lm -no-pie -Wall

install:
	mkdir -p $(DESTDIR)$(PREFIX)/bin
	install -m 755 zenmonitor $(DESTDIR)$(PREFIX)/bin

	mkdir -p $(DESTDIR)$(PREFIX)/share/applications
	sed -e "s|@APP_EXEC@|${DESTDIR}${PREFIX}/bin/zenmonitor|" \
			data/zenmonitor.desktop.in > \
			$(DESTDIR)$(PREFIX)/share/applications/zenmonitor.desktop

install-polkit:
	sed -e "s|@APP_EXEC@|${DESTDIR}${PREFIX}/bin/zenmonitor|" \
			data/zenmonitor-root.desktop.in > \
			$(DESTDIR)$(PREFIX)/share/applications/zenmonitor-root.desktop

	sed -e "s|@APP_EXEC@|${DESTDIR}${PREFIX}/bin/zenmonitor|" \
			data/org.pkexec.zenmonitor.policy.in > \
			$(DESTDIR)/usr/share/polkit-1/actions/org.pkexec.zenmonitor.policy

uninstall:
	rm -f $(DESTDIR)$(PREFIX)/bin/zenmonitor
	rm -f $(DESTDIR)$(PREFIX)/share/applications/zenmonitor.desktop
	rm -f $(DESTDIR)$(PREFIX)/share/applications/zenmonitor-root.desktop
	rm -f $(DESTDIR)/usr/share/polkit-1/actions/org.pkexec.zenmonitor.policy

clean:
	rm -f zenmonitor