aboutsummaryrefslogtreecommitdiff
path: root/Makefile
blob: 3d90bb6c825c950ba13ef2263c19765c66d32357 (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
# Makefile for slackware-upgrade-system 
# Copyright (C) 2019 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 slackware-upgrade-system.  If not, see
# <http://www.gnu.org/licenses/>.

PACKAGE   = slackupgrade
VERSION   = 0.1

SBINDIR   = /sbin
MANDIR    = /usr/man
MAN8DIR   = $(MANDIR)/man8
CONFDIR   = /etc/slackware-system-upgrade
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 slackware-upgrade-system 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 slackware-upgrade-system $(DESTDIR)$(SBINDIR)

install-man:
	@if ! test -d $(DESTDIR)$(MAN8DIR); then install -d $(DESTDIR)$(MAN8DIR); fi
	install -m 644 slackware-upgrade-system.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 =\
 slackware-upgrade-system\
 slackware-upgrade-system.8\
 Makefile\
 COPYING\
 README\
 $(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.