Skip to content

Commit

Permalink
Merge pull request #92 from UpCloudLtd/fix/freebsd-build
Browse files Browse the repository at this point in the history
Fix: freebsd build
  • Loading branch information
moitias authored Jun 3, 2021
2 parents 5e58506 + 7210c40 commit 4d8041c
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
10 changes: 9 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ BIN_LINUX = $(CLI_BIN)-$(VERSION)-linux-amd64
BIN_DOCKERISED_LINUX = $(CLI_BIN)-$(VERSION)-dockerised-linux-amd64
BIN_DARWIN = $(CLI_BIN)-$(VERSION)-darwin-amd64
BIN_WINDOWS = $(CLI_BIN)-$(VERSION)-windows-amd64.exe
BIN_FREEBSD = $(CLI_BIN)-$(VERSION)-freebsd-amd64


V = 0
Expand All @@ -37,7 +38,7 @@ doc: $(BIN_DIR) ; $(info generating documentation…) @ ## Generate documentatio
$Q $(GO) run cmd/$(DOC_GEN)/main.go

.PHONY: build-all
build-all: build-linux build-darwin build-windows ## Build all targets
build-all: build-linux build-darwin build-windows build-freebsd ## Build all targets

.PHONY: build-linux
build-linux: ; $(info building executable for Linux x86_64…) @ ## Build program binary for linux x86_64
Expand All @@ -46,6 +47,13 @@ build-linux: ; $(info building executable for Linux x86_64…) @ ## Build progra
-ldflags '-X $(MODULE)/internal/config.Version=$(VERSION) -X $(MODULE)/internal/config.BuildDate=$(DATE)' \
-o $(BIN_DIR)/$(BIN_LINUX) cmd/$(CLI)/main.go

.PHONY: build-freebsd
build-freebsd: ; $(info building executable for FreeBSD x86_64…) @ ## Build program binary for freebsd x86_64
$Q GOOS=freebsd GOARCH=amd64 $(GO) build \
-tags release \
-ldflags '-X $(MODULE)/internal/config.Version=$(VERSION) -X $(MODULE)/internal/config.BuildDate=$(DATE)' \
-o $(BIN_DIR)/$(BIN_FREEBSD) cmd/$(CLI)/main.go

.PHONY: build-dockerised
build-dockerised: ; $(info building executable for dockerised Linux x86_64…) @ ## Build program binary for dockerised linux x86_64
$Q GOOS=linux GOARCH=amd64 CGO_ENABLED=0 $(GO) build \
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ build-all Build all targets
build-linux Build program binary for linux x86_64
build-darwin Build program binary for darwin x86_64
build-windows Build program binary for windows x86_64
build-freebsd Build program binary for freebsd x86_64
test Run tests
fmt Run gofmt on all source files
clean Cleanup everything
Expand Down
2 changes: 1 addition & 1 deletion internal/terminal/resizeevents.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// +build linux darwin
// +build linux darwin freebsd

package terminal

Expand Down

0 comments on commit 4d8041c

Please sign in to comment.