Skip to content
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

Add support for darwin-arm64 chipset #1169

Merged
merged 6 commits into from
Aug 18, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,35 @@ $(BUILD_DIR)/darwin-amd64/lifecycle/launcher:
$(GOENV) $(GOBUILD) -o $(OUT_DIR)/launcher -a ./cmd/launcher
test $$(du -m $(OUT_DIR)/launcher|cut -f 1) -le 4

build-darwin-arm64: build-darwin-arm64-lifecycle build-darwin-arm64-launcher

build-darwin-arm64-lifecycle: $(BUILD_DIR)/darwin-arm64/lifecycle/lifecycle
$(BUILD_DIR)/darwin-arm64/lifecycle/lifecycle: export GOOS:=darwin
$(BUILD_DIR)/darwin-arm64/lifecycle/lifecycle: export GOARCH:=arm64
$(BUILD_DIR)/darwin-arm64/lifecycle/lifecycle: OUT_DIR:=$(BUILD_DIR)/$(GOOS)-$(GOARCH)/lifecycle
$(BUILD_DIR)/darwin-arm64/lifecycle/lifecycle: $(GOFILES)
$(BUILD_DIR)/darwin-arm64/lifecycle/lifecycle:
@echo "> Building lifecycle for darwin/arm64..."
$(GOENV) $(GOBUILD) -o $(OUT_DIR)/lifecycle -a ./cmd/lifecycle
@echo "> Creating lifecycle symlinks for darwin/arm64..."
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

build-darwin-arm64-launcher: $(BUILD_DIR)/darwin-arm64/lifecycle/launcher
$(BUILD_DIR)/darwin-arm64/lifecycle/launcher: export GOOS:=darwin
$(BUILD_DIR)/darwin-arm64/lifecycle/launcher: export GOARCH:=arm64
$(BUILD_DIR)/darwin-arm64/lifecycle/launcher: OUT_DIR:=$(BUILD_DIR)/$(GOOS)-$(GOARCH)/lifecycle
$(BUILD_DIR)/darwin-arm64/lifecycle/launcher: $(GOFILES)
$(BUILD_DIR)/darwin-arm64/lifecycle/launcher:
@echo "> Building launcher for darwin/arm64..."
mkdir -p $(OUT_DIR)
$(GOENV) $(GOBUILD) -o $(OUT_DIR)/launcher -a ./cmd/launcher
test $$(du -m $(OUT_DIR)/launcher|cut -f 1) -le 4

generate-sbom: run-syft-windows run-syft-linux-amd64 run-syft-linux-arm64

run-syft-windows: install-syft
Expand Down