forked from fatedier/frp
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
61 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,6 +25,7 @@ _testmain.go | |
|
||
# Self | ||
bin/ | ||
packages/ | ||
|
||
# Cache | ||
*.swp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
export PATH := $(GOPATH)/bin:$(PATH) | ||
export OLDGOPATH := $(GOPATH) | ||
export GOPATH := $(shell pwd)/Godeps/_workspace:$(shell pwd):$(GOPATH) | ||
export OS_TARGETS=linux windows | ||
export ARCH_TARGETS=386 amd64 | ||
|
||
all: build | ||
|
||
build: godep app | ||
|
||
godep: | ||
GOPATH=$(OLDGOPATH) go get github.com/mitchellh/gox | ||
|
||
app: | ||
gox -os "$(OS_TARGETS)" -arch="$(ARCH_TARGETS)" ./... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# compile for version | ||
make | ||
if [ $? -ne 0 ]; then | ||
echo "make error" | ||
exit 1 | ||
fi | ||
|
||
frp_version=`./bin/frps --version` | ||
echo "build version: $frp_version" | ||
|
||
# cross_compiles | ||
make -f ./Makefile.cross-compiles | ||
|
||
rm -rf ./packages | ||
mkdir ./packages | ||
|
||
os_all='linux windows' | ||
arch_all='386 amd64' | ||
|
||
for os in $os_all; do | ||
for arch in $arch_all; do | ||
frp_dir_name="frp_${frp_version}_${os}_${arch}" | ||
frp_path="./packages/frp_${frp_version}_${os}_${arch}" | ||
mkdir ${frp_path} | ||
if [ "x${os}" = x"windows" ]; then | ||
mv ./frpc_${os}_${arch}.exe ${frp_path}/frpc.exe | ||
mv ./frps_${os}_${arch}.exe ${frp_path}/frps.exe | ||
else | ||
mv ./frpc_${os}_${arch} ${frp_path}/frpc | ||
mv ./frps_${os}_${arch} ${frp_path}/frps | ||
fi | ||
cp ./LICENSE ${frp_path} | ||
cp ./conf/* ${frp_path} | ||
|
||
# packages | ||
cd ./packages | ||
if [ "x${os}" = x"windows" ]; then | ||
zip -rq ${frp_dir_name}.zip ${frp_dir_name} | ||
else | ||
tar -zcf ${frp_dir_name}.tar.gz ${frp_dir_name} | ||
fi | ||
cd .. | ||
rm -rf ${frp_path} | ||
done | ||
done |