-
Notifications
You must be signed in to change notification settings - Fork 67
/
Makefile.in
102 lines (84 loc) · 2.12 KB
/
Makefile.in
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
CC = gcc
CFLAGS =
EXTRA_CFLAGS = -Wall -Wextra
DESTDIR =
ENABLE_SYSTEMD =
ENABLE_ELOGIND =
ENABLE_OPENRC =
BINDIR =
SYSCONFDIR =
RUNSTATEDIR =
UNITDIR =
ELOGINDDIR =
TARGETS = intel-undervolt
ifeq ($(ENABLE_SYSTEMD), 1)
TARGETS += intel-undervolt.service intel-undervolt-loop.service
endif
ifeq ($(ENABLE_OPENRC), 1)
TARGETS += intel-undervolt-loop.openrc
endif
all: $(TARGETS)
ifeq ($(ENABLE_SYSTEMD), 1)
intel-undervolt.service: intel-undervolt.service.in
sed -e "s,%BINDIR%,$(BINDIR)," $< > $@
intel-undervolt-loop.service: intel-undervolt-loop.service.in
sed -e "s,%BINDIR%,$(BINDIR)," $< > $@
endif
ifeq ($(ENABLE_OPENRC), 1)
intel-undervolt-loop.openrc: intel-undervolt-loop.openrc.in
sed -e "s,%BINDIR%,$(BINDIR)," \
-e "s,%SYSCONFDIR%,$(SYSCONFDIR)," \
-e "s,%RUNSTATEDIR%,$(RUNSTATEDIR)," $< > $@
endif
intel_undervolt_headers = \
config.h \
measure.h \
modes.h \
power.h \
scaling.h \
stat.h \
undervolt.h \
util.h
intel_undervolt_sources = \
config.c \
measure.c \
main.c \
modes.c \
power.c \
scaling.c \
stat.c \
undervolt.c \
util.c
intel_undervolt_objects = $(intel_undervolt_sources:.c=.o)
%.o: %.c $(intel_undervolt_headers)
$(CC) $(CFLAGS) $(EXTRA_CFLAGS) \
-DSYSCONFDIR='"'$(SYSCONFDIR)'"' \
-o $@ -c $<
intel-undervolt: $(intel_undervolt_objects)
$(CC) $(LDFLAGS) -o $@ $^ -lm
install: all
install -Dm755 'intel-undervolt' \
"$(DESTDIR)$(BINDIR)/intel-undervolt"
install -Dm644 'intel-undervolt.conf' \
"$(DESTDIR)$(SYSCONFDIR)/intel-undervolt.conf"
ifeq ($(ENABLE_SYSTEMD), 1)
install -Dm644 'intel-undervolt.service' \
"$(DESTDIR)$(UNITDIR)/intel-undervolt.service"
install -Dm644 'intel-undervolt-loop.service' \
"$(DESTDIR)$(UNITDIR)/intel-undervolt-loop.service"
endif
ifeq ($(ENABLE_ELOGIND), 1)
install -Dm755 'intel-undervolt.elogind' \
"$(DESTDIR)$(ELOGINDDIR)/system-sleep/50-intel-undervolt"
endif
ifeq ($(ENABLE_OPENRC), 1)
install -Dm755 'intel-undervolt-loop.openrc' \
"$(DESTDIR)$(SYSCONFDIR)/init.d/intel-undervolt-loop"
endif
clean:
rm -fv \
$(intel_undervolt_objects) \
intel-undervolt \
intel-undervolt.service \
intel-undervolt-loop.service \
intel-undervolt-loop.openrc