-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
59 lines (45 loc) · 1.25 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
SELFPKG := github.com/rharter/mediaman
VERSION := 0.0.1
SHA := $(shell git rev-parse --short HEAD)
BRANCH := $(shell git rev-parse --abbrev-ref HEAD)
PKGS := \
database \
model
PKGS := $(addprefix github.com/rharter/mediaman/pkg/,$(PKGS))
.PHONY := test $(PKGS)
all: embed build
build:
go build -o bin/mediaman -ldflags "-X main.version $(VERSION)dev-$(SHA)" $(SELFPKG)/cmd/mediaman
build-dist:
godep go build -o bin/mediaman -ldflags "-X main.version $(VERSION)-$(SHA)" $(SELFPKG)/vmd/mediaman
bump-deps: deps
deps:
go get -u -t -v ./...
# Embed static assets
embed: js rice
cd cmd/mediaman && rice embed
cd pkg/template && rice embed
js:
#cd cmd/mediaman/assets && find js -name "*.js" ! -name '.*' ! -name "main.js" -exec cat {} \; > js/main.js
test:
go test -v ./...
$(PKGS):
go test -v $@
clean: rice
cd cmd/mediaman && rice clean
cd pkg/template && rice clean
rm -rf cmd/mediaman/mediaman
rm -rf cmd/mediaman/mediaman.sqlite
rm -rf bin/mediaman
rm -rf mediaman.sqlite
rm -rf /tmp/mediaman.sqlite
rm -rf sample
run:
bin/mediaman --port=":8080" --datasource="mediaman.sqlite"
godep:
go get github.com/tools/godep
rice:
go install github.com/GeertJohan/go.rice/rice
sample:
mkdir -p "sample"
cd sample && tar xjf ../sample-data.tar.bz2