-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
87 lines (69 loc) · 2.14 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
# Makefile
#
# qotd - A simple QOTD daemon.
# Copyright (c) 2015-2016 Emmie Smith
#
# qotd is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
#
# qotd is distributed in the hope that 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.
#
# You should have received a copy of the GNU General Public License
# along with qotd. If not, see <http://www.gnu.org/licenses/>.
#
.SUFFIXES:
.PHONY: all pdf install clean
# Constant declarations
V := 0
EXE := qotdd
# Directories
SRC_DIR := src
MAN_DIR := man
export V PROGRAM_NAME VERSION EXE
# Goal Targets
all:
@make -C $(SRC_DIR)
release:
@echo '[RELEASE]'
@make -BC $(SRC_DIR) release
@make -BC $(MAN_DIR) release
debug:
@echo '[DEBUG]'
@make -C $(SRC_DIR) debug
profile:
@echo '[PROFILE]'
@make -C $(SRC_DIR) profile
man:
@make -C $(MAN_DIR) all
pdf:
@make -C $(MAN_DIR) pdf
clean:
@echo '[CLEAN]'
@make -C $(SRC_DIR) clean
@make -C $(MAN_DIR) clean
# Primary targets
install:
@echo '[INSTALL] $(ROOT)/usr/bin/qotdd'
@install -D -m755 src/$(EXE) '$(ROOT)/usr/bin/qotdd'
@echo '[INSTALL] $(ROOT)/etc/qotd.conf'
@install -D -m644 misc/qotd.conf '$(ROOT)/etc/qotd.conf'
@echo '[INSTALL] $(ROOT)/usr/share/qotd/quotes.txt'
@install -D -m644 misc/quotes.txt '$(ROOT)/usr/share/qotd/quotes.txt'
ifeq ($(SYSTEMD),1)
@echo '[INSTALL] $(ROOT)/usr/lib/systemd/system/qotd.service'
@install -D -m644 misc/qotd.service '$(ROOT)/usr/lib/systemd/system/qotd.service'
endif
@cd $(MAN_DIR); \
for section in 5 8; do \
for filename in *.$${section}.gz; do \
echo "[INSTALL] $(ROOT)/usr/share/man/man$${section}/$${filename}"; \
install -D -m644 "$${filename}" "$(ROOT)/usr/share/man/man$${section}/$${filename}"; \
done \
done
@echo '[INSTALL] $(ROOT)/usr/share/doc/qotd/qotd.pdf'
@install -D -m644 man/qotd.pdf '$(ROOT)/usr/share/doc/qotd/qotd.pdf'