Debian Codegraph @

am/bin_links.am

raw
1 ## $Id: bin_links.am 61576 2022-01-11 22:54:49Z karl $
2 ## am/bin_links.am: Makefile fragment for bindir links.
3 ##
4 ## Copyright 2017-2022 Karl Berry <[email protected]>
5 ## Copyright 2011-2013 Peter Breitenlohner <[email protected]>
6 ## You may freely use, modify and/or distribute this file.
7 ##
8 ## requires conditional WIN32
9 ## requires $(bin_links)
10 ## Symlinks within $(bindir): FILE:LINK indicates LINK->FILE
11 ## for binaries and scripts use, e.g.,
12 ## binprog$(EXEEXT):foo
13 ## script:bar
14 ## respectively, such that the links created on cygwin are
15 ## 'foo->binprog.exe' and 'bar->script'.
16
17 .PHONY: install-bin-links uninstall-bin-links
18
19 install-bin-links:
20 if !WIN32
21 $(MKDIR_P) $(DESTDIR)$(bindir)
22 @cd $(DESTDIR)$(bindir) && \
23 for s in $(bin_links); do \
24 link=`echo $$s | sed 's,.*:,,'`; \
25 file=`echo $$s | sed 's,:.*,,'`; \
26 rm -f $$link; \
27 echo "creating link '$$link' -> '$$file'"; \
28 $(LN_S) $$file $$link || exit 1; \
29 done
30 endif !WIN32
31
32 uninstall-bin-links:
33 if !WIN32
34 @for s in $(bin_links); do \
35 link=`echo $$s | sed 's,.*:,,'`; \
36 rm -f $(DESTDIR)$(bindir)/$$link; \
37 done
38 endif !WIN32
39
40 # (end of bin_links.am)