-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
50 lines (46 loc) · 1.17 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
# Makefile for the vorimport project
# Helper file
# Go parameters
GOCMD=go
GOBUILD=$(GOCMD) build
GOCLEAN=$(GOCMD) clean
GOINSTALL=$(GOCMD) install
GOTEST=$(GOCMD) test
GODEP=$(GOTEST) -i
GOFMT=gofmt -w
# Project target
TARGET=./bin/vorimport
# Build source
SRC_BUILD_LIST = main.go
#Source files
SRC_LIST=$(wildcard *.go)
#Test files
TEST_LIST = $(wildcard *_test.go)
#
BUILD_LIST = $(foreach int, $(SRC_BUILD_LIST), $(int)_build)
CLEAN_LIST = $(foreach int, $(SRC_LIST), $(int)_clean)
FMT_TEST = $(foreach int, $(SRC_LIST), $(int)_fmt)
# All are .PHONY for now because dependencyness is hard
.PHONY: $(CLEAN_LIST) $(TEST_LIST) $(FMT_LIST) $(BUILD_LIST)
all: build
build: $(BUILD_LIST)
clean: $(CLEAN_LIST)
test: $(TEST_LIST)
fmt: $(FMT_TEST)
git:
git commit -a -m "$m"
git push https://github.com/vassilux/vorimport.git
depends:
go get -u github.com/cihub/seelog
go get -u github.com/ziutek/mymysql/thrsafe
go get -u github.com/ziutek/mymysql/autorc
go get -u github.com/ziutek/mymysql/godrv
go get labix.org/v2/mgo
$(BUILD_LIST): %_build: %_fmt
$(GOBUILD) -o $(TARGET)
$(CLEAN_LIST): %_clean:
$(GOCLEAN) $*
$(TEST_LIST): %_test:
$(GOTEST) $*
$(FMT_TEST): %_fmt:
$(GOFMT) $*