Skip to content

Commit 215fbe7

Browse files
author
Emilien Kenler
committed
Add Makefile to build the binary files
1 parent 275ed7a commit 215fbe7

File tree

3 files changed

+31
-2
lines changed

3 files changed

+31
-2
lines changed

.editorconfig

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ indent_style = space
88
indent_size = 4
99
trim_trailing_whitespace = true
1010

11+
[Makefile]
12+
indent_style = tab
13+
indent_size = 4
14+
1115
[*.{yaml,yml}]
12-
ident_style = space
13-
ident_size = 2
16+
indent_style = space
17+
indent_size = 2

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/dist/

Makefile

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
.PHONY: install build build-all
2+
3+
NAME:=nmp
4+
PACKAGE:=milk/nmp
5+
6+
install:
7+
go install github.com/$(PACKAGE)/cmd/$(NAME)
8+
9+
build:
10+
go build github.com/$(PACKAGE)/cmd/$(NAME)
11+
12+
build-all:
13+
env GOOS=darwin GOARCH=amd64 go build -o dist/$(NAME)_$(VERSION)_darwin_amd64/$(NAME) github.com/$(PACKAGE)/cmd/$(NAME) && \
14+
cd dist && \
15+
tar cvzf $(NAME)_$(VERSION)_darwin_amd64.tgz $(NAME)_$(VERSION)_darwin_amd64 && \
16+
rm -rf $(NAME)_$(VERSION)_darwin_amd64
17+
env GOOS=linux GOARCH=amd64 go build -o dist/$(NAME)_$(VERSION)_linux_amd64/$(NAME) github.com/$(PACKAGE)/cmd/$(NAME) && \
18+
cd dist && \
19+
tar cvzf $(NAME)_$(VERSION)_linux_amd64.tgz $(NAME)_$(VERSION)_linux_amd64 && \
20+
rm -rf $(NAME)_$(VERSION)_linux_amd64
21+
env GOOS=linux GOARCH=386 go build -o dist/$(NAME)_$(VERSION)_linux_386/$(NAME) github.com/$(PACKAGE)/cmd/$(NAME) && \
22+
cd dist && \
23+
tar cvzf $(NAME)_$(VERSION)_linux_386.tgz $(NAME)_$(VERSION)_linux_386 && \
24+
rm -rf $(NAME)_$(VERSION)_linux_386

0 commit comments

Comments
 (0)