Updated Makefile to account for vendor/ in dist

The previous PR #890 introduced a `Defaults.mk` target for defining
default variables for future calls to `make`. This functionality was
already present in a different form, but this new "real" target had an
unintended side-effect of causing the target to be called automatically
at reference, even the optional reference `-include Defaults.mk`. This
is undesirable as it causes the generation of defaults even during a
`make clean`.

This commit resolves these issues and further refactors the Makefile,
building on the work in #890, but with additional understanding:

* Convert the `Defaults.mk` target to the "phony" `defaults` target,
  preventing automatic generation
* Refactor and split `clean` targets
* Update `cleanvendor` to reflect `OFFLINE_BUILD`, similar to the
  `vendor` target
* Move "tools" targets into `Tools.mk`
* Add `ARCH` to `Variables.mk` for architecture-specific actions

Signed-off-by: Jonathon Anderson <janderson@ciq.com>
This commit is contained in:
Jonathon Anderson
2023-08-22 11:51:15 -06:00
parent 575d0539d8
commit 1047032bae
9 changed files with 133 additions and 105 deletions

View File

@@ -16,7 +16,7 @@ Install Warewulf and dependencies
git clone https://github.com/hpcng/warewulf.git
cd warewulf
PREFIX=/usr SYSCONFDIR=/etc TFTPDIR=/srv/tftproot LOCALSTATEDIR=/var/lib make clean Defaults.mk
PREFIX=/usr SYSCONFDIR=/etc TFTPDIR=/srv/tftproot LOCALSTATEDIR=/var/lib make clean defaults
make all
sudo make install