xref: /linux/tools/power/pm-graph/Makefile (revision a4eb44a6435d6d8f9e642407a4a06f65eb90ca04)
1# SPDX-License-Identifier: GPL-2.0
2PREFIX		?= /usr
3DESTDIR		?=
4
5all:
6	@echo "Nothing to build"
7
8install : uninstall
9	install -d  $(DESTDIR)$(PREFIX)/lib/pm-graph
10	install sleepgraph.py $(DESTDIR)$(PREFIX)/lib/pm-graph
11	install bootgraph.py $(DESTDIR)$(PREFIX)/lib/pm-graph
12	install -d  $(DESTDIR)$(PREFIX)/lib/pm-graph/config
13	install -m 644 config/cgskip.txt $(DESTDIR)$(PREFIX)/lib/pm-graph/config
14	install -m 644 config/freeze-callgraph.cfg $(DESTDIR)$(PREFIX)/lib/pm-graph/config
15	install -m 644 config/freeze.cfg $(DESTDIR)$(PREFIX)/lib/pm-graph/config
16	install -m 644 config/freeze-dev.cfg $(DESTDIR)$(PREFIX)/lib/pm-graph/config
17	install -m 644 config/standby-callgraph.cfg $(DESTDIR)$(PREFIX)/lib/pm-graph/config
18	install -m 644 config/standby.cfg $(DESTDIR)$(PREFIX)/lib/pm-graph/config
19	install -m 644 config/standby-dev.cfg $(DESTDIR)$(PREFIX)/lib/pm-graph/config
20	install -m 644 config/suspend-callgraph.cfg $(DESTDIR)$(PREFIX)/lib/pm-graph/config
21	install -m 644 config/suspend.cfg $(DESTDIR)$(PREFIX)/lib/pm-graph/config
22	install -m 644 config/suspend-dev.cfg $(DESTDIR)$(PREFIX)/lib/pm-graph/config
23	install -m 644 config/suspend-x2-proc.cfg $(DESTDIR)$(PREFIX)/lib/pm-graph/config
24
25	install -d  $(DESTDIR)$(PREFIX)/bin
26	ln -s ../lib/pm-graph/bootgraph.py $(DESTDIR)$(PREFIX)/bin/bootgraph
27	ln -s ../lib/pm-graph/sleepgraph.py $(DESTDIR)$(PREFIX)/bin/sleepgraph
28
29	install -d  $(DESTDIR)$(PREFIX)/share/man/man8
30	install bootgraph.8 $(DESTDIR)$(PREFIX)/share/man/man8
31	install sleepgraph.8 $(DESTDIR)$(PREFIX)/share/man/man8
32
33uninstall :
34	rm -f $(DESTDIR)$(PREFIX)/share/man/man8/bootgraph.8
35	rm -f $(DESTDIR)$(PREFIX)/share/man/man8/sleepgraph.8
36
37	rm -f $(DESTDIR)$(PREFIX)/bin/bootgraph
38	rm -f $(DESTDIR)$(PREFIX)/bin/sleepgraph
39
40	rm -f $(DESTDIR)$(PREFIX)/lib/pm-graph/config/*
41	if [ -d $(DESTDIR)$(PREFIX)/lib/pm-graph/config ] ; then \
42		rmdir $(DESTDIR)$(PREFIX)/lib/pm-graph/config; \
43	fi;
44	rm -f $(DESTDIR)$(PREFIX)/lib/pm-graph/__pycache__/*
45	if [ -d $(DESTDIR)$(PREFIX)/lib/pm-graph/__pycache__ ] ; then \
46		rmdir $(DESTDIR)$(PREFIX)/lib/pm-graph/__pycache__; \
47	fi;
48	rm -f $(DESTDIR)$(PREFIX)/lib/pm-graph/*
49	if [ -d $(DESTDIR)$(PREFIX)/lib/pm-graph ] ; then \
50		rmdir $(DESTDIR)$(PREFIX)/lib/pm-graph; \
51	fi;
52