Skip to content

Commit

Permalink
Makefile: use bash
Browse files Browse the repository at this point in the history
This fixes `make xbuild` on my Debian system
  • Loading branch information
cristoper committed Oct 20, 2023
1 parent 57f4d57 commit 6b55fb0
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
version := v0.1.0
version := v0.1.1
platforms := linux_386 linux_amd64 darwin_amd64 windows_386 windows_amd64
SHELL := /bin/bash

# Requires gnu make 3.82+
# (On macos use brew install make and execute as 'gmake')
.ONESHELL:
.PHONY: build
build:
go build -o gsheet ./cmd/gsheet/
Expand All @@ -14,8 +12,8 @@ test:

.PHONY: xbuild
xbuild:
for platform in ${platforms}; do
pair=($${platform/_/ })
GOARCH=$${pair[1]} GOOS=$${pair[0]} go build -ldflags '-s -w -X main.version=${version}' -o build/$$platform/gsheet ./cmd/gsheet/
zip -j -r build/$${platform}.zip build/$${platform}/
for platform in ${platforms}; do \
pair=($${platform/_/ }) ;\
GOARCH=$${pair[1]} GOOS=$${pair[0]} go build -ldflags '-s -w -X main.version=${version}' -o build/$$platform/gsheet ./cmd/gsheet/ ;\
zip -j -r build/$${platform}.zip build/$${platform}/ ;\
done

0 comments on commit 6b55fb0

Please sign in to comment.