From 3198f9581c7d426bc65527640591bb53fd2d96e4 Mon Sep 17 00:00:00 2001 From: Wei Shen Date: Fri, 5 Aug 2022 18:57:24 +0800 Subject: [PATCH] add guide to compile from source --- README.md | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/README.md b/README.md index 425a1a7..c58d411 100644 --- a/README.md +++ b/README.md @@ -131,6 +131,29 @@ And then: #### Method 2: For Go developer go get -u github.com/shenwei356/rush/ + +#### Method 3: Compiling from source + + # download Go from https://go.dev/dl + wget https://go.dev/dl/go1.17.12.linux-amd64.tar.gz + + tar -zxf go1.17.12.linux-amd64.tar.gz -C $HOME/ + + # or + # echo "export PATH=$PATH:$HOME/go/bin" >> ~/.bashrc + # source ~/.bashrc + export PATH=$PATH:$HOME/go/bin + + git clone https://github.com/shenwei356/rush + cd rush + + go build + + # or statically-linked binary + CGO_ENABLED=0 go build -tags netgo -ldflags '-w -s' + + # or cross compile for other operating systems and architectures + CGO_ENABLED=0 GOOS=openbsd GOARCH=amd64 go build -tags netgo -ldflags '-w -s' ## Usage