summaryrefslogtreecommitdiff
path: root/Build/source/am/bin_links.am
blob: 2ff85d0cbe144bd611d32da01c6f19b03c4486c9 (plain)
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
## $Id$
# am/bin_links.am: Makefile fragment for bindir links.
#
# Copyright 2017-2020 Karl Berry <tex-live@tug.org>
# Copyright 2011-2013 Peter Breitenlohner <tex-live@tug.org>
# You may freely use, modify and/or distribute this file.
#
# requires conditional WIN32
# requires $(bin_links)
# Symlinks within $(bindir): FILE:LINK indicates LINK->FILE
#  for binaries and scripts use, e.g.,
#    binprog$(EXEEXT):foo
#    script:bar
#  respectively, such that the links created on cygwin are
#    'foo->binprog.exe' and 'bar->script'.

.PHONY: install-bin-links uninstall-bin-links

install-bin-links:
if !WIN32
	$(MKDIR_P) $(DESTDIR)$(bindir)
	@cd $(DESTDIR)$(bindir) && \
	  for s in $(bin_links); do \
	    link=`echo $$s | sed 's,.*:,,'`; \
	    file=`echo $$s | sed 's,:.*,,'`; \
	    rm -f $$link; \
	    echo "creating link '$$link' -> '$$file'"; \
	    $(LN_S) $$file $$link || exit 1; \
	  done
endif !WIN32

uninstall-bin-links:
if !WIN32
	@for s in $(bin_links); do \
	  link=`echo $$s | sed 's,.*:,,'`; \
	  rm -f $(DESTDIR)$(bindir)/$$link; \
	done
endif !WIN32