-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
import Makefile to compile linux/windows/macos platform support
- Loading branch information
1 parent
6bb169b
commit 8dd52b8
Showing
1 changed file
with
36 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 |
---|---|---|
@@ -0,0 +1,36 @@ | ||
BUILD_NAME:=twitterdownloader | ||
BUILD_VERSION:=1.0 | ||
SOURCE:=*.go | ||
LDFLAGS:=-ldflags "-X main.Version=${BUILD_VERSION}" | ||
|
||
all: deps build install | ||
|
||
deps: | ||
#安装依赖 | ||
#[ -x glide ] && glide install || yum install glide | ||
|
||
test: | ||
go test | ||
|
||
build: test | ||
go build -o ${BUILD_NAME} ${SOURCE} | ||
|
||
build_linux: test | ||
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o ${BUILD_NAME} ${SOURCE} | ||
|
||
build_win: test | ||
CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -o ${BUILD_NAME} ${SOURCE} | ||
|
||
build_macos: test | ||
CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -o ${BUILD_NAME} ${SOURCE} | ||
|
||
install: deps build | ||
go install | ||
#生成配置文件等 | ||
#cp app.conf.example /etc/app.conf | ||
#release: build build_win build_macos | ||
|
||
clean: | ||
go clean | ||
|
||
.PHONY: all deps test build build_linux build_win install clean |