Use vendored dependencies
[bloat] / Makefile
1 GO=go
2 GOFLAGS=-mod=vendor
3 BINPATH=/usr/local/bin
4 DATAPATH=/var/bloat
5 ETCPATH=/etc
6
7 all: bloat
8
9 bloat: main.go 
10         $(GO) build $(GOFLAGS) -o bloat main.go
11
12 install: bloat
13         cp bloat $(BINPATH)/bloat
14         chmod 0755 $(BINPATH)/bloat
15         mkdir -p $(DATAPATH)/database
16         cp -r templates $(DATAPATH)/
17         cp -r static $(DATAPATH)/
18         sed -e "s%=database%=$(DATAPATH)/database%g" \
19                 -e "s%=templates%=$(DATAPATH)/templates%g" \
20                 -e "s%=static%=$(DATAPATH)/static%g" \
21                 < bloat.conf > $(ETCPATH)/bloat.conf
22
23 uninstall:
24         rm -f $(BINPATH)/bloat
25         rm -fr $(DATAPATH)/templates
26         rm -fr $(DATAPATH)/static
27         rm -f $(ETCPATH)/bloat.conf
28
29 clean: 
30         rm -f bloat
31
32 run: bloat
33         ./bloat