-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathMakefile
More file actions
36 lines (34 loc) · 810 Bytes
/
Makefile
File metadata and controls
36 lines (34 loc) · 810 Bytes
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
# Go parameters
GOCMD=go
GOBUILD=$(GOCMD) build
GOCLEAN=$(GOCMD) clean
GOTEST=$(GOCMD) test
GOGET=$(GOCMD) get
BINARY_NAME=bin/example
BINARY_UNIX=$(BINARY_NAME)_unix
all: build-view build build-linux
build-view:
cd example/view && npm run build
cd example && go-bindata-assetfs view/dist/...
build:
$(GOBUILD) -o $(BINARY_NAME) -v ./example/...
clean:
$(GOCLEAN)
rm -f $(BINARY_NAME)
rm -f $(BINARY_UNIX)
rm -rf example/view/dist/*
run-view:
cd example/view && npm run dev
run:
$(GOBUILD) -o $(BINARY_NAME) -v example/main.go
./$(BINARY_NAME)
analysis:
@echo "engine"
@ cloc --exclude-dir=example ./
@echo "example"
@ cloc example/main.go
@echo "view"
@ cloc example/view/src
# Cross compilation
build-linux:
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 $(GOBUILD) -o $(BINARY_UNIX) ./example/...