2019-06-27 09:02:19 -04:00
|
|
|
# This file is part of GNU Stow.
|
|
|
|
#
|
|
|
|
# GNU Stow 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.
|
|
|
|
#
|
|
|
|
# GNU Stow 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 https://www.gnu.org/licenses/.
|
|
|
|
|
2001-12-24 09:57:46 -05:00
|
|
|
## Process this file with Automake to produce Makefile.in
|
|
|
|
|
2011-12-06 11:20:52 -05:00
|
|
|
bin_SCRIPTS = bin/stow bin/chkstow
|
2011-11-21 08:59:36 -05:00
|
|
|
info_TEXINFOS = doc/stow.texi
|
|
|
|
dist_man_MANS = doc/stow.8
|
2011-12-06 11:47:32 -05:00
|
|
|
PDF = doc/manual.pdf
|
|
|
|
HTML = doc/manual-single.html
|
2011-11-24 12:00:33 -05:00
|
|
|
dist_doc_DATA = \
|
2015-11-16 17:35:56 -05:00
|
|
|
README.md INSTALL.md \
|
2011-12-06 11:47:32 -05:00
|
|
|
$(PDF) $(HTML) doc/version.texi \
|
2011-11-24 12:00:33 -05:00
|
|
|
ChangeLog doc/ChangeLog.OLD
|
2011-11-24 11:22:11 -05:00
|
|
|
|
2015-11-17 12:27:39 -05:00
|
|
|
# automake magic to define where *_DATA files get installed:
|
2011-12-06 05:33:34 -05:00
|
|
|
pmdir = $(PMDIR)
|
2015-11-17 12:27:39 -05:00
|
|
|
pmstowdir = $(pmdir)/Stow
|
|
|
|
|
|
|
|
pm_DATA = lib/Stow.pm
|
|
|
|
pmstow_DATA = lib/Stow/Util.pm
|
2011-11-16 09:04:03 -05:00
|
|
|
|
2011-11-24 12:33:36 -05:00
|
|
|
TEXINFO_TEX = doc/texinfo.tex
|
|
|
|
export TEXI2DVI_BUILD_MODE = clean
|
2011-11-24 11:32:01 -05:00
|
|
|
AM_MAKEINFOFLAGS = -I $(srcdir)
|
|
|
|
|
|
|
|
# We require this -I parameter to ensure that the include of the
|
|
|
|
# default ignore list in the manual works. Unfortunately this is
|
|
|
|
# the only way to do it:
|
|
|
|
#
|
|
|
|
# http://article.gmane.org/gmane.comp.sysutils.automake.bugs/4334/match=passing+parameters
|
|
|
|
#
|
|
|
|
# even though it annoyingly produces a warning with the -Wall option
|
|
|
|
# to AM_INIT_AUTOMAKE which has to be silenced via -Wno-override.
|
|
|
|
TEXI2DVI = texi2dvi $(AM_MAKEINFOFLAGS)
|
|
|
|
|
2011-12-03 09:03:58 -05:00
|
|
|
doc_deps = $(info_TEXINFOS) doc/version.texi
|
|
|
|
|
2011-11-24 11:32:01 -05:00
|
|
|
DEFAULT_IGNORE_LIST = $(srcdir)/default-ignore-list
|
|
|
|
|
|
|
|
TESTS_DIR = $(srcdir)/t
|
|
|
|
TESTS_OUT = tmp-testing-trees
|
2011-12-06 11:20:52 -05:00
|
|
|
TESTS_ENVIRONMENT = $(PERL) -Ibin -Ilib -I$(TESTS_DIR)
|
2011-11-24 11:32:01 -05:00
|
|
|
|
|
|
|
# This is a kind of hack; TESTS needs to be set to ensure that the
|
|
|
|
# `check-am' target makes check-TESTS, but we override check-TESTS
|
|
|
|
# so it doesn't really matter what it's set to, as long as it already
|
|
|
|
# exists (otherwise automake will try to build it).
|
|
|
|
TESTS = t
|
2011-11-16 09:04:03 -05:00
|
|
|
|
2011-11-24 11:32:01 -05:00
|
|
|
# GNU autotools standardised on the 'check' target, but CPAN (and the
|
|
|
|
# rest of the world) standardised on the 'test' target.
|
|
|
|
test: check
|
|
|
|
|
|
|
|
# required in vpath mode to ensure $build/t/ exists
|
|
|
|
check_DATA = $(TESTS_OUT)
|
|
|
|
|
|
|
|
# Test::Harness produces cleaner output than automake's default test
|
|
|
|
# harness, albeit without the pretty colours provided by the
|
|
|
|
# `color-tests' AM_INIT_AUTOMAKE option. This also dodges having to
|
|
|
|
# set TESTS to the full list of tests, which is good because automake
|
|
|
|
# doesn't support wildcards, and so it would be too easy to forget to
|
|
|
|
# add a new one to the list.
|
|
|
|
#
|
|
|
|
# Note that automake's `check' rule cannot be overridden
|
|
|
|
# for some weird reason:
|
|
|
|
#
|
|
|
|
# http://thread.gmane.org/gmane.comp.sysutils.automake.general/13040/focus=13041
|
|
|
|
#
|
|
|
|
# so we override check-TESTS instead which is where the real work is
|
|
|
|
# done anyway. Unfortunately this produces a warning with the -Wall
|
|
|
|
# option to AM_INIT_AUTOMAKE which has to be silenced via
|
|
|
|
# -Wno-override.
|
|
|
|
check-TESTS:
|
|
|
|
dir=$(TESTS_DIR); \
|
|
|
|
$(TESTS_ENVIRONMENT) -MTest::Harness -e 'runtests(@ARGV)' "$${dir#./}"/*.t
|
|
|
|
|
|
|
|
$(TESTS_OUT):
|
|
|
|
mkdir -p $@
|
|
|
|
|
2011-11-21 08:59:36 -05:00
|
|
|
CPAN_FILES = MANIFEST MANIFEST.SKIP Build.PL META.yml META.json
|
|
|
|
EXTRA_DIST = \
|
2015-11-09 06:36:11 -05:00
|
|
|
bin/stow.in bin/chkstow.in lib/Stow.pm.in lib/Stow/Util.pm.in \
|
2011-12-03 09:03:58 -05:00
|
|
|
doc/manual-split \
|
2011-11-21 08:59:36 -05:00
|
|
|
$(TESTS) t/testutil.pm \
|
|
|
|
$(TEXINFO_TEX) \
|
2011-11-24 11:32:01 -05:00
|
|
|
$(DEFAULT_IGNORE_LIST) \
|
2011-11-21 08:59:36 -05:00
|
|
|
$(CPAN_FILES)
|
2015-11-17 12:27:39 -05:00
|
|
|
CLEANFILES = $(bin_SCRIPTS) $(pm_DATA) $(pmstow_DATA)
|
2011-12-06 13:20:03 -05:00
|
|
|
MAINTAINERCLEANFILES = $(dist_man_MANS) $(HTML) $(PDF) ChangeLog
|
2011-11-16 09:04:03 -05:00
|
|
|
|
2011-11-24 11:22:11 -05:00
|
|
|
# clean up auto-generated files
|
2011-11-16 09:04:03 -05:00
|
|
|
clean-local:
|
2011-12-06 11:20:52 -05:00
|
|
|
-rm -rf $(TESTS_OUT)
|
2011-12-06 19:38:16 -05:00
|
|
|
maintainer-clean-local:
|
2019-06-28 16:20:22 -04:00
|
|
|
-rm -rf doc/manual-split cover_db
|
2011-11-16 09:04:03 -05:00
|
|
|
|
|
|
|
# this is more explicit and reliable than the config file trick
|
2011-12-07 15:28:28 -05:00
|
|
|
edit = sed -e 's|[@]PERL[@]|$(PERL)|g' \
|
|
|
|
-e 's|[@]VERSION[@]|$(VERSION)|g' \
|
|
|
|
-e "s|[@]USE_LIB_PMDIR[@]|$$use_lib_pmdir|g"
|
|
|
|
|
|
|
|
pmdir_in_INC = \
|
|
|
|
PERL5LIB= $(PERL) -V | \
|
|
|
|
awk '/@INC/ {p=1; next} p==1 {print $$1}' | \
|
|
|
|
grep -q "$(pmdir)"
|
|
|
|
|
|
|
|
calc_use_lib_pmdir = \
|
|
|
|
if $(pmdir_in_INC); then \
|
|
|
|
use_lib_pmdir=""; \
|
|
|
|
else \
|
|
|
|
use_lib_pmdir="use lib \"$(pmdir)\";"; \
|
|
|
|
fi
|
|
|
|
|
|
|
|
check_pmdir = \
|
|
|
|
echo; \
|
|
|
|
echo "\# Perl modules will be installed to $(pmdir)"; \
|
|
|
|
echo "\# "; \
|
|
|
|
if $(pmdir_in_INC); then \
|
|
|
|
echo "\# This is in $(PERL)'s built-in @INC, so everything"; \
|
|
|
|
echo "\# should work fine with no extra effort."; \
|
|
|
|
else \
|
|
|
|
echo "\# This is not in $(PERL)'s built-in @INC, so the"; \
|
|
|
|
echo "\# front-end scripts will have an appropriate \"use lib\""; \
|
|
|
|
echo "\# line inserted to compensate."; \
|
|
|
|
fi; \
|
|
|
|
echo
|
2011-11-16 09:04:03 -05:00
|
|
|
|
2015-11-09 07:37:09 -05:00
|
|
|
bin/stow: bin/stow.in Makefile.am
|
2011-11-24 11:32:01 -05:00
|
|
|
[ -d bin ] || mkdir bin # required in vpath mode
|
2011-12-07 15:28:28 -05:00
|
|
|
@$(check_pmdir)
|
|
|
|
@$(calc_use_lib_pmdir); \
|
2011-11-16 09:04:03 -05:00
|
|
|
$(edit) < $< > $@
|
2011-12-07 15:28:28 -05:00
|
|
|
@echo "Generated $@ from $<"
|
2011-11-16 09:04:03 -05:00
|
|
|
chmod +x $@
|
2001-12-24 09:57:46 -05:00
|
|
|
|
2015-11-09 07:37:09 -05:00
|
|
|
bin/chkstow: bin/chkstow.in Makefile.am
|
2011-12-07 15:28:28 -05:00
|
|
|
@[ -d bin ] || mkdir bin # required in vpath mode
|
|
|
|
@$(edit) < $< > $@
|
|
|
|
@echo "Generated $@ from $<"
|
2011-11-16 09:04:03 -05:00
|
|
|
chmod +x $@
|
2001-12-24 09:57:46 -05:00
|
|
|
|
2015-11-09 07:37:09 -05:00
|
|
|
lib/Stow.pm: lib/Stow.pm.in $(DEFAULT_IGNORE_LIST) Makefile.am
|
2011-12-07 15:28:28 -05:00
|
|
|
@[ -d lib ] || mkdir lib # required in vpath mode
|
|
|
|
@( $(edit) < $<; cat $(DEFAULT_IGNORE_LIST) ) > $@
|
|
|
|
@echo "Generated $@ from $< and $(DEFAULT_IGNORE_LIST)"
|
2011-11-24 11:28:09 -05:00
|
|
|
|
2015-11-09 06:36:11 -05:00
|
|
|
lib/Stow/Util.pm: lib/Stow/Util.pm.in Makefile.am
|
|
|
|
@[ -d lib/Stow ] || mkdir -p lib/Stow # required in vpath mode
|
|
|
|
@$(edit) < $< > $@
|
|
|
|
@echo "Generated $@ from $<"
|
|
|
|
|
2011-11-24 12:33:36 -05:00
|
|
|
##############################################################################
|
2011-12-01 12:25:24 -05:00
|
|
|
# The below rules should only be needed by developers.
|
2011-11-24 12:33:36 -05:00
|
|
|
##############################################################################
|
2001-12-24 09:57:46 -05:00
|
|
|
|
2015-11-16 17:47:34 -05:00
|
|
|
cpanm:
|
|
|
|
cpanm --quiet --installdeps --notest .; \
|
|
|
|
CPANM_RESULT=$$?; \
|
|
|
|
if [ $$CPANM_RESULT != 0 ]; then \
|
|
|
|
echo ---------------------------------------------------; \
|
|
|
|
cat ~/.cpanm/build.log; \
|
|
|
|
echo ---------------------------------------------------; \
|
|
|
|
exit $$CPANM_RESULT; \
|
|
|
|
fi
|
|
|
|
|
2015-11-09 05:08:31 -05:00
|
|
|
doc/stow.8: bin/stow.in Makefile.am
|
2011-12-03 09:03:58 -05:00
|
|
|
[ -d doc ] || mkdir doc # required in vpath mode
|
2016-09-20 13:27:46 -04:00
|
|
|
$(edit) < $< | pod2man --name stow --section 8 > $@
|
2011-12-03 09:03:58 -05:00
|
|
|
|
|
|
|
# We use automake's built-in rule to generate stow.info. The built-in
|
|
|
|
# rules would also generate doc/stow.html and doc/stow.pdf, but after
|
|
|
|
# installation we want $(docdir) (typically /usr/share/doc/stow/) to
|
|
|
|
# contain manual-single.html, manual.pdf, and manual-split/*.html, to
|
|
|
|
# make it explicitly obvious that these files contain the user manual
|
|
|
|
# rather than some other Stow-related documentation.
|
|
|
|
#
|
|
|
|
# If it were not for a troublesome dependency on doc/$(am__dirstamp):
|
|
|
|
#
|
|
|
|
# http://article.gmane.org/gmane.comp.sysutils.automake.general/13192
|
|
|
|
#
|
|
|
|
# we could have achieved this using the built-in rules combined with
|
|
|
|
# install-data-hook to rename from stow.pdf to manual.pdf etc. on
|
|
|
|
# install. Instead, by overriding the built-in rules with modified
|
|
|
|
# versions, we can kill both birds with one stone.
|
|
|
|
|
2019-06-26 08:37:07 -04:00
|
|
|
# Generating the single-page HTML version used to be done with the old
|
|
|
|
# texi2html, which is no longer maintained. This rule is not used,
|
|
|
|
# but is kept to allow comparing of results during the transition, and
|
|
|
|
# potentially longer for posterity.
|
|
|
|
doc/manual-single-old-texi2html.html: $(doc_deps)
|
|
|
|
texi2html --P=$(srcdir) --output=$@ -expandinfo -menu -monolithic -verbose $<
|
|
|
|
|
|
|
|
# One alternative to the old texi2html approach is to use the texi2html
|
|
|
|
# wrapper around texi2any which is provided as a partial drop-in replacement:
|
|
|
|
#
|
|
|
|
# https://www.gnu.org/software/texinfo/manual/texinfo/html_node/texi2html.html#texi2html
|
|
|
|
#
|
|
|
|
# Differences to the old texi2html:
|
|
|
|
#
|
|
|
|
# - Doesn't wrap @file{foo} paths with quotes, which looks better.
|
|
|
|
# - Missing certain sections
|
|
|
|
doc/manual-single-texi2html-wrapper.html: $(doc_deps)
|
|
|
|
texi2any -P $(srcdir) --output=$@ --verbose \
|
|
|
|
-c TEXI2HTML=1 -c SHOW_MENU=1 -c MONOLITHIC=1 $<
|
|
|
|
|
|
|
|
.PHONY: manual-single-html-all
|
|
|
|
manual-single-html-all: \
|
|
|
|
$(HTML) \
|
|
|
|
doc/manual-single-texi2html-wrapper.html \
|
|
|
|
doc/manual-single-old-texi2html.html
|
|
|
|
|
|
|
|
# Modern approach using $(MAKEINFOHTML) --no-split
|
|
|
|
# Differences to the older two approaches:
|
|
|
|
#
|
|
|
|
# - Nicer navigation links between sections
|
2011-12-06 11:47:32 -05:00
|
|
|
$(HTML): $(doc_deps)
|
2011-11-24 12:33:36 -05:00
|
|
|
[ -d doc ] || mkdir doc # required in vpath mode
|
2001-12-24 09:57:46 -05:00
|
|
|
-rm -f $@
|
2019-06-26 08:37:07 -04:00
|
|
|
$(MAKEINFOHTML) $(AM_MAKEINFOHTMLFLAGS) $(MAKEINFOFLAGS) -I doc -I $(srcdir)/doc \
|
|
|
|
-c USE_TITLEPAGE_FOR_TITLE=1 --no-split -o $@ \
|
|
|
|
`test -f 'doc/stow.texi' || echo '$(srcdir)/'`doc/stow.texi
|
2011-11-16 09:30:55 -05:00
|
|
|
|
2011-12-06 11:47:32 -05:00
|
|
|
$(PDF): $(doc_deps)
|
2011-12-03 09:03:58 -05:00
|
|
|
TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \
|
|
|
|
MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I doc -I $(srcdir)/doc' \
|
|
|
|
$(TEXI2PDF) -o $@ `test -f 'doc/stow.texi' || echo '$(srcdir)/'`doc/stow.texi
|
|
|
|
|
|
|
|
doc/manual-split: $(doc_deps)
|
|
|
|
rm -rf $@.new
|
|
|
|
if $(MAKEINFOHTML) $(AM_MAKEINFOHTMLFLAGS) $(MAKEINFOFLAGS) -I doc -I $(srcdir)/doc \
|
|
|
|
-o $@.new `test -f 'doc/stow.texi' || echo '$(srcdir)/'`doc/stow.texi; \
|
|
|
|
then \
|
|
|
|
rm -rf $@; \
|
|
|
|
mv $@.new $@; \
|
|
|
|
else \
|
|
|
|
rm -Rf $@.new $@; \
|
|
|
|
exit 1; \
|
|
|
|
fi
|
|
|
|
|
|
|
|
# The split version of the manual is copied to $(docdir)/manual-split
|
|
|
|
# by install-data-hook. The whole subdirectory is included via
|
|
|
|
# EXTRA_DIST in order to avoid having to list each file explicitly in
|
|
|
|
# dist_doc_DATA, since automake doesn't support wildcards, and
|
|
|
|
# dist_doc_DATA cannot refer to directories while EXTRA_DIST can (go
|
|
|
|
# figure ...)
|
2011-11-24 11:52:50 -05:00
|
|
|
|
2011-12-03 09:03:58 -05:00
|
|
|
install-data-hook: doc/manual-split
|
|
|
|
cp -r $(srcdir)/doc/manual-split $(DESTDIR)$(docdir)
|
2011-12-01 12:25:24 -05:00
|
|
|
|
|
|
|
uninstall-hook:
|
2011-12-03 09:03:58 -05:00
|
|
|
chmod u+w -R $(DESTDIR)$(docdir)/manual-split
|
|
|
|
rm -rf $(DESTDIR)$(docdir)/manual-split
|
|
|
|
|
|
|
|
# Using install-data-hook has the slightly annoying disadvantage that
|
|
|
|
# by default the split version of the manual isn't automatically
|
|
|
|
# rebuilt during development by a simple `make'. A workaround hack
|
|
|
|
# for this is to piggy-back the dependency onto manual-single.html,
|
|
|
|
# which *is* automatically rebuilt by `make':
|
2011-12-06 11:47:32 -05:00
|
|
|
$(HTML): doc/manual-split
|
2011-12-03 09:03:58 -05:00
|
|
|
|
|
|
|
# With the above hack, this probably isn't necessary but is safer to
|
|
|
|
# keep in anyway:
|
|
|
|
dist-hook: doc/manual-split
|
2011-11-24 12:00:33 -05:00
|
|
|
|
2011-12-06 20:23:41 -05:00
|
|
|
dist-hook: $(dist_man_MANS)
|
|
|
|
## If we are creating a distribution from a git checkout, ensure
|
|
|
|
## the ChangeLog file is in sync the git repository.
|
|
|
|
if test -d $(top_srcdir)/.git; then \
|
|
|
|
rm -f ChangeLog \
|
|
|
|
&& $(MAKE) $(AM_MAKEFLAGS) ChangeLog \
|
|
|
|
&& cp -f ChangeLog $(distdir)/ChangeLog; \
|
|
|
|
fi
|
2011-12-06 11:20:52 -05:00
|
|
|
|
|
|
|
ChangeLog: doc/ChangeLog.OLD
|
2011-11-24 12:00:33 -05:00
|
|
|
@if [ -d .git ]; then \
|
|
|
|
( \
|
|
|
|
git log \
|
|
|
|
--format="format:%ad %aN <%aE>%n%n * %w(70,0,4)%s%+b%n" \
|
|
|
|
--name-status \
|
|
|
|
v2.0.2..HEAD \
|
|
|
|
| sed 's/^\([A-Z]\)\t/ \1 /'; \
|
|
|
|
cat $< \
|
|
|
|
) > $@; \
|
2011-12-06 12:24:44 -05:00
|
|
|
echo "Rebuilt $@ from git commit history."; \
|
2011-11-24 12:00:33 -05:00
|
|
|
else \
|
|
|
|
echo "Not in a git repository; can't update ChangeLog."; \
|
|
|
|
fi
|