-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
31 lines (22 loc) · 827 Bytes
/
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
all: build
ifdef PHH_DEBUG
OPTIMISATION_FLAGS = -g3 -ggdb -no-pie
else
OPTIMISATION_FLAGS = -O3 -D_FORTIFY_SOURCE=2
endif
build: polite-hwclock-hctosys.o polite-hwclock-hctosys
gcc -std=c17 $(OPTIMISATION_FLAGS) -o polite-hwclock-hctosys polite-hwclock-hctosys.o
copy-bin:
cp polite-hwclock-hctosys /usr/local/bin/
install-systemv: copy-bin
cp polite-hwclock-hctosys.systemv /etc/init.d/polite-hwclock-hctosys
install-systemd: copy-bin
cp polite-hwclock-hctosys.service /etc/systemd/system/
uninstall:
rm -f /usr/local/bin/polite-hwclock-hctosys
rm -f /etc/init.d/polite-hwclock-hctosys
rm -f /etc/systemd/system/polite-hwclock-hctosys.service
.c.o:
gcc -std=c17 -Wall -Werror -Wfatal-errors -fno-strict-aliasing -Wstrict-aliasing $(OPTIMISATION_FLAGS) -c $< -o $@
clean:
rm -f *.o polite-hwclock-hctosys