-
Notifications
You must be signed in to change notification settings - Fork 589
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor Makefile #2638
base: master
Are you sure you want to change the base?
Refactor Makefile #2638
Conversation
…stagents` targets refactored and added targets to build `lima-guestagent` for archs: - `guestagents` builds for archs enabled by `CONFIG_GUESTAGENT_ARCHS_*` - `native-guestagent` builds for native arch - `additional-guestagents` builds for archs other than native arch Signed-off-by: Norio Nomura <norio.nomura@gmail.com>
refactored and added targets: - `limactl` builds `limactl`, `codesign`, and `lima` - `lima` copy `lima`, and `lima$(bat)` - `helpers` copy `nerdctl.lima`, `apptainer.lima`, `docker.lima`, `podman.lima`, `kubectl.lima` Signed-off-by: Norio Nomura <norio.nomura@gmail.com>
…s`, and `create-examples-link` targets refactored and added targets: - `default_template` copy `examples/default.yaml` - `templates` copy `examples/*.yaml` - `template_experimentals` copy `examples/experimental/*.yaml` - `create-examples-link` create link at, or copy to `_output/share/lima/examples` Signed-off-by: Norio Nomura <norio.nomura@gmail.com>
- `documents` copy `*.md`, `LICENSE`, `SECURITY.md`, and `VERSION` - `create-links-in-documents` create link at, or copy to `_output/share/doc/lima/{templates,examples}` Signed-off-by: Norio Nomura <norio.nomura@gmail.com>
also changed `artifacts-misc` to depends `_artifacts` Signed-off-by: Norio Nomura <norio.nomura@gmail.com>
Signed-off-by: Norio Nomura <norio.nomura@gmail.com>
Signed-off-by: Norio Nomura <norio.nomura@gmail.com>
Signed-off-by: Norio Nomura <norio.nomura@gmail.com>
It seems that variable expansion in Makefile targets is not done recursively. Signed-off-by: Norio Nomura <norio.nomura@gmail.com>
Signed-off-by: Norio Nomura <norio.nomura@gmail.com>
fe8db81
to
0df11ac
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not just use plain cp?
By having ➜ ~09:57:10 09:57:15~ (refactor-makefile) make templates
mkdir -p _output/share/lima/templates
cp -aL examples/README.md _output/share/lima/templates/README.md
cp -aL examples/almalinux-8.yaml _output/share/lima/templates/almalinux-8.yaml
cp -aL examples/almalinux-9.yaml _output/share/lima/templates/almalinux-9.yaml
cp -aL examples/almalinux.yaml _output/share/lima/templates/almalinux.yaml
cp -aL examples/alpine-image.yaml _output/share/lima/templates/alpine-image.yaml
cp -aL examples/alpine.yaml _output/share/lima/templates/alpine.yaml
cp -aL examples/apptainer-rootful.yaml _output/share/lima/templates/apptainer-rootful.yaml
cp -aL examples/apptainer.yaml _output/share/lima/templates/apptainer.yaml
cp -aL examples/archlinux.yaml _output/share/lima/templates/archlinux.yaml
cp -aL examples/buildkit.yaml _output/share/lima/templates/buildkit.yaml
cp -aL examples/centos-stream-9.yaml _output/share/lima/templates/centos-stream-9.yaml
cp -aL examples/centos-stream.yaml _output/share/lima/templates/centos-stream.yaml
cp -aL examples/debian-11.yaml _output/share/lima/templates/debian-11.yaml
cp -aL examples/debian-12.yaml _output/share/lima/templates/debian-12.yaml
cp -aL examples/debian.yaml _output/share/lima/templates/debian.yaml
cp -aL examples/default.yaml _output/share/lima/templates/default.yaml
cp -aL examples/docker-rootful.yaml _output/share/lima/templates/docker-rootful.yaml
cp -aL examples/docker.yaml _output/share/lima/templates/docker.yaml
cp -aL examples/faasd.yaml _output/share/lima/templates/faasd.yaml
cp -aL examples/fedora.yaml _output/share/lima/templates/fedora.yaml
cp -aL examples/k3s.yaml _output/share/lima/templates/k3s.yaml
cp -aL examples/k8s.yaml _output/share/lima/templates/k8s.yaml
cp -aL examples/opensuse-leap.yaml _output/share/lima/templates/opensuse-leap.yaml
cp -aL examples/opensuse.yaml _output/share/lima/templates/opensuse.yaml
cp -aL examples/oraclelinux-8.yaml _output/share/lima/templates/oraclelinux-8.yaml
cp -aL examples/oraclelinux-9.yaml _output/share/lima/templates/oraclelinux-9.yaml
cp -aL examples/oraclelinux.yaml _output/share/lima/templates/oraclelinux.yaml
cp -aL examples/podman-rootful.yaml _output/share/lima/templates/podman-rootful.yaml
cp -aL examples/podman.yaml _output/share/lima/templates/podman.yaml
cp -aL examples/rocky-8.yaml _output/share/lima/templates/rocky-8.yaml
cp -aL examples/rocky-9.yaml _output/share/lima/templates/rocky-9.yaml
cp -aL examples/rocky.yaml _output/share/lima/templates/rocky.yaml
cp -aL examples/ubuntu-lts.yaml _output/share/lima/templates/ubuntu-lts.yaml
cp -aL examples/ubuntu.yaml _output/share/lima/templates/ubuntu.yaml
cp -aL examples/vmnet.yaml _output/share/lima/templates/vmnet.yaml
➜ ~09:57:15 09:57:18~ (refactor-makefile) limactl edit templates/docker.yaml --memory 8
➜ ~09:57:18 09:57:20~ (refactor-makefile) make templates
cp -aL examples/docker.yaml _output/share/lima/templates/docker.yaml
➜ ~09:57:20 09:57:20~ (refactor-makefile) |
…evious Signed-off-by: Norio Nomura <norio.nomura@gmail.com>
49aa7f9
to
1efc42e
Compare
``` - <arch>-guestagent : Build guestagent for <arch>: aarch64 armv7l riscv64 x86_64 ``` Signed-off-by: Norio Nomura <norio.nomura@gmail.com>
Sorry, I added ➜ ~10:56:10 13:20:12~ (refactor-makefile) make armv7l-guestagent
GOOS=linux GOARCH=arm GOARM=7 CGO_ENABLED=0 go build -ldflags="-s -w -X github.com/lima-vm/lima/pkg/version.Version=v1.0.0-alpha.0-95-g1efc42e1.m" -tags "" -o _output/share/lima/lima-guestagent.Linux-armv7l ./cmd/lima-guestagent
chmod 644 _output/share/lima/lima-guestagent.Linux-armv7l |
The |
refactored and added targets:
guestagents
buildslima-guestagent
for archs enabled byCONFIG_GUESTAGENT_ARCHS_*
native-guestagent
buildslima-guestagent
for native archadditional-guestagents
buildslima-guestagent
for archs other than native arch<arch>-guestagent
buildslima-guestagent
for : aarch64 armv7l riscv64 x86_64limactl
buildslimactl
,codesign
, andlima
lima
copylima
, andlima$(bat)
helpers
copynerdctl.lima
,apptainer.lima
,docker.lima
,podman.lima
,kubectl.lima
default_template
copyexamples/default.yaml
templates
copyexamples/*.yaml
template_experimentals
copyexamples/experimental/*.yaml
create-examples-link
create link at, or copy to_output/share/lima/examples
documents
copy*.md
,LICENSE
,SECURITY.md
, andVERSION
create-links-in-documents
create link at, or copy to_output/share/doc/lima/{templates,examples}
With this change, running
make clean limactl native-guestagent templates install
will allow you to installlimactl
, the nativelinux-guestagent
, and all templates.This is my solution to #2426 (comment)
EDIT: added
<arch>-guestagent
targets