aboutsummaryrefslogtreecommitdiff
path: root/Makefile
blob: 8c5063c74fed711a2ccfeb1234be9ae64652f5fc (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
83
84
85
86
# Makefile for slackupgrade 
# Copyright (C) 2019-2020 Sergey Poznyakoff.
#
# Slackware-upgrade-system 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 3, or (at your option)
# any later version.
#
# Slackware-upgrade-system 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 slackupgrade.  If not, see
# <http://www.gnu.org/licenses/>.

PACKAGE   = slackupgrade
VERSION   = 2.1

SBINDIR   = /sbin
MANDIR    = /usr/man
MAN8DIR   = $(MANDIR)/man8
CONFDIR   = /etc/$(PACKAGE)
CONFFILES = conf/14.0-14.1.repl conf/14.1-14.2.repl

help:;
	@echo "Avalable targets:"
	@echo ""
	@echo "$$ make install"
	@echo "   Installs the program.  Influential variables:"
	@echo "   SBINDIR - directory to install system binaries to ($(SBINDIR))"
	@echo "   MANDIR  - toplevel directory for man page installation ($(MANDIR))"
	@echo ""
	@echo "$$ make install-sbin"
	@echo "   Installs only the slackupgrade script."
	@echo ""
	@echo "$$ make install-man"
	@echo "   Installs only the manpage."
	@echo ""
	@echo "$$ make dist"
	@echo "   Creates the distribution tarball."

# ##########################
# Installation rules
# ##########################
install: install-sbin install-conf install-man

install-sbin:
	@if ! test -d $(DESTDIR)$(SBINDIR); then install -d $(DESTDIR)$(SBINDIR); fi
	install slackupgrade $(DESTDIR)$(SBINDIR)

install-man:
	@if ! test -d $(DESTDIR)$(MAN8DIR); then install -d $(DESTDIR)$(MAN8DIR); fi
	install -m 644 slackupgrade.8 $(DESTDIR)$(MAN8DIR)

install-conf:
	@if ! test -d $(DESTDIR)$(CONFDIR); then install -d $(DESTDIR)$(CONFDIR); fi
	install -m 644 $(CONFFILES) $(DESTDIR)$(CONFDIR)

# ##########################
# Distribution tarball rules
# ##########################

DISTDIR   = $(PACKAGE)-$(VERSION)
DISTFILES =\
 slackupgrade\
 slackupgrade.8\
 Makefile\
 COPYING\
 README\
 NEWS\
 $(CONFFILES)

distdir:
	test -d $(DISTDIR) || mkdir $(DISTDIR)
	tar -c -f - $(DISTFILES) | tar -C $(DISTDIR) -x -f -

dist: distdir
	tar zcf $(DISTDIR).tar.gz $(DISTDIR)
	rm -rf $(DISTDIR)
	@s="$(DISTDIR).tar.gz created"; \
	echo "$$s" | sed -e s/./=/g; \
	echo "$$s"; \
	echo "$$s" | sed -e s/./=/g

Return to:

Send suggestions and report system problems to the System administrator.