1
## texk/am/perl_links.am: Makefile fragment for perl script links.
3
## Copyright (C) 2011 Peter Breitenlohner <tex-live@tug.org>
4
## You may freely use, modify and/or distribute this file.
6
## requires conditionals WIN32 and WIN32_WRAP
7
## requires $(scriptsdir): e.g., texmf/scripts/chktex
8
## requires $(perl_scripts): e.g., deweb
9
## optional $(shell_scripts): e.g. htlatex
10
## appends to $(nodist_bin_SCRIPTS)
11
.PHONY: install-perl-links make-perl-links \
12
install-shell-links make-shell-links uninstall-links
14
all_scripts = $(perl_scripts) $(shell_scripts)
18
## We treat the WIN32 wrappers as SCRIPTS to avoid automatic build rules
19
wrappers = $(all_scripts:=.exe)
20
nodist_bin_SCRIPTS += $(wrappers)
21
runscript = $(top_srcdir)/../../texk/texlive/w32_wrapper/runscript.exe
22
$(wrappers): $(runscript)
23
$(LN_S) $(runscript) $@
27
# We support both multiplatform and non-multiplatform builds.
31
*/bin) $(MAKE) $(AM_MAKEFLAGS) REL=.. make-perl-links;; \
32
*/bin/*) $(MAKE) $(AM_MAKEFLAGS) REL=../.. make-perl-links;; \
33
*) echo "strange directory '$(bindir)' for linked scripts" >&2; \
41
*/bin) $(MAKE) $(AM_MAKEFLAGS) REL=.. make-shell-links;; \
42
*/bin/*) $(MAKE) $(AM_MAKEFLAGS) REL=../.. make-shell-links;; \
43
*) echo "strange directory '$(bindir)' for linked scripts" >&2; \
49
@cd $(DESTDIR)$(bindir) && \
50
for f in $(perl_scripts); do \
52
echo "creating link '$$f' -> '$(REL)/$(scriptsdir)/$$f.pl'"; \
53
$(LN_S) $(REL)/$(scriptsdir)/$$f.pl $$f || exit 1; \
57
@cd $(DESTDIR)$(bindir) && \
58
for f in $(shell_scripts); do \
60
echo "creating link '$$f' -> '$(REL)/$(scriptsdir)/$$f.sh'"; \
61
$(LN_S) $(REL)/$(scriptsdir)/$$f.sh $$f || exit 1; \
66
@for f in $(all_scripts); do \
67
echo "rm -f '$(DESTDIR)$(bindir)/$$f'"; \
68
rm -f "$(DESTDIR)$(bindir)/$$f"; \