Skip to content

Commit 41550a9

Browse files
committed
makefile+travis: add install and build commands
Build executables are suffixed with 'debug' because we cannot create a loopd executable in the root repo dir, since there is an already existing loopd executable. Add build to travis.
1 parent 8301abd commit 41550a9

File tree

3 files changed

+24
-2
lines changed

3 files changed

+24
-2
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ _testmain.go
2424
*.test
2525
*.prof
2626

27+
/loop-debug
28+
/loopd-debug
29+
2730
output*.log
2831

2932
loop

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ sudo: required
1818

1919
script:
2020
- export GO111MODULE=on
21-
- make lint unit
21+
- make lint unit build
2222

2323
after_script:
2424
- echo "Uploading to termbin.com..." && find *.log | xargs -I{} sh -c "cat {} | nc termbin.com 9999 | xargs -r0 printf '{} uploaded to %s'"

Makefile

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@ PKG := github.com/lightninglabs/loop
33
GOTEST := GO111MODULE=on go test -v
44

55
GO_BIN := ${GOPATH}/bin
6+
GOBUILD := GO111MODULE=on go build -v
7+
GOINSTALL := GO111MODULE=on go install -v
8+
9+
COMMIT := $(shell git describe --abbrev=40 --dirty)
10+
LDFLAGS := -ldflags "-X $(PKG)/build.Commit=$(COMMIT)"
611

712
GOFILES_NOVENDOR = $(shell find . -type f -name '*.go' -not -path "./vendor/*")
813
GOLIST := go list $(PKG)/... | grep -v '/vendor/'
@@ -33,4 +38,18 @@ fmt:
3338

3439
lint: $(LINT_BIN)
3540
@$(call print, "Linting source.")
36-
$(LINT)
41+
$(LINT)
42+
43+
# ============
44+
# INSTALLATION
45+
# ============
46+
47+
build:
48+
@$(call print, "Building debug loop and loopd.")
49+
$(GOBUILD) -o loop-debug $(LDFLAGS) $(PKG)/cmd/loop
50+
$(GOBUILD) -o loopd-debug $(LDFLAGS) $(PKG)/cmd/loopd
51+
52+
install:
53+
@$(call print, "Installing loop and loopd.")
54+
$(GOINSTALL) $(LDFLAGS) $(PKG)/cmd/loop
55+
$(GOINSTALL) $(LDFLAGS) $(PKG)/cmd/loopd

0 commit comments

Comments
 (0)