-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
47 lines (39 loc) · 1.4 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
NAME = acpufreq
SERVICE_LOCATION_SYSV = /etc/init.d
SERVICE_LOCATION_SYSD = /etc/systemd/system
PREFIX = /usr/local
sysvserv:
sed "s|acpufreq|$(NAME)|; s|placeholder|$(PREFIX)|" acpufreq.is > $(NAME)
sysdserv:
sed "s|acpufreq|$(NAME)|; s|placeholder|$(PREFIX)|" acpufreq.sysd > $(NAME).service
install:
mkdir -p $(PREFIX)/sbin
cp afreq.sh $(PREFIX)/sbin/afreq
chmod 755 $(PREFIX)/sbin/afreq
echo afreq installed in $(PREFIX)/sbin
mkdir -p $(PREFIX)/bin
cp perfmod.sh $(PREFIX)/bin/perfmod
chmod 755 $(PREFIX)/bin/perfmod
echo perfmod installed in $(PREFIX)/bin
install-sysv: sysvserv
mkdir -p $(SERVICE_LOCATION_SYSV)
cp $(NAME) $(SERVICE_LOCATION_SYSV)/
chmod 755 $(SERVICE_LOCATION_SYSV)/$(NAME)
echo sysvinit service: $(NAME) installed in $(SERVICE_LOCATION_SYSV)
rm $(NAME)
install-sysd: sysdserv
mkdir -p $(SERVICE_LOCATION_SYSD)
cp $(NAME).service $(SERVICE_LOCATION_SYSD)/
echo systemd unit $(NAME).service installed in $(SERVICE_LOCATION_SYSD)
rm $(NAME).service
install-all: install install-sysv install-sysd
uninstall:
rm $(PREFIX)/sbin/afreq
echo afreq uninstalled from $(PREFIX)sbin
rm $(PREFIX)/bin/perfmod
echo perfmod uninstalled from $(PREFIX)/bin
rm -v $(SERVICE_LOCATION_SYSV)/$(NAME)
echo $(NAME) uninstalled from $(SERVICE_LOCATION_SYSV)
rm -v $(SERVICE_LOCATION_SYSD)/$(NAME).service
echo $(NAME).service uninstalled from $(SERVICE_LOCATION_SYSD)
.PHONY: install uninstall