Skip to content
This repository has been archived by the owner on Jan 12, 2024. It is now read-only.

Commit

Permalink
add muti os bin for cross-platform
Browse files Browse the repository at this point in the history
  • Loading branch information
tkjnz committed Jun 14, 2017
1 parent 5a29044 commit 5201e45
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 5 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
dtunnel
dtunnel_s
/bin/
41 changes: 36 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,20 +1,51 @@

all:
all:
@make release
release:
make mac
make linux
make win
make pi
mac:
make client
make server
linux:
make client_linux
make server_linux
pi:
make client_pi
make server_pi
win:
make client_win
make server_win
debug:
make client_debug
make server_debug

client_debug:
@go build -gcflags "-N -l" -o dtunnel_d client.go
server_debug:
@go build -gcflags "-N -l" -o dtunnel_s_d server.go


client:
@go build -ldflags "-s -w" -o dtunnel client.go
@go build -ldflags "-s -w" -o bin/dtunnel client.go
client_linux:
@GOOS=linux GOARCH=amd64 go build -ldflags "-s -w" -o bin/linux/dtunnel client.go
client_pi:
@GOOS=linux GOARCH=arm go build -ldflags "-s -w" -o bin/pi/dtunnel client.go
client_win:
@GOOS=windows GOARCH=amd64 go build -ldflags "-s -w" -o bin/windows/dtunnel.exe client.go


server:
@go build -ldflags "-s -w" -o dtunnel_s server.go
@go build -ldflags "-s -w" -o bin/dtunnel_s server.go
server_linux:
@GOOS=linux GOARCH=amd64 go build -ldflags "-s -w" -o bin/linux/dtunnel_s server.go
server_pi:
@GOOS=linux GOARCH=arm go build -ldflags "-s -w" -o bin/pi/dtunnel_s server.go
server_win:
@GOOS=windows GOARCH=amd64 go build -ldflags "-s -w" -o bin/windows/dtunnel_s.exe server.go

clean:
@rm -rf dtunnel dtunnel_d dtunnel_s_d dtunnel_s
@rm -rf bin/*
.PHONY: all debug release client_debug server_debug client server clean

0 comments on commit 5201e45

Please sign in to comment.