summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authortechknowlogick <techknowlogick@gitea.io>2023-01-18 22:06:17 -0500
committerGitHub <noreply@github.com>2023-01-18 22:06:17 -0500
commit4b3e456afac053986eddc9a3c16ce24207fc00d7 (patch)
treed8e5ee100128f535ca0499bafeeba60b6183c6d9 /Makefile
parent63e5db5d7a09bc3a223c551f921e3401366fd1f8 (diff)
downloadgitea-4b3e456afac053986eddc9a3c16ce24207fc00d7.tar.gz
gitea-4b3e456afac053986eddc9a3c16ce24207fc00d7.zip
cgo cross-compile for freebsd (#22397) (#22519)
Provide pre-compiled cgo binaries for freebsd Co-authored-by: John Olheiser <john.olheiser@gmail.com>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile9
1 files changed, 8 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index 94979af243..20510bbec6 100644
--- a/Makefile
+++ b/Makefile
@@ -733,7 +733,7 @@ $(EXECUTABLE): $(GO_SOURCES) $(TAGS_PREREQ)
CGO_CFLAGS="$(CGO_CFLAGS)" $(GO) build $(GOFLAGS) $(EXTRA_GOFLAGS) -tags '$(TAGS)' -ldflags '-s -w $(LDFLAGS)' -o $@
.PHONY: release
-release: frontend generate release-windows release-linux release-darwin release-copy release-compress vendor release-sources release-docs release-check
+release: frontend generate release-windows release-linux release-darwin release-freebsd release-copy release-compress vendor release-sources release-docs release-check
$(DIST_DIRS):
mkdir -p $(DIST_DIRS)
@@ -762,6 +762,13 @@ ifeq ($(CI),true)
cp /build/* $(DIST)/binaries
endif
+.PHONY: release-freebsd
+release-freebsd: | $(DIST_DIRS)
+ CGO_CFLAGS="$(CGO_CFLAGS)" $(GO) run $(XGO_PACKAGE) -go $(XGO_VERSION) -dest $(DIST)/binaries -tags 'netgo osusergo $(TAGS)' -ldflags '$(LDFLAGS)' -targets 'freebsd/amd64' -out gitea-$(VERSION) .
+ifeq ($(CI),true)
+ cp /build/* $(DIST)/binaries
+endif
+
.PHONY: release-copy
release-copy: | $(DIST_DIRS)
cd $(DIST); for file in `find . -type f -name "*"`; do cp $${file} ./release/; done;