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