Skip to content

Commit

Permalink
feat!: Remove cgo support for build (#11)
Browse files Browse the repository at this point in the history
* feat: Remove cgo support for build

This way the binaries dont have a dependency on glibc or musl

* docs: Remove gcc requirement in README
  • Loading branch information
timo-reymann authored May 17, 2023
1 parent 30c85f7 commit 4ec3c7a
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 17 deletions.
30 changes: 15 additions & 15 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,29 +24,29 @@ create-dist: ## Create dist folder if not already existent
@mkdir -p dist/

build-linux: create-dist ## Build binaries for linux
@GOOS=linux GOARCH=amd64 go build -o $(BIN_PREFIX)linux-amd64 $(BUILD_ARGS)
@GOOS=linux GOARCH=386 go build -o $(BIN_PREFIX)linux-i386 $(BUILD_ARGS)
@GOOS=linux GOARCH=arm go build -o $(BIN_PREFIX)linux-arm $(BUILD_ARGS)
@GOOS=linux GOARCH=arm64 go build -o $(BIN_PREFIX)linux-arm64 $(BUILD_ARGS)
@CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o $(BIN_PREFIX)linux-amd64 $(BUILD_ARGS)
@CGO_ENABLED=0 GOOS=linux GOARCH=386 go build -o $(BIN_PREFIX)linux-i386 $(BUILD_ARGS)
@CGO_ENABLED=0 GOOS=linux GOARCH=arm go build -o $(BIN_PREFIX)linux-arm $(BUILD_ARGS)
@CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -o $(BIN_PREFIX)linux-arm64 $(BUILD_ARGS)

build-windows: create-dist ## Build binaries for windows
@GOOS=windows GOARCH=amd64 go build -o $(BIN_PREFIX)windows-amd64.exe $(BUILD_ARGS)
@GOOS=windows GOARCH=386 go build -o $(BIN_PREFIX)windows-i386.exe $(BUILD_ARGS)
@GOOS=windows GOARCH=arm go build -o $(BIN_PREFIX)windows-arm.exe $(BUILD_ARGS)
@CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -o $(BIN_PREFIX)windows-amd64.exe $(BUILD_ARGS)
@CGO_ENABLED=0 GOOS=windows GOARCH=386 go build -o $(BIN_PREFIX)windows-i386.exe $(BUILD_ARGS)
@CGO_ENABLED=0 GOOS=windows GOARCH=arm go build -o $(BIN_PREFIX)windows-arm.exe $(BUILD_ARGS)

build-darwin: create-dist ## Build binaries for macOS
@GOOS=darwin GOARCH=amd64 go build -o $(BIN_PREFIX)darwin-amd64 $(BUILD_ARGS)
@GOOS=darwin GOARCH=arm64 go build -o $(BIN_PREFIX)darwin-arm64 $(BUILD_ARGS)
@CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -o $(BIN_PREFIX)darwin-amd64 $(BUILD_ARGS)
@CGO_ENABLED=0 GOOS=darwin GOARCH=arm64 go build -o $(BIN_PREFIX)darwin-arm64 $(BUILD_ARGS)

build-freebsd: create-dist ## Build binaries for FreeBSD
@GOOS=freebsd GOARCH=amd64 go build -o $(BIN_PREFIX)freebsd-amd64 $(BUILD_ARGS)
@GOOS=freebsd GOARCH=386 go build -o $(BIN_PREFIX)freebsd-i386 $(BUILD_ARGS)
@GOOS=freebsd GOARCH=arm64 go build -o $(BIN_PREFIX)freebsd-arm64 $(BUILD_ARGS)
@GOOS=freebsd GOARCH=arm go build -o $(BIN_PREFIX)freebsd-arm $(BUILD_ARGS)
@CGO_ENABLED=0 GOOS=freebsd GOARCH=amd64 go build -o $(BIN_PREFIX)freebsd-amd64 $(BUILD_ARGS)
@CGO_ENABLED=0 GOOS=freebsd GOARCH=386 go build -o $(BIN_PREFIX)freebsd-i386 $(BUILD_ARGS)
@CGO_ENABLED=0 GOOS=freebsd GOARCH=arm64 go build -o $(BIN_PREFIX)freebsd-arm64 $(BUILD_ARGS)
@CGO_ENABLED=0 GOOS=freebsd GOARCH=arm go build -o $(BIN_PREFIX)freebsd-arm $(BUILD_ARGS)

build-openbsd: create-dist ## Build binaries for OpenBSD
@GOOS=openbsd GOARCH=amd64 go build -o $(BIN_PREFIX)openbsd-amd64 $(BUILD_ARGS)
@GOOS=openbsd GOARCH=386 go build -o $(BIN_PREFIX)openbsd-i386 $(BUILD_ARGS)
@CGO_ENABLED=0 GOOS=openbsd GOARCH=amd64 go build -o $(BIN_PREFIX)openbsd-amd64 $(BUILD_ARGS)
@CGO_ENABLED=0 GOOS=openbsd GOARCH=386 go build -o $(BIN_PREFIX)openbsd-i386 $(BUILD_ARGS)

create-checksums: ## Create checksums for binaries
@find ./dist -type f -exec sh -c 'sha256sum {} | cut -d " " -f 1 > {}.sha256' {} \;
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,14 @@ go get -u github.com/timo-reymann/deterministic-zip

The following platforms are supported (and have prebuilt binaries):

- Linux (gcc)
- Linux
- 32-bit
- 64-bit
- ARM 64-bit
- ARM 32-bit
- Darwin
- 64-bit
- ARM (M1)
- ARM (M1/M2)
- Windows
- ARM
- 32-bit
Expand Down

0 comments on commit 4ec3c7a

Please sign in to comment.