forked from CrunchyData/pg_tileserv
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
49 lines (35 loc) · 1.05 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
PROGRAM := pg_tileserv
CONTAINER := pramsey/$(PROGRAM)
RM = /bin/rm
CP = /bin/cp
MKDIR = /bin/mkdir
.PHONY: all check clean test docker docs install uninstall
GOFILES := $(wildcard *.go)
all: $(PROGRAM)
check:
@go version
clean:
$(info Cleaning project...)
@rm -f $(PROGRAM)
@rm -rf docs/*
docs:
@rm -rf docs/* && cd hugo && hugo && cd ..
$(PROGRAM): $(GOFILES)
go build -v
docker: $(PROGRAM) Dockerfile.ci
docker build -f Dockerfile.ci --build-arg VERSION=`./$(PROGRAM) --version | cut -f2 -d' '` -t $(CONTAINER):latest .
docker image prune --force
test:
go test -v
install: $(PROGRAM) docs
$(MKDIR) -p $(DESTDIR)/usr/bin
$(MKDIR) -p $(DESTDIR)/usr/share/$(PROGRAM)
$(MKDIR) -p $(DESTDIR)/etc
$(CP) $(PROGRAM) $(DESTDIR)/usr/bin/$(PROGRAM)
$(CP) config/$(PROGRAM).toml.example $(DESTDIR)/etc/$(PROGRAM).toml
$(CP) -r assets $(DESTDIR)/usr/share/$(PROGRAM)/assets
$(CP) -r docs $(DESTDIR)/usr/share/$(PROGRAM)/docs
uninstall:
$(RM) $(DESTDIR)/usr/bin/$(PROGRAM)
$(RM) $(DESTDIR)/etc/$(PROGRAM).toml
$(RM) -r $(DESTDIR)/usr/share/$(PROGRAM)