From 93d5de7423309d3c4f6c611e0fe2c8cb92d61d45 Mon Sep 17 00:00:00 2001 From: Robert Gogolok Date: Thu, 16 Jan 2025 10:43:15 +0100 Subject: [PATCH] Makefile: Use new build approach for darwin amd64+arm64 Signed-off-by: Robert Gogolok --- Makefile | 29 +---------------------------- launcher.mk | 6 ------ lifecycle.mk | 13 ------------- 3 files changed, 1 insertion(+), 47 deletions(-) delete mode 100644 launcher.mk delete mode 100644 lifecycle.mk diff --git a/Makefile b/Makefile index 21ba6a114..d31e93327 100644 --- a/Makefile +++ b/Makefile @@ -38,7 +38,7 @@ GOFILES := $(shell $(GOCMD) run tools$/lister$/main.go) all: test build package -GOOS_ARCHS = linux/amd64 linux/arm64 linux/ppc64le linux/s390x +GOOS_ARCHS = linux/amd64 linux/arm64 linux/ppc64le linux/s390x darwin/amd64 darwin/arm64 build: build-linux-amd64 build-linux-arm64 build-linux-ppc64le build-linux-s390x @@ -105,33 +105,6 @@ endef $(foreach ga,$(GOOS_ARCHS),$(eval $(call build_targets,$(word 1, $(subst /, ,$(ga))),$(word 2, $(subst /, ,$(ga)))))) -## DARWIN ARM64/AMD64 -include lifecycle.mk -include launcher.mk -build-darwin-arm64: build-darwin-arm64-lifecycle build-darwin-arm64-launcher -build-darwin-arm64-lifecycle: - $(eval GOARCH := arm64) - $(eval TARGET := darwin-arm64) - $(eval OUT_DIR := $(BUILD_DIR)/$(TARGET)/lifecycle) - $(call build_lifecycle) -build-darwin-arm64-launcher: - $(eval GOARCH := arm64) - $(eval TARGET := darwin-arm64) - $(eval OUT_DIR := $(BUILD_DIR)/$(TARGET)/lifecycle) - $(call build_launcher) - -build-darwin-amd64: build-darwin-amd64-lifecycle build-darwin-amd64-launcher -build-darwin-amd64-lifecycle: - $(eval GOARCH := amd64) - $(eval TARGET := darwin-amd64) - $(eval OUT_DIR := $(BUILD_DIR)/$(TARGET)/lifecycle) - $(call build_lifecycle) -build-darwin-amd64-launcher: - $(eval GOARCH := amd64) - $(eval TARGET := darwin-amd64) - $(eval OUT_DIR := $(BUILD_DIR)/$(TARGET)/lifecycle) - $(call build_launcher) - generate-sbom: run-syft-linux-amd64 run-syft-linux-arm64 run-syft-linux-ppc64le run-syft-linux-s390x run-syft-linux-amd64: install-syft diff --git a/launcher.mk b/launcher.mk deleted file mode 100644 index 62bcb2423..000000000 --- a/launcher.mk +++ /dev/null @@ -1,6 +0,0 @@ -define build_launcher - @echo "> Building launcher for $(TARGET)..." - mkdir -p $(OUT_DIR) - $(GOENV) $(GOBUILD) -o $(OUT_DIR)/launcher -a ./cmd/launcher - test $$(du -m $(OUT_DIR)/launcher | cut -f 1) -le 4 -endef \ No newline at end of file diff --git a/lifecycle.mk b/lifecycle.mk deleted file mode 100644 index b17854444..000000000 --- a/lifecycle.mk +++ /dev/null @@ -1,13 +0,0 @@ -define build_lifecycle - @echo "> Building lifecycle for $(TARGET)..." - $(GOENV) $(GOBUILD) -o $(OUT_DIR)/lifecycle -a ./cmd/lifecycle - @echo "> Creating lifecycle symlinks for $(1)..." - ln -sf lifecycle $(OUT_DIR)/detector - ln -sf lifecycle $(OUT_DIR)/analyzer - ln -sf lifecycle $(OUT_DIR)/restorer - ln -sf lifecycle $(OUT_DIR)/builder - ln -sf lifecycle $(OUT_DIR)/exporter - ln -sf lifecycle $(OUT_DIR)/rebaser - ln -sf lifecycle $(OUT_DIR)/creator - ln -sf lifecycle $(OUT_DIR)/extender -endef