fix(make): use proper dependency tracking for the build output

Declare the whole keyring data as well as the code as input dependency
for the build target. This way we can properly depend on the build
target for installation without forcing rebuilding on every invocation.

A rebuild will be triggered if either the keyring or the source code
creating the build output changes.

The directories are added to the source dependencies on purpose to
guarantee that changes like deleted files will result in a rebuild.

The mtime of the build directory is force updated on every run to allow
make to track the output artifacts mtime compared against the
dependencies.
This commit is contained in:
Levente Polyak
2021-11-26 23:40:11 +01:00
parent 0ceb6c743e
commit d0ea790c6a
3 changed files with 12 additions and 3 deletions

View File

@ -1089,6 +1089,7 @@ def build(
"""
target_dir.mkdir(parents=True, exist_ok=True)
target_dir.touch()
keyring: Path = target_dir / Path("archlinux.gpg")
export(working_dir=working_dir, keyring_root=keyring_root, output=keyring)