build: support linux/arm and darwin

This commit is contained in:
fatedier 2016-05-15 13:30:14 +08:00
parent 040841db48
commit d3c4401473
2 changed files with 18 additions and 6 deletions

View File

@ -1,8 +1,6 @@
export PATH := $(GOPATH)/bin:$(PATH) export PATH := $(GOPATH)/bin:$(PATH)
export OLDGOPATH := $(GOPATH) export OLDGOPATH := $(GOPATH)
export GOPATH := $(shell pwd)/Godeps/_workspace:$(shell pwd):$(GOPATH) export GOPATH := $(shell pwd)/Godeps/_workspace:$(shell pwd):$(GOPATH)
export OS_TARGETS=linux windows
export ARCH_TARGETS=386 amd64
all: build all: build
@ -12,4 +10,4 @@ godep:
GOPATH=$(OLDGOPATH) go get github.com/mitchellh/gox GOPATH=$(OLDGOPATH) go get github.com/mitchellh/gox
app: app:
gox -os "$(OS_TARGETS)" -arch="$(ARCH_TARGETS)" ./... gox -osarch "darwin/386 darwin/amd64 linux/386 linux/amd64 linux/arm windows/386 windows/amd64" ./...

View File

@ -14,18 +14,32 @@ make -f ./Makefile.cross-compiles
rm -rf ./packages rm -rf ./packages
mkdir ./packages mkdir ./packages
os_all='linux windows' os_all='linux windows darwin'
arch_all='386 amd64' arch_all='386 amd64 arm'
for os in $os_all; do for os in $os_all; do
for arch in $arch_all; do for arch in $arch_all; do
frp_dir_name="frp_${frp_version}_${os}_${arch}" frp_dir_name="frp_${frp_version}_${os}_${arch}"
frp_path="./packages/frp_${frp_version}_${os}_${arch}" frp_path="./packages/frp_${frp_version}_${os}_${arch}"
mkdir ${frp_path}
if [ "x${os}" = x"windows" ]; then if [ "x${os}" = x"windows" ]; then
if [ ! -f "./frpc_${os}_${arch}.exe" ]; then
continue
fi
if [ ! -f "./frps_${os}_${arch}.exe" ]; then
continue
fi
mkdir ${frp_path}
mv ./frpc_${os}_${arch}.exe ${frp_path}/frpc.exe mv ./frpc_${os}_${arch}.exe ${frp_path}/frpc.exe
mv ./frps_${os}_${arch}.exe ${frp_path}/frps.exe mv ./frps_${os}_${arch}.exe ${frp_path}/frps.exe
else else
if [ ! -f "./frpc_${os}_${arch}" ]; then
continue
fi
if [ ! -f "./frps_${os}_${arch}" ]; then
continue
fi
mkdir ${frp_path}
mv ./frpc_${os}_${arch} ${frp_path}/frpc mv ./frpc_${os}_${arch} ${frp_path}/frpc
mv ./frps_${os}_${arch} ${frp_path}/frps mv ./frps_${os}_${arch} ${frp_path}/frps
fi fi