aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile5
-rwxr-xr-xscripts/build_linux64.sh2
2 files changed, 6 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index c321f82b..1a60b686 100644
--- a/Makefile
+++ b/Makefile
@@ -5,8 +5,13 @@ DATA_FILES := $(shell find conf | sed 's/ /\\ /g')
LESS_FILES := $(wildcard public/less/gogs.less public/less/_*.less)
GENERATED := modules/bindata/bindata.go public/css/gogs.css
+OS := $(shell uname)
+
TAGS = ""
BUILD_FLAGS = "-v"
+ifeq ($(OS),Linux)
+ BUILD_FLAGS += " -buildmode=pie"
+endif
RELEASE_ROOT = "release"
RELEASE_GOGS = "release/gogs"
diff --git a/scripts/build_linux64.sh b/scripts/build_linux64.sh
index 528fc54c..8b3a68c2 100755
--- a/scripts/build_linux64.sh
+++ b/scripts/build_linux64.sh
@@ -5,7 +5,7 @@ outPath=./output_$outPlattform_$outArch
rm -rf $outPath
mkdir $outPath
-CGO_ENABLED=0 GOOS=$outPlattform GOARCH=$outArch go build ../gogs.go
+CGO_ENABLED=0 GOOS=$outPlattform GOARCH=$outArch go build -buildmode=pie ../gogs.go
chmod +x gogs
mv gogs $outPath/