-
Notifications
You must be signed in to change notification settings - Fork 54
/
Makefile
111 lines (96 loc) · 4.24 KB
/
Makefile
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
# SPDX-License-Identifier: GPL-2.0
#
# Copyright (c) 2013, Intel Corporation.
#
# This program is free software; you can redistribute it and/or modify it
# under the terms and conditions of the GNU General Public License,
# version 2, as published by the Free Software Foundation.
#
# This program is distributed in the hope it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
# more details.
#
# Authors:
# Todd Brandt <[email protected]>
# Prefix to the directories we're installing to
DESTDIR ?=
# Directory definitions. These are default and most probably
# do not need to be changed. Please note that DESTDIR is
# added in front of any of them
BINDIR ?= /usr/bin
MANDIR ?= /usr/share/man
SHRDIR ?= /usr/share/pm-graph
LIBDIR ?= /usr/lib
# Toolchain: what tools do we use, and what options do they need:
INSTALL = /usr/bin/install
INSTALL_DATA = ${INSTALL} -m 644
all:
@echo "Nothing to build"
install : uninstall
$(INSTALL) -d $(DESTDIR)$(LIBDIR)/pm-graph
$(INSTALL) sleepgraph.py $(DESTDIR)$(LIBDIR)/pm-graph
$(INSTALL) bootgraph.py $(DESTDIR)$(LIBDIR)/pm-graph
$(INSTALL) tools/netfix.py $(DESTDIR)$(LIBDIR)/pm-graph
$(INSTALL) lib/argconfig.py $(DESTDIR)$(LIBDIR)/pm-graph
$(INSTALL) -d $(DESTDIR)$(LIBDIR)/pm-graph/config
$(INSTALL_DATA) config/cgskip.txt $(DESTDIR)$(LIBDIR)/pm-graph/config
$(INSTALL_DATA) config/freeze-callgraph.cfg $(DESTDIR)$(LIBDIR)/pm-graph/config
$(INSTALL_DATA) config/freeze.cfg $(DESTDIR)$(LIBDIR)/pm-graph/config
$(INSTALL_DATA) config/freeze-dev.cfg $(DESTDIR)$(LIBDIR)/pm-graph/config
$(INSTALL_DATA) config/standby-callgraph.cfg $(DESTDIR)$(LIBDIR)/pm-graph/config
$(INSTALL_DATA) config/standby.cfg $(DESTDIR)$(LIBDIR)/pm-graph/config
$(INSTALL_DATA) config/standby-dev.cfg $(DESTDIR)$(LIBDIR)/pm-graph/config
$(INSTALL_DATA) config/suspend-callgraph.cfg $(DESTDIR)$(LIBDIR)/pm-graph/config
$(INSTALL_DATA) config/suspend.cfg $(DESTDIR)$(LIBDIR)/pm-graph/config
$(INSTALL_DATA) config/suspend-dev.cfg $(DESTDIR)$(LIBDIR)/pm-graph/config
$(INSTALL_DATA) config/suspend-x2-proc.cfg $(DESTDIR)$(LIBDIR)/pm-graph/config
$(INSTALL) -d $(DESTDIR)$(SHRDIR)
$(INSTALL) -d $(DESTDIR)$(BINDIR)
ln -s ../lib/pm-graph/bootgraph.py $(DESTDIR)$(BINDIR)/bootgraph
ln -s ../lib/pm-graph/sleepgraph.py $(DESTDIR)$(BINDIR)/sleepgraph
ln -s ../lib/pm-graph/netfix.py $(DESTDIR)$(BINDIR)/netfix
$(DESTDIR)$(BINDIR)/netfix defconfig > $(DESTDIR)$(SHRDIR)/netfix.cfg
$(INSTALL) -d $(DESTDIR)$(MANDIR)/man8
$(INSTALL) bootgraph.8 $(DESTDIR)$(MANDIR)/man8
$(INSTALL) sleepgraph.8 $(DESTDIR)$(MANDIR)/man8
uninstall :
rm -f $(DESTDIR)$(MANDIR)/man8/bootgraph.8
rm -f $(DESTDIR)$(MANDIR)/man8/sleepgraph.8
rm -f $(DESTDIR)$(BINDIR)/bootgraph
rm -f $(DESTDIR)$(BINDIR)/sleepgraph
rm -f $(DESTDIR)$(BINDIR)/netfix
rm -f $(DESTDIR)$(LIBDIR)/pm-graph/config/*
if [ -d $(DESTDIR)$(LIBDIR)/pm-graph/config ] ; then \
rmdir $(DESTDIR)$(LIBDIR)/pm-graph/config; \
fi;
rm -f $(DESTDIR)$(LIBDIR)/pm-graph/__pycache__/*
if [ -d $(DESTDIR)$(LIBDIR)/pm-graph/__pycache__ ] ; then \
rmdir $(DESTDIR)$(LIBDIR)/pm-graph/__pycache__; \
fi;
rm -f $(DESTDIR)$(LIBDIR)/pm-graph/*
if [ -d $(DESTDIR)$(LIBDIR)/pm-graph ] ; then \
rmdir $(DESTDIR)$(LIBDIR)/pm-graph; \
fi;
hwcheck-install :
$(INSTALL) -d $(DESTDIR)$(LIBDIR)/pm-graph
rm -f $(DESTDIR)$(BINDIR)/hwcheck
rm -f $(DESTDIR)$(LIBDIR)/pm-graph/hwcheck.py
$(INSTALL) tools/hwcheck.py $(DESTDIR)$(LIBDIR)/pm-graph
$(INSTALL) -d $(DESTDIR)$(BINDIR)
ln -s ../lib/pm-graph/hwcheck.py $(DESTDIR)$(BINDIR)/hwcheck
$(DESTDIR)$(BINDIR)/hwcheck cronon
hwcheck-uninstall :
if [ -e $(DESTDIR)$(BINDIR)/hwcheck ] ; then \
$(DESTDIR)$(BINDIR)/hwcheck cronoff; \
fi;
rm -f $(DESTDIR)$(BINDIR)/hwcheck
rm -f $(DESTDIR)$(LIBDIR)/pm-graph/hwcheck.py
help:
@echo 'Building targets:'
@echo ' all - Nothing to build'
@echo ' install - Install the program and create necessary directories'
@echo ' uninstall - Remove installed files and directories'
@echo ' hwcheck-install - Install hwcheck utiltity and add a cronjob'
@echo ' hwcheck-uninstall - Remove hwcheck utilityand disable cronjob'
.PHONY: all install uninstall hwcheck-install hwcheck-uninstall help