-
Notifications
You must be signed in to change notification settings - Fork 4
/
Makefile
38 lines (30 loc) · 1.03 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
OBJS=hibernation-setup-tool.o
CFLAGS+=-Os -Wall -Wextra -std=gnu11 -fstack-protector-all -D_FORTIFY_SOURCE=1
LDFLAGS+=-Wl,-z,relro,-z,now
%.o: %.c
$(CC) -c $< $(CFLAGS) -o $@
hibernation-setup-tool: $(OBJS)
$(CC) $(LDFLAGS) -o $@ $^
all: hibernation-setup-tool
debug: CFLAGS += -DDEBUG -g -O0
debug: hibernation-setup-tool
.PHONY: clean
clean:
rm -f $(OBJS)
rm -f hibernation-setup-tool
.PHONY: install
install: all
ifneq (,$(wildcard hibernation-setup-tool.1))
install -m 0755 -d $(DESTDIR)/usr/share/man/man1/
install -m 0644 hibernation-setup-tool.1 $(DESTDIR)/usr/share/man/man1/
endif
install -m 0755 -d $(DESTDIR)/usr/sbin
install -m 0755 -d $(DESTDIR)/lib/systemd/system/
install -m 0755 hibernation-setup-tool $(DESTDIR)/usr/sbin
install -m 0644 hibernation-setup-tool.service $(DESTDIR)/lib/systemd/system
.PHONY: indent
indent:
clang-format hibernation-setup-tool.c > indented.c
mv indented.c hibernation-setup-tool.c
hibernation-setup-tool.1: README.md
pandoc -f markdown -s -t man README.md -o hibernation-setup-tool.1