-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
60 lines (44 loc) · 1.01 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
.PHONY: all
all: build
FORCE: ;
SHELL := env BOOKMARK_ENV=$(BOOKMARK_ENV) $(SHELL)
BOOKMARK_ENV ?= dev
BIN_DIR = $(PWD)/bin
GOCMD=go
GOBUILD=$(GOCMD) build
GOCLEAN=$(GOCMD) clean
GOTEST=$(GOCMD) test
GOGET=$(GOCMD) get
BINARY_NAME=./bin/go-api-jwt-v2
BINARY_UNIX=$(BINARY_NAME)_unix
PROJECTNAME := $(shell basename "$(pwd)")
GO_ENV:=tests
export GO_ENV
PID := /tmp/.$(PROJECTNAME).PID
.PHONY: build
clean:
rm -rf bin/*
all:
test build
build:
# $(GOBUILD) -o $(BINARY_NAME) -v
dependencies build-api
build-api:
$(GOBUILD) -tags $(BOOKMARK_ENV) -o $(BINARY_NAME) -v
test:
$(GOTEST) -v ./..
clean:
$(GOCLEAN)
rm -f $(BINARY_NAME)
rm -f ./bin/$(BINARY_UNIX)
run:
$(GOBUILD) -o $(BINARY_NAME)
./$(BINARY_NAME)
deps:
$(GOGET) -u github.com/dgrijalva/jwt-go
$(GOGET) -u github.com/auth0/go-jwt-middleware
$(GOGET) -u github.com/go-sql-driver/mysql
$(GOGET) -u github.com/gorilla/handlers
$(GOGET) -u github.com/urfave/negroni
$(GOGET) -u github.com/onsi/ginkgo/ginkgo
$(GOGET) -u github.com/onsi/gomega