GNU Linux-libre 4.14.290-gnu1
[releases.git] / tools / power / pm-graph / Makefile
1 # SPDX-License-Identifier: GPL-2.0
2 PREFIX          ?= /usr
3 DESTDIR         ?=
4
5 all:
6         @echo "Nothing to build"
7
8 install : uninstall
9         install -d  $(DESTDIR)$(PREFIX)/lib/pm-graph
10         install analyze_suspend.py $(DESTDIR)$(PREFIX)/lib/pm-graph
11         install analyze_boot.py $(DESTDIR)$(PREFIX)/lib/pm-graph
12
13         ln -s $(DESTDIR)$(PREFIX)/lib/pm-graph/analyze_boot.py $(DESTDIR)$(PREFIX)/bin/bootgraph
14         ln -s $(DESTDIR)$(PREFIX)/lib/pm-graph/analyze_suspend.py $(DESTDIR)$(PREFIX)/bin/sleepgraph
15
16         install -d  $(DESTDIR)$(PREFIX)/share/man/man8
17         install bootgraph.8 $(DESTDIR)$(PREFIX)/share/man/man8
18         install sleepgraph.8 $(DESTDIR)$(PREFIX)/share/man/man8
19
20 uninstall :
21         rm -f $(DESTDIR)$(PREFIX)/share/man/man8/bootgraph.8
22         rm -f $(DESTDIR)$(PREFIX)/share/man/man8/sleepgraph.8
23
24         rm -f $(DESTDIR)$(PREFIX)/bin/bootgraph
25         rm -f $(DESTDIR)$(PREFIX)/bin/sleepgraph
26
27         rm -f $(DESTDIR)$(PREFIX)/lib/pm-graph/analyze_boot.py
28         rm -f $(DESTDIR)$(PREFIX)/lib/pm-graph/analyze_suspend.py
29         rm -f $(DESTDIR)$(PREFIX)/lib/pm-graph/*.pyc
30         if [ -d $(DESTDIR)$(PREFIX)/lib/pm-graph ] ; then \
31                 rmdir $(DESTDIR)$(PREFIX)/lib/pm-graph; \
32         fi;