-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
45 lines (36 loc) · 1.04 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
#
# This project is developed using the open source Go language
# and it can be compilated on a windows, linux or macosx system
#
# Make sure go tools directory (C:/Go/bin or /usr/local/go/bin) is included in the $PATH environment variable
# and $GOROOT is pointing to the go directory (C:/Go or /usr/local/go)
#
# Download Go from https://golang.org/dl/ if not available
#
# A pre-compiled binary for windows and linux is available at /bin/win_amd64 and /bin/linux_386
#
# Enjoy :)
#
APP_DIR=${CURDIR}
APP_BIN:=bin
APP_SRC:=src
BENCHMARK_SRC:=benchmark
PACKAGE_NAME:=app/simulator
TOOL_NAME:=simulator
GOFMT:=gofmt
GOPATH:=${APP_DIR}
GO:=env GOPATH="${GOPATH}" go
.PHONY: clean build benchmark
all: clean fmt build
clean:
@echo "Cleaning build directory..."
@rm -rf $(APP_DIR)/$(APP_BIN)
fmt:
@echo "Formating app..."
@$(GOFMT) -l -w $(APP_DIR)/$(APP_SRC)/$(PACKAGE_NAME)
build: fmt
@echo "Building app..."
@$(GO) build -o $(APP_DIR)/$(APP_BIN)/$(TOOL_NAME).exe $(PACKAGE_NAME)
test: build
@echo "Testing app..."
@$(GO) test $(PACKAGE_NAME)...