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 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183
|
##
## Makefile for GNU shtool
## Copyright (c) 1999-2000 Ralf S. Engelschall <rse@engelschall.com>
##
## 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 <rse@engelschall.com>.
##
@SET_MAKE@
TOP = .
prefix = @prefix@
exec_prefix = @exec_prefix@
bindir = @bindir@
mandir = @mandir@
datadir = @datadir@
aclocaldir = $(datadir)/aclocal
pkgdatadir = $(datadir)/shtool
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.guessos \
sh.arx \
sh.slo \
sh.scpp \
sh.version \
sh.path
VERSION_TOOL = $(SHELL) ./sh.version
_NEWVERS = \
$(VERSION_TOOL) -l txt -n "GNU shtool" -p shtool $$OPT VERSION;\
V=`$(VERSION_TOOL) -l txt -d long VERSION`;\
sed -e "s/Version .*(.*)/Version $$V/g" <README >README.n && mv README.n README
_UPDATEVERS = \
V=`$(VERSION_TOOL) -l txt -d short VERSION`;\
$(VERSION_TOOL) -l txt -n "GNU shtool" -p shtool -s $$V VERSION;\
V=`$(VERSION_TOOL) -l txt -d long VERSION`;\
sed -e "s/Version .*(.*)/Version $$V/g" <README >README.n && mv README.n README
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=`$(VERSION_TOOL) -l txt -d short VERSION`; \
V2=`$(VERSION_TOOL) -l txt -d long VERSION`; \
D=`$(VERSION_TOOL) -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=`$(VERSION_TOOL) -l txt -d short VERSION`; \
V2=`$(VERSION_TOOL) -l txt -d long VERSION`; \
D=`$(VERSION_TOOL) -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 $(prefix)
./shtool mkdir -f -p -m 755 $(bindir)
./shtool mkdir -f -p -m 755 $(mandir)/man1
./shtool mkdir -f -p -m 755 $(aclocaldir)
./shtool mkdir -f -p -m 755 $(pkgdatadir)
./shtool install -c -m 755 shtool $(bindir)/shtool
./shtool install -c -m 755 shtoolize $(bindir)/shtoolize
./shtool install -c -m 644 shtool.1 $(mandir)/man1/shtool.1
./shtool install -c -m 644 shtoolize.1 $(mandir)/man1/shtoolize.1
./shtool install -c -m 644 shtool.m4 $(aclocaldir)/shtool.m4
@for script in sh.common $(SCRIPTS); do \
echo "./shtool install -c -m 644 $$script $(pkgdatadir)/$$script"; \
./shtool install -c -m 644 $$script $(pkgdatadir)/$$script; \
done
uninstall:
@for script in sh.common $(SCRIPTS); do \
echo "$(RM) $(pkgdatadir)/$$script"; \
$(RM) $(pkgdatadir)/$$script; \
done
$(RM) $(aclocaldir)/shtool.m4
$(RM) $(mandir)/man1/shtoolize.1
$(RM) $(mandir)/man1/shtool.1
$(RM) $(bindir)/shtoolize
$(RM) $(bindir)/shtool
$(RMDIR) $(aclocaldir) >/dev/null 2>&1 || $(TRUE)
$(RMDIR) $(pkgdatadir) >/dev/null 2>&1 || $(TRUE)
$(RMDIR) $(datadir) >/dev/null 2>&1 || $(TRUE)
$(RMDIR) $(mandir)/man1 >/dev/null 2>&1 || $(TRUE)
$(RMDIR) $(mandir) >/dev/null 2>&1 || $(TRUE)
$(RMDIR) $(bindir) >/dev/null 2>&1 || $(TRUE)
$(RMDIR) $(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=`$(VERSION_TOOL) -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=`$(VERSION_TOOL) -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:
OPT=-iv && $(_NEWVERS)
new-revision:
OPT=-ir && $(_NEWVERS)
new-patchlevel:
OPT=-iP && $(_NEWVERS)
new-betalevel:
OPT=-ib && $(_NEWVERS)
new-alphalevel:
OPT=-ia && $(_NEWVERS)
new-snaplevel:
OPT=-is && $(_NEWVERS)
new-release:
OPT=-s$(R) && $(_NEWVERS)
update-version:
$(_UPDATEVERS)
|