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 the StatNews package
#
# Copyright (C) 1998, 99, 2000, 01, 11 Davide Giovanni Maria Salvetti.
#
# This program 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 of the License, or (at your
# option) any later version.
#
# This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
VER = $(shell git tag -l | tail -n 1 | cut -d '/' -f 2)
INSTALL = install -o root -g root
INSTALL_SCRIPT = $(INSTALL)
INSTALL_DATA = $(INSTALL) -m 644
INSTALL_DIR = $(INSTALL) -d
prefix = /usr/local/
exec_prefix = $(prefix)
datarootdir = $(prefix)/share
bindir = $(exec_prefix)/bin
mandir = $(datarootdir)/man
man1dir = $(datarootdir)/man/man1
docdir = $(datarootdir)/doc/statnews
.PHONY: all
all: build
.PHONY: build
build: statnews.1
statnews.1: statnews.pl
pod2man --section 1 --center "Debian GNU/Linux Manual" \
--release "Debian Project" $< > $@
.PHONY: installdirs
installdirs:
test -d $(DESTDIR)$(bindir) \
|| $(INSTALL_DIR) $(DESTDIR)$(bindir)
test -d $(DESTDIR)$(man1dir) \
|| $(INSTALL_DIR) $(DESTDIR)$(man1dir)
test -d $(DESTDIR)$(docdir) \
|| $(INSTALL_DIR) $(DESTDIR)$(docdir)
.PHONY: install
install: all installdirs
$(INSTALL_SCRIPT) statnews.pl $(DESTDIR)$(bindir)/statnews
$(INSTALL_DATA) statnews.1 $(DESTDIR)$(man1dir)
$(INSTALL_DATA) NEWS $(DESTDIR)$(docdir)
$(INSTALL_DATA) README $(DESTDIR)$(docdir)
$(INSTALL_DATA) TODO $(DESTDIR)$(docdir)
.PHONY: uninstall
uninstall:
rm -f $(DESTDIR)$(docdir)/TODO
rm -f $(DESTDIR)$(docdir)/README
rm -f $(DESTDIR)$(docdir)/NEWS
rm -f $(DESTDIR)$(man1dir)/statnews.1
rm -f $(DESTDIR)$(bindir)/statnews
.PHONY: clean distclean mostlyclean maintainer-clean
clean distclean mostlyclean maintainer-clean:
rm -f statnews.1
.PHONY: dist
dist:
git archive --format=tar --prefix=statnews-$(VER)/ HEAD \
| gzip --best > ../statnews-$(VER).tar.gz
.PHONY: check
check: build
test -f statnews.1
# local variables:
# mode: makefile
# ispell-local-dictionary: "american"
# ispell-check-comments: exclusive
# end:
|