Skip to content

Commit

Permalink
Update make file
Browse files Browse the repository at this point in the history
  • Loading branch information
brutella committed Dec 10, 2018
1 parent b8fc6d1 commit 214cee1
Showing 1 changed file with 5 additions and 13 deletions.
18 changes: 5 additions & 13 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,16 @@ GOBUILD=$(GOCMD) build
GOCLEAN=$(GOCMD) clean
GOTEST=$(GOCMD) test
GOGET=$(GOCMD) get
BINARY_NAME=candump
BUILD_DIR=build
BUILD_SRC=cmd/candump.go
PACKAGE_RPI=$(BINARY_NAME)_linux_armhf

all: test build
build:
$(GOBUILD) -o $(BUILD_DIR)/$(BINARY_NAME) -i $(BUILD_SRC)
VERSION=$(shell git describe --exact-match --tags 2>/dev/null)
BUILD_DIR=build
PACKAGE_RPI=candump-$(VERSION)_linux_armhf

test:
$(GOTEST) -v ./...

clean:
$(GOCLEAN)
rm -rf $(BINARY_NAME)

package-rpi: build-rpi
tar -cvzf $(PACKAGE_RPI).tar.gz -C $(BUILD_DIR) $(BINARY_NAME)
tar -cvzf $(PACKAGE_RPI).tar.gz -C $(BUILD_DIR) $(PACKAGE_RPI)

build-rpi:
GOOS=linux GOARCH=arm GOARM=6 $(GOBUILD) -o $(BUILD_DIR)/$(BINARY_NAME) -i $(BUILD_SRC)
GOOS=linux GOARCH=arm GOARM=6 $(GOBUILD) -o $(BUILD_DIR)/$(PACKAGE_RPI)/usr/bin/candump -i cmd/candump.go

0 comments on commit 214cee1

Please sign in to comment.