ZMK.SYMLINK(5)
π zmk.Symlink(5) π
okay bestie, sit down, hydrate, because we're about to talk about zmk.Symlink β and yes it's from the zmk manual, section 5, and yes it's that girl. local vibes only. π¦
β¨ NAME β¨
Symlink β the template that makes symbolic links happen. like, it's literally a template for creating symbolic links. that's the whole gig. π
πΈ SYNOPSIS πΈ
include z.mk
# "link" is any valid identifier.
link.SymlinkTarget = target
$(eval $(call ZMK.Expand,Symlink,link))
yes, it's that short. three lines and a dream. β¨ (and fr fr, link can be any valid identifier β go wild, name it whatever, just keep it valid, k?)
π DESCRIPTION π
so here's the tea: the Symlink template, once you expand it with a link name, creates rules for creating, removing, installing and removing a single symbolic link pointing at a given target file. four jobs, one template. she's versatile. π
and the way she behaves? exactly like the Program template β she builds the symbolic link locally while you're still developing, and she does it again when the project gets installed. both. always. no cap. π
β TARGETS β
this module comes with the following targets, and they are all iconic in their own way:
π $(link)
this target is the symbolic link. main character energy. that's her.
π§ all
this phony target depends on $(link). so like, she's in the group chat, she just doesn't do the work herself. π
π clean
this phony target removes $(link). poof. gone. not me being emotional about it. π
π install
this target creates the symbolic link $(link) in $(link.InstallDir), with the name $(link.InstallName). and the target directory? automatically created if required. she's thoughtful like that. β¨
π¦ uninstall
this phony target removes $(link) as installed by the install target. we love a clean exit. π«Ά
π VARIABLES π
and now the variables, aka the settings you gotta feed her:
$(link).SymlinkTarget
the target of the symbolic link. like, where it points. the whole point. π
there is no default value. this variable must be set before expanding the template. do not skip this, i'm begging. π
$(programName).InstallDir
the directory $(link) gets installed to. π
there is no default value. this variable must be set before expanding the template. and listen β if you want to avoid installation entirely, set the install directory to the special value noinst. that's the secret password. iykyk. π€«
$(link).InstallName
the name of the program after installation. (yes, "program", we said what we said.) π
the default value is $(link) with the directory part removed. so she cleans herself up for the install. slay.
DESTDIR
path added to all installation targets. π¦
this variable is normally set externally β the whole point is to install a compiled program into a staging area while you're constructing a compiled binary package. that's the vibe.
π BUGS π
okay so. history lesson, and it's a little messy. π«£
prior to version 0.5.1, the install target misbehaved when $(link) contains a non-empty directory prefix. incorrectly, the same prefix got replicated β somewhat confusingly β in the installed symlink. not her finest era, ngl.
consider this example:
include z.mk
subdir/link.SymlinkTarget = target
subdir/link.InstallDir = $(bindir)
$(eval $(call ZMK.Expand,Symlink,subdir/link))
running make install on that example would create the symbolic link $(bindir)/subdir/link -> target, which was unexpected. π³
this bug was given the identifier zmk-issue-80. put some respect on the issue number. π
β οΈ heads up bestie: this is a fixed bug from before 0.5.1 β but if you're on something ancient, that's the behaviour you're getting. now you know.
π°οΈ HISTORY π°οΈ
the Symlink template first appeared in zmk 0.1. an OG. a legend. the blueprint. π
π«Ά AUTHORS π«Ά
Zygmunt Krynicki <me@zygoon.pl>
and that's the whole page, bestie β this one shipped with zmk 0.5.1, dated Jun 21, 2021, and it's filed under section 5 of the manual (that's zmk.Symlink(5) if you're keeping receipts π
). go make some symlinks, and remember: set $(link).SymlinkTarget first. periodt. β¨ππ¦
π¦ where this page comes from
- debian bookworm: zmk-doc 0.5.1-2 Β· LGPL-3.0-only
- debian trixie: zmk-doc 0.5.1-2 Β· LGPL-3.0-only
- ubuntu jammy: zmk-doc 0.5.1-2 Β· LGPL-3.0-only
- ubuntu noble: zmk-doc 0.5.1-2 Β· LGPL-3.0-only
- ubuntu questing: zmk-doc 0.5.1-2
- ubuntu resolute: zmk-doc 0.5.1-2build1 Β· LGPL-3.0-only
- ubuntu stonking: zmk-doc 0.5.1-2build1 Β· LGPL-3.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms