问题
How do I clean my build artifacts with Tup?
My project generates a lot of artifacts that I would like to have cleaned up. Tup doesn't seem to have a way to do it, and git reset --hard HEAD
, even after a git add -Af
, doesn't work.
回答1:
Just for completeness, you can keep things clean with variants.
touch default.config # An empty config file is ok
tup variant default
tup
Build files will go in the directory ./build-default
.
If you do the above in an active tup project, tup will remove all the in-situ build files and move them to the build directory for you.
There is nothing special about the tup variant
command. It just provides a little automation. The following would acheive the same:
touch default.config
mkdir build-default
ln -s default.config build-default/tup.config
tup
回答2:
Tup does not have a clean function like Makefiles can define.
If you're using a Git repository, you can git-clean your repository.
$ git add -A
$ git reset --hard HEAD
$ git clean -dffx
If you're working on some changes and need to clean away all of the stuff without killing your changes, use:
$ git clean -Xf
来源:https://stackoverflow.com/questions/28886876/cleaning-with-tup