## ## Makefile for GNU shtool ## Copyright (c) 1999-2001 Ralf S. Engelschall ## ## This file is part of shtool and 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 ## 2 of the License, or (at your option) any later version. ## ## This file 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, write to the Free Software ## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, ## USA, or contact Ralf S. Engelschall . ## @SET_MAKE@ TOP = . prefix = @prefix@ exec_prefix = @exec_prefix@ bindir = @bindir@ mandir = @mandir@ datadir = @datadir@ aclocaldir = $(datadir)/aclocal pkgdatadir = $(datadir)/shtool DESTDIR = SHELL = /bin/sh PERL = @PERL@ POD2MAN = @POD2MAN@ RM = rm -f RMDIR = rmdir TRUE = true CP = cp LS = ls USER_NAME = gnu GROUP_NAME = shtool SCRIPTS = \ sh.echo \ sh.mdate \ sh.table \ sh.prop \ sh.move \ sh.install \ sh.mkdir \ sh.mkln \ sh.mkshadow \ sh.fixperm \ sh.tarball \ sh.subst \ sh.guessos \ sh.arx \ sh.slo \ sh.scpp \ sh.version \ sh.path all: shtool shtool.1 shtoolize.1 shtool: $(SCRIPTS) sh.common shtoolize @$(SHELL) sh.echo -e "%BBuilding shtool program:%b" ./shtoolize -o shtool all shtool.1: shtool.pod @$(SHELL) sh.echo -e "%BBuilding shtool.1 manual page:%b" V1=`$(SHELL) sh.version -l txt -d short VERSION`; \ V2=`$(SHELL) sh.version -l txt -d long VERSION`; \ D=`$(SHELL) sh.version -l txt -d long VERSION | sed -e 's;.*(;;' -e 's;).*;;'`; \ $(POD2MAN) --section=1 --center="GNU Portable Shell Tool" \ --release="$$D" --date="shtool $$V1" shtool.pod |\ sed -e "s;SHTOOL_VERSION_STR;$$V2;" >shtool.1 shtoolize.1: shtoolize.pod @$(SHELL) sh.echo -e "%BBuilding shtoolize.1 manual page:%b" V1=`$(SHELL) sh.version -l txt -d short VERSION`; \ V2=`$(SHELL) sh.version -l txt -d long VERSION`; \ D=`$(SHELL) sh.version -l txt -d long VERSION | sed -e 's;.*(;;' -e 's;).*;;'`; \ $(POD2MAN) --section=1 --center="GNU Portable Shell Tool" \ --release="$$D" --date="shtool $$V1" shtoolize.pod |\ sed -e "s;SHTOOL_VERSION_STR;$$V2;" >shtoolize.1 check: test test: all @$(SHELL) sh.echo -e "%BRunning test suite:%b" @$(SHELL) test.sh install: all ./shtool mkdir -f -p -m 755 $(DESTDIR)$(prefix) ./shtool mkdir -f -p -m 755 $(DESTDIR)$(bindir) ./shtool mkdir -f -p -m 755 $(DESTDIR)$(mandir)/man1 ./shtool mkdir -f -p -m 755 $(DESTDIR)$(aclocaldir) ./shtool mkdir -f -p -m 755 $(DESTDIR)$(pkgdatadir) ./shtool install -c -m 755 shtool $(DESTDIR)$(bindir)/shtool ./shtool install -c -m 755 shtoolize $(DESTDIR)$(bindir)/shtoolize ./shtool install -c -m 644 shtool.1 $(DESTDIR)$(mandir)/man1/shtool.1 ./shtool install -c -m 644 shtoolize.1 $(DESTDIR)$(mandir)/man1/shtoolize.1 ./shtool install -c -m 644 shtool.m4 $(DESTDIR)$(aclocaldir)/shtool.m4 @for script in sh.common $(SCRIPTS); do \ echo "./shtool install -c -m 644 $$script $(DESTDIR)$(pkgdatadir)/$$script"; \ ./shtool install -c -m 644 $$script $(DESTDIR)$(pkgdatadir)/$$script; \ done uninstall: @for script in sh.common $(SCRIPTS); do \ echo "$(RM) $(DESTDIR)$(pkgdatadir)/$$script"; \ $(RM) $(DESTDIR)$(pkgdatadir)/$$script; \ done $(RM) $(DESTDIR)$(aclocaldir)/shtool.m4 $(RM) $(DESTDIR)$(mandir)/man1/shtoolize.1 $(RM) $(DESTDIR)$(mandir)/man1/shtool.1 $(RM) $(DESTDIR)$(bindir)/shtoolize $(RM) $(DESTDIR)$(bindir)/shtool $(RMDIR) $(DESTDIR)$(aclocaldir) >/dev/null 2>&1 || $(TRUE) $(RMDIR) $(DESTDIR)$(pkgdatadir) >/dev/null 2>&1 || $(TRUE) $(RMDIR) $(DESTDIR)$(datadir) >/dev/null 2>&1 || $(TRUE) $(RMDIR) $(DESTDIR)$(mandir)/man1 >/dev/null 2>&1 || $(TRUE) $(RMDIR) $(DESTDIR)$(mandir) >/dev/null 2>&1 || $(TRUE) $(RMDIR) $(DESTDIR)$(bindir) >/dev/null 2>&1 || $(TRUE) $(RMDIR) $(DESTDIR)$(prefix) >/dev/null 2>&1 || $(TRUE) clean: $(RM) shtool shtool.1 shtoolize.1 distclean: clean $(RM) Makefile shtoolize $(RM) config.cache config.status config.log # (not intended to be run by end users) dist: distclean $(SHELL) sh.fixperm -v *; \ V=`$(SHELL) sh.version -l txt -d short VERSION`; \ $(SHELL) sh.tarball -o shtool-$${V}.tar.gz -d shtool-$${V} \ -u $(USER_NAME) -g $(GROUP_NAME) \ -e 'CVS,\.cvsignore,\.[ao]$$,^\.' \ -c 'gzip --best' .; \ $(LS) -l shtool-$$V.tar.gz # (not intended to be run by end users) snap: distclean @$(SHELL) sh.fixperm -v *; \ V=`$(SHELL) sh.version -l txt -d short VERSION`; \ $(SHELL) sh.tarball -o shtool-$${V}-SNAP.tar.gz -d shtool-$${V}-SNAP \ -u $(USER_NAME) -g $(GROUP_NAME) \ -e 'CVS,\.cvsignore,\.[ao]$$,^\.' \ -c 'gzip --best' .; \ $(LS) -l shtool-$$V-SNAP.tar.gz # (not intended to be run by end users) new-version: @echo "Setting new version information:"; \ V="$(VERSION)"; \ if [ ".$$V" != . ]; then \ OPT="-s$$V"; \ else \ OPT="-e"; \ fi; \ $(SHELL) ./sh.version -l txt -n "GNU shtool" -p shtool $$OPT VERSION; \ V=`$(SHELL) ./sh.version -l txt -d long VERSION`; \ sed -e "s/Version .*(.*)/Version $$V/g" README.n && mv README.n README; \ V=`$(SHELL) ./sh.version -l txt -d short VERSION`; \ sed -e "s/%define ver .*/%define ver $$V/g" shtool.spec.n && mv shtool.spec.n shtool.spec update-version: @echo "Updating date in version information"; \ V=`$(SHELL) ./sh.version -l txt -d short VERSION`;\ $(SHELL) ./sh.version -l txt -n "GNU shtool" -p shtool -s $$V VERSION;\ V=`$(SHELL) ./sh.version -l txt -d long VERSION`;\ sed -e "s/Version .*(.*)/Version $$V/g" README.n && mv README.n README;\ V=`$(SHELL) ./sh.version -l txt -d short VERSION`;\ sed -e "s/%define ver .*/%define ver $$V/g" shtool.spec.n && mv shtool.spec.n shtool.spec