blob: 4aded238086736dbc68496dd4b282fe5d9c94a62 (
plain)
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
|
# Makefile for ctct
#
# Copyright 2015, 2016 Einhard Leichtfuß
#
# This file is part of ctct.
#
# ctct is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# ctct 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 Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with ctct. If not, see <http://www.gnu.org/licenses/>.
#
TARGET = @PACKAGE_NAME@
VERSION = @PACKAGE_VERSION@
# for some reason, autoconf references to ${PACKAGE_TARNAME} in docdir
PACKAGE_TARNAME = @PACKAGE_TARNAME@
SRCS = @PACKAGE_NAME@.c
DOCS = COPYING README CHANGELOG
CONFIGS = config.sh
INSTALL = install
INSTALL_PROGRAM = $(INSTALL) -m 755
INSTALL_DATA = $(INSTALL) -m 644
INSTALL_DIR = $(INSTALL) -d -m 755
RM = rm
prefix = @prefix@
exec_prefix = @exec_prefix@
bindir = @bindir@
datarootdir = @datarootdir@
sysconfdir = @sysconfdir@
confdir = @confdir@
docdir = @docdir@
bash_completion_dir = @bash_completion_dir@
mandir = @mandir@
man1dir = ${mandir}/man1
man1ext = .1
all: $(TARGET)
install: installdirs
$(INSTALL_PROGRAM) $(TARGET) $(DESTDIR)$(bindir)/
$(INSTALL_DATA) $(CONFIGS) $(DESTDIR)$(confdir)/
$(INSTALL_DATA) $(DOCS) $(DESTDIR)$(docdir)/
$(INSTALL_DATA) $(TARGET).bash_completion \
$(DESTDIR)$(bash_completion_dir)/$(TARGET)
$(INSTALL_DATA) $(TARGET)$(man1ext) $(DESTDIR)$(man1dir)/
installdirs:
$(INSTALL_DIR) $(DESTDIR)$(bindir)
$(INSTALL_DIR) $(DESTDIR)$(confdir)
$(INSTALL_DIR) $(DESTDIR)$(docdir)
$(INSTALL_DIR) $(DESTDIR)$(bash_completion_dir)
$(INSTALL_DIR) $(DESTDIR)$(man1dir)
uninstall:
$(RM) $(DESTDIR)$(bindir)/$(TARGET)
# only remove configuration file if unchanged
for file in $(CONFIGS); do \
if cmp $$file $(DESTDIR)$(confdir)/$$file; then \
$(RM) $(DESTDIR)$(confdir)/$$file; \
fi \
done
-$(RM) -d $(DESTDIR)$(confdir)
for file in $(DOCS); do \
$(RM) $(DESTDIR)$(docdir)/$$file; \
done
-$(RM) -d $(DESTDIR)$(docdir)
$(RM) $(DESTDIR)$(bash_completion_dir)/$(TARGET)
$(RM) $(DESTDIR)$(man1dir)/$(TARGET)$(man1ext)
.PHONY: install installdirs uninstall
|