1zmk.Symlink(5) Programmer's Manual zmk.Symlink(5)
2
4 Symlink — template for creating symbolic links
5
7 include z.mk
8 # "link" is any valid identifier.
9 link.SymlinkTarget = target
10 $(eval $(call ZMK.Expand,Symlink,link))
11
13 The template Symlink once expanded with a link name to creates rules for
14 creating, removing, installing and removing a single symbolic link to a
15 given target file.
16
17 This template behaves like the Program template, in that it creates the
18 symbolic link both locally, during development as well as when the
19 project is installed.
20
22 This module provides the following targets.
23
24 $(link)
25 This target represents the symbolic link
26
27 all
28 This phony target depends on $(link)
29
30 clean
31 This phony target removes $(link)
32
33 install
34 This target creates the symbolic link $(link) in $(link.InstallDir), with
35 the name $(link.InstallName) The target directory is automatically cre‐
36 ated if required.
37
38 uninstall
39 This phony target removes $(link) as installed by the install target.
40
42 This module provides the following variables.
43
44 $(link).SymlinkTarget
45 The target of the symbolic link.
46
47 There is no default value. This variable must be set before expanding the
48 template.
49
50 $(programName).InstallDir
51 The directory $(link) is installed to.
52
53 There is no default value. This variable must be set before expanding the
54 template. To avoid installation set the install directory to the special
55 value noinst.
56
57 $(link).InstallName
58 The name of the program after installation.
59
60 The default value is $(link) with the directory part removed.
61
62 DESTDIR
63 Path added to all installation targets.
64
65 This variable is normally set externally, to install a compiled program
66 into a staging area during construction of a compiled binary package.
67
69 Prior to version 0.5.1, the install target misbehaved when $(link) con‐
70 tains a non-empty directory prefix. Incorrectly, the same prefix is
71 replicated, somewhat confusingly in the installed symlink.
72
73 Consider this example:
74
75 include z.mk
76 subdir/link.SymlinkTarget = target
77 subdir/link.InstallDir = $(bindir)
78 $(eval $(call ZMK.Expand,Symlink,subdir/link))
79 Running make install on the following example would create the symbolic
80 link $(bindir)/subdir/link -> target, which was unexpected.
81
82 This bug was given the identifier zmk-issue-80.
83
85 The Symlink template first appeared in zmk 0.1
86
88 Zygmunt Krynicki <me@zygoon.pl>
89
90zmk 0.5.1 Jun 21, 2021 zmk 0.5.1