Show background images in profile headers.
[bloat] / Makefile
1 GO=go
2 GOFLAGS=-mod=vendor
3 PREFIX=/usr/local
4 BINPATH=$(PREFIX)/bin
5 SHAREPATH=$(PREFIX)/share/bloat
6
7 TMPL=templates/*.tmpl
8 SRC=main.go             \
9         config/*.go     \
10         mastodon/*.go   \
11         model/*.go      \
12         renderer/*.go   \
13         repo/*.go       \
14         service/*.go    \
15         util/*.go       \
16
17 all: bloat bloat.def.conf
18
19 bloat: $(SRC) $(TMPL)
20         $(GO) build $(GOFLAGS) -o bloat main.go
21
22 bloat.def.conf:
23         sed -e "s%=database%=/var/bloat%g" \
24                 -e "s%=templates%=$(SHAREPATH)/templates%g" \
25                 -e "s%=static%=$(SHAREPATH)/static%g" \
26                 < bloat.conf > bloat.def.conf
27
28 install: bloat
29         mkdir -p $(BINPATH) $(SHAREPATH)/templates $(SHAREPATH)/static
30         cp bloat $(BINPATH)/bloat
31         chmod 0755 $(BINPATH)/bloat
32         cp -r templates/* $(SHAREPATH)/templates
33         chmod 0644 $(SHAREPATH)/templates/*
34         cp -r static/* $(SHAREPATH)/static
35         chmod 0644 $(SHAREPATH)/static/*
36
37 uninstall:
38         rm -f $(BINPATH)/bloat
39         rm -fr $(SHAREPATH)/templates
40         rm -fr $(SHAREPATH)/static
41
42 clean: 
43         rm -f bloat
44         rm -f bloat.def.conf