带有命名目标的 Tup
Tup with named targets
我刚从 make 切换到 tup,我似乎不明白如何制作命名目标..
Makefile 允许定义多个目标,例如 make clean、make foo、
等等
然而,tup 似乎只接受变量开关,而不是真正的目标...
有办法解决这个问题吗?
答案就在 tup 的变体设置中。
例如 clean
目标近似于(来自 ):
# Build files in build-default
touch default.config # An empty config file is ok
tup variant default
tup
实际上,这是 the manual 中描述的变体的用例。
$ ls configs/
bar.config
foo.config
$ tup variant configs/*.config
tup: Added variant 'build-bar' using config file 'configs/bar.config'
tup: Added variant 'build-foo' using config file 'configs/foo.config'
For projects that commonly use several variants, the files in the configs/ directory could be checked in to source control. Each developer would run the 'tup variant' after 'tup init' during the initial checkout of the software. Variants can also be created manually by making a build directory and creating a tup.config file in it (see the VARIANTS section). This command merely helps save some steps, so that you don't have to make each build directory and tup.config symlink manually.
但是,tup
不再用作正确的更新命令,因为它将更新所有变体。
而是像这样定位他们:
tup build-default
我刚从 make 切换到 tup,我似乎不明白如何制作命名目标..
Makefile 允许定义多个目标,例如 make clean、make foo、 等等
然而,tup 似乎只接受变量开关,而不是真正的目标...
有办法解决这个问题吗?
答案就在 tup 的变体设置中。
例如 clean
目标近似于(来自
# Build files in build-default
touch default.config # An empty config file is ok
tup variant default
tup
实际上,这是 the manual 中描述的变体的用例。
$ ls configs/
bar.config
foo.config
$ tup variant configs/*.config
tup: Added variant 'build-bar' using config file 'configs/bar.config'
tup: Added variant 'build-foo' using config file 'configs/foo.config'
For projects that commonly use several variants, the files in the configs/ directory could be checked in to source control. Each developer would run the 'tup variant' after 'tup init' during the initial checkout of the software. Variants can also be created manually by making a build directory and creating a tup.config file in it (see the VARIANTS section). This command merely helps save some steps, so that you don't have to make each build directory and tup.config symlink manually.
但是,tup
不再用作正确的更新命令,因为它将更新所有变体。
而是像这样定位他们:
tup build-default