Makefile in vagrant-unbundled-2.3.3.0 vs Makefile in vagrant-unbundled-2.3.6.0
- old
+ new
@@ -8,34 +8,78 @@
CGO_ENABLED?=0
.PHONY: bin
bin: # bin creates the binaries for Vagrant for the current platform
@test -s "thirdparty/proto/api-common-protos/.git" || { echo "git submodules not initialized, run 'git submodule update --init --recursive' and try again"; exit 1; }
- CGO_ENABLED=$(CGO_ENABLED) go build -ldflags $(GOLDFLAGS) -gcflags="$(GCFLAGS)" -tags assetsembedded -o ./vagrant ./cmd/vagrant
+ CGO_ENABLED=$(CGO_ENABLED) go build -ldflags $(GOLDFLAGS) -gcflags="$(GCFLAGS)" -tags assetsembedded -o ./bin/vagrant-go ./cmd/vagrant
.PHONY: debug
debug: # debug creates an executable with optimizations off, suitable for debugger attachment
GCFLAGS="all=-N -l" $(MAKE) bin
+.PHONY: all
+all:
+ $(MAKE) bin/windows
+ $(MAKE) bin/linux
+ $(MAKE) bin/darwin
+
.PHONY: bin/windows
-bin/windows: # create windows binaries
- @test -s "thirdparty/proto/api-common-protos/.git" || { echo "git submodules not initialized, run 'git submodule update --init --recursive' and try again"; exit 1; }#
- GOOS=windows GOARCH=amd64 CGO_ENABLED=$(CGO_ENABLED) go build -ldflags $(GOLDFLAGS) -tags assetsembedded -o ./vagrant.exe ./cmd/vagrant
+bin/windows:
+ $(MAKE) bin/windows-amd64
+ $(MAKE) bin/windows-386
+.PHONY: bin/windows-amd64
+bin/windows-amd64: # create windows binaries
+ @test -s "thirdparty/proto/api-common-protos/.git" || { echo "git submodules not initialized, run 'git submodule update --init --recursive' and try again"; exit 1; }
+ GOOS=windows GOARCH=amd64 CGO_ENABLED=$(CGO_ENABLED) go build -ldflags $(GOLDFLAGS) -tags assetsembedded -o ./bin/vagrant-go_windows_amd64.exe ./cmd/vagrant
+
+.PHONY: bin/windows-386
+bin/windows-386: # create windows binaries
+ @test -s "thirdparty/proto/api-common-protos/.git" || { echo "git submodules not initialized, run 'git submodule update --init --recursive' and try again"; exit 1; }
+ GOOS=windows GOARCH=386 CGO_ENABLED=$(CGO_ENABLED) go build -ldflags $(GOLDFLAGS) -tags assetsembedded -o ./bin/vagrant-go_windows_386.exe ./cmd/vagrant
+
.PHONY: bin/linux
-bin/linux: # create Linux binaries
+bin/linux:
+ $(MAKE) bin/linux-amd64
+ $(MAKE) bin/linux-386
+
+.PHONY: bin/linux-amd64
+bin/linux-amd64: # create Linux binaries
@test -s "thirdparty/proto/api-common-protos/.git" || { echo "git submodules not initialized, run 'git submodule update --init --recursive' and try again"; exit 1; }
- GOOS=linux GOARCH=amd64 $(MAKE) bin
+ GOOS=linux GOARCH=amd64 CGO_ENABLED=$(CGO_ENABLED) go build -ldflags $(GOLDFLAGS) -gcflags="$(GCFLAGS)" -tags assetsembedded -o ./bin/vagrant-go_linux_amd64 ./cmd/vagrant
.PHONY: bin/linux-386
bin/linux-386: # create Linux binaries
@test -s "thirdparty/proto/api-common-protos/.git" || { echo "git submodules not initialized, run 'git submodule update --init --recursive' and try again"; exit 1; }
- GOOS=linux GOARCH=386 $(MAKE) bin
+ GOOS=linux GOARCH=386 CGO_ENABLED=$(CGO_ENABLED) go build -ldflags $(GOLDFLAGS) -gcflags="$(GCFLAGS)" -tags assetsembedded -o ./bin/vagrant-go_linux_386 ./cmd/vagrant
.PHONY: bin/darwin
-bin/darwin: # create Darwin binaries
+bin/darwin:
+ $(MAKE) bin/darwin-amd64
+ $(MAKE) bin/darwin-arm64
+ $(MAKE) bin/darwin-universal
+
+.PHONY: bin/darwin-amd64
+bin/darwin-amd64: # create Darwin binaries
@test -s "thirdparty/proto/api-common-protos/.git" || { echo "git submodules not initialized, run 'git submodule update --init --recursive' and try again"; exit 1; }
- GOOS=darwin GOARCH=amd64 $(MAKE) bin
+ GOOS=darwin GOARCH=amd64 CGO_ENABLED=$(CGO_ENABLED) go build -ldflags $(GOLDFLAGS) -gcflags="$(GCFLAGS)" -tags assetsembedded -o ./bin/vagrant-go_darwin_amd64 ./cmd/vagrant
+
+.PHONY: bin/darwin-arm64
+bin/darwin-arm64: # create Darwin binaries
+ @test -s "thirdparty/proto/api-common-protos/.git" || { echo "git submodules not initialized, run 'git submodule update --init --recursive' and try again"; exit 1; }
+ GOOS=darwin GOARCH=arm64 CGO_ENABLED=$(CGO_ENABLED) go build -ldflags $(GOLDFLAGS) -gcflags="$(GCFLAGS)" -tags assetsembedded -o ./bin/vagrant-go_darwin_arm64 ./cmd/vagrant
+
+.PHONY: bin/darwin-universal
+bin/darwin-universal:
+ @test -s "thirdparty/proto/api-common-protos/.git" || { echo "git submodules not initialized, run 'git submodule update --init --recursive' and try again"; exit 1; }
+ GOOS=darwin GOARCH=arm64 CGO_ENABLED=$(CGO_ENABLED) go build -ldflags $(GOLDFLAGS) -gcflags="$(GCFLAGS)" -tags assetsembedded -o ./bin/.vagrant-go_darwin_arm64 ./cmd/vagrant
+ GOOS=darwin GOARCH=amd64 CGO_ENABLED=$(CGO_ENABLED) go build -ldflags $(GOLDFLAGS) -gcflags="$(GCFLAGS)" -tags assetsembedded -o ./bin/.vagrant-go_darwin_amd64 ./cmd/vagrant
+ go run github.com/randall77/makefat ./bin/vagrant-go_darwin_universal ./bin/.vagrant-go_darwin_arm64 ./bin/.vagrant-go_darwin_amd64
+ rm -f ./bin/.vagrant-go_darwin*
+
+.PHONY: clean
+clean:
+ rm -f ./bin/vagrant-go* ./bin/.vagrant-go_darwin*
.PHONY: test
test: # run tests
go test ./...