-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
52 lines (42 loc) · 1.09 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
CWD = $(shell pwd)
PKG = github.com/nathan-osman/caddy-docker
CMD = caddy-docker
UID = $(shell id -u)
GID = $(shell id -g)
SOURCES = $(shell find -type f -name '*.go' ! -path './cache/*')
BINDATA = $(shell find server/static server/templates)
all: dist/${CMD}
dist/${CMD}: ${SOURCES} server/ab0x.go | cache dist
@docker run \
--rm \
-e CGO_ENABLED=0 \
-e UID=${UID} \
-e GID=${GID} \
-v ${CWD}/cache/lib:/go/lib \
-v ${CWD}/cache/src:/go/src \
-v ${CWD}/dist:/go/bin \
-v ${CWD}:/go/src/${PKG} \
nathanosman/bettergo \
go get -pkgdir /go/lib ${PKG}/cmd/${CMD}
@touch dist/${CMD}
server/ab0x.go: ${BINDATA} dist/fileb0x b0x.yaml
dist/fileb0x b0x.yaml
dist/fileb0x: | cache dist
@docker run \
--rm \
-e CGO_ENABLED=0 \
-e UID=${UID} \
-e GID=${GID} \
-v ${CWD}/cache/lib:/go/lib \
-v ${CWD}/cache/src:/go/src \
-v ${CWD}/dist:/go/bin \
nathanosman/bettergo \
go get -pkgdir /go/lib github.com/UnnoTed/fileb0x
cache:
@mkdir cache
dist:
@mkdir dist
clean:
@rm -f server/ab0x.go
@rm -rf cache dist
.PHONY: clean