Contrary to #945, marking vendor as phony causes binaries to be re-built
on a repeated call to `make`. Though we can't determine when vendor
needs to be rebuilt, this is preferable to not knowing when Warewulf
binaries need to be rebuilt.
Signed-off-by: Jonathon Anderson <janderson@ciq.com>
The vendor target can't reliably determine when it needs to run, so mark
it phony. At the same time, update go.mod.
Signed-off-by: Jonathon Anderson <janderson@ciq.com>
Rather than implementing OFFLINE_BUILD individually within each relevant
target, define all such target dependencies once.
Signed-off-by: Jonathon Anderson <janderson@ciq.com>
This allows `make` and `make all` to avoid unnecessary repeat builds,
and saves automatic generation of man pages for `install`.
Signed-off-by: Jonathon Anderson <janderson@ciq.com>
Using a `config` variable in target dependencies allows the underlying
targets to be referenced properly, rather than passing through a "phony"
`config` target. This allows dependent targets to not have to re-run if
their dependencies have remained static, as expected.
Signed-off-by: Jonathon Anderson <janderson@ciq.com>
The `all` target should be the default for make; but placing it after
the `include` directives allowed the targets within the included files
to take precedence.
Moving `all` before the `include` directives restores it to default
status.
I also used this opportunity to restore the `build` target as the
defining target, and then just set up a dependency between `all` and
`build`.
Signed-off-by: Jonathon Anderson <janderson@ciq.com>
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>
Makefile has included a Defaults.mk file to store variable configuration
from one run for implicit inclusion in future runs, but the creation of
this file has been automatic and opaque, and the state of it managed by
a series of PHONY targets (e.g., config, genconfig, rm_config). This
commit refactors config to name its files explicitly (so they can be
more properly monitored by make) and makes the generation of Defaults.mk
explicit so that its behavior is more obvious.
Signed-off-by: Jonathon Anderson <janderson@ciq.com>
Several of the targets in Makefile don't create a file of their name,
and PHONY identifies these targets to make. Alongside, several comments
in Makefile don't provide additional details beyond what is
self-documented by the command or target name itself.
Signed-off-by: Jonathon Anderson <janderson@ciq.com>
- Updated the linter from 1.50 to 1.53.2 because the previous version
was falling over (likely OOM).
- Updated protoc build command for newer version of protobuf.
The make command below should work now:
```shell
make clean setup proto all build wwapid wwapic wwapird ; echo $?
```
Signed-off-by: MatthewHink <matthew_hink@ciq.com>
Also refactor New and Get to return pointers to match BaseConf methods.
This makes calling the methods immediately on the return values of the
constructors easier.
Also move config.ConfigFile to buildconfig.go.in. ConfigFile is still
used by wwctl as a default config file to reference; but it is removed
from other locations now.
Removed Persist, as nothing called it.
Signed-off-by: Jonathon Anderson <janderson@ciq.co>