Makefile 603 B

123456789101112131415161718192021
  1. TARGET_PLATFORMS=amd64 aarch64
  2. ALL_IMAGES=$(addprefix image-,$(TARGET_PLATFORMS))
  3. TARGET_TRIPLE_aarch64=aarch64-unknown-linux-musl
  4. TARGET_TRIPLE_amd64=x86_64-unknown-linux-musl
  5. CONTAINER_ARCH_aarch64=--arch arm64 --variant v8
  6. CONTAINER_ARCH_amd64=--arch amd64
  7. .PHONY: help images
  8. help:
  9. @echo "Available targets:"
  10. @echo " help"
  11. @echo " images"
  12. @echo " $(ALL_IMAGES)"
  13. images: $(ALL_IMAGES)
  14. image-%:
  15. cargo build --release --target $(TARGET_TRIPLE_$(*))
  16. podman build $(CONTAINER_ARCH_$(*)) -f Containerfile -t uidc:latest-$* --build-arg=TARGET_PATH=target/$(TARGET_TRIPLE_$(*))/release/