aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile78
1 files changed, 78 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..09a5a8c
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,78 @@
+# 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
+
+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-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)
+
+# ##########################
+# Distribution tarball rules
+# ##########################
+
+DISTDIR=$(PACKAGE)-$(VERSION)
+DISTFILES=\
+ slackware-upgrade-system\
+ slackware-upgrade-system.8\
+ Makefile\
+ COPYING\
+ README
+
+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.