Skip to content

Commit

Permalink
Add Makefile
Browse files Browse the repository at this point in the history
This patch also adds Makefile.target.sample with exemplary user
configuration and .gitignore to dismiss temporary artifacts.
  • Loading branch information
pawiecz committed Dec 31, 2017
1 parent b5b1c97 commit 3fa3863
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Target specific configuration and binary
Makefile.target
relayctl.target

# Test coverage analysis artifact
relayctl.coverprofile
23 changes: 23 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
BINARY_NAME=relayctl
BINARY_TARGET=$(BINARY_NAME).target

include Makefile.target

all: test build deploy run

test:
ginkgo

cover:
ginkgo -cover

build:
GOARCH=$(GOARCH) GOARM=$(GOARM) GOOS=$(GOOS) go build -o $(BINARY_TARGET)

deploy:
scp $(BINARY_TARGET) $(USER)@$(HOST):$(DEST)

run:
-ssh -t $(USER)@$(HOST) $(DEST)/$(BINARY_TARGET)

.PHONY: all test cover build deploy run
7 changes: 7 additions & 0 deletions Makefile.target.sample
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
GOARCH=arm
GOARM=6
GOOS=linux

USER=pi
HOST=10.42.0.224
DEST=relayctl

0 comments on commit 3fa3863

Please sign in to comment.