mirror of
https://github.com/bcicen/ctop.git
synced 2024-08-30 18:23:19 +00:00
add Makefile
This commit is contained in:
parent
a135a67c06
commit
26b88a9790
26
Makefile
Normal file
26
Makefile
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
NAME=ctop
|
||||||
|
VERSION=$(shell cat VERSION)
|
||||||
|
BUILD=$(shell git rev-parse --short HEAD)
|
||||||
|
LD_FLAGS="-w -X main.version=$(VERSION) -X main.build=$(BUILD)"
|
||||||
|
|
||||||
|
clean:
|
||||||
|
rm -rf build/ release/
|
||||||
|
|
||||||
|
build:
|
||||||
|
glide install
|
||||||
|
CGO_ENABLED=0 go build -tags release -ldflags $(LD_FLAGS) -o ctop
|
||||||
|
|
||||||
|
build-all:
|
||||||
|
mkdir -p build
|
||||||
|
GOOS=darwin GOARCH=amd64 go build -tags release -ldflags $(LD_FLAGS) -o build/ctop-$(VERSION)-darwin-amd64
|
||||||
|
GOOS=linux GOARCH=amd64 go build -tags release -ldflags $(LD_FLAGS) -o build/ctop-$(VERSION)-linux-amd64
|
||||||
|
GOOS=linux GOARCH=arm go build -tags release -ldflags $(LD_FLAGS) -o build/ctop-$(VERSION)-linux-arm
|
||||||
|
|
||||||
|
release:
|
||||||
|
mkdir release
|
||||||
|
go get github.com/progrium/gh-release/...
|
||||||
|
cp build/* release
|
||||||
|
gh-release create bcicen/$(NAME) $(VERSION) \
|
||||||
|
$(shell git rev-parse --abbrev-ref HEAD) $(VERSION)
|
||||||
|
|
||||||
|
.PHONY: build
|
@ -49,8 +49,7 @@ To build `ctop` from source, ensure you have a recent version of [glide](http://
|
|||||||
```bash
|
```bash
|
||||||
git clone https://github.com/bcicen/ctop.git $GOPATH/src/github.com/bcicen/ctop && \
|
git clone https://github.com/bcicen/ctop.git $GOPATH/src/github.com/bcicen/ctop && \
|
||||||
cd $GOPATH/src/github.com/bcicen/ctop && \
|
cd $GOPATH/src/github.com/bcicen/ctop && \
|
||||||
glide install && \
|
make build
|
||||||
go build
|
|
||||||
```
|
```
|
||||||
|
|
||||||
To build a minimal Docker image containing only `ctop`, follow the build instructions above up through `glide install`, then:
|
To build a minimal Docker image containing only `ctop`, follow the build instructions above up through `glide install`, then:
|
||||||
|
Loading…
Reference in New Issue
Block a user