aboutsummaryrefslogtreecommitdiff
path: root/Makefile
blob: a3859bb2fbe02a00b5e2992c92571b87f695437b (plain)
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
GO=go
GOFLAGS=-mod=vendor
BINPATH=/usr/local/bin
DATAPATH=/var/bloat
ETCPATH=/etc

all: bloat

bloat: main.go 
	$(GO) build $(GOFLAGS) -o bloat main.go

install: bloat
	cp bloat $(BINPATH)/bloat
	chmod 0755 $(BINPATH)/bloat
	mkdir -p $(DATAPATH)/database
	cp -r templates $(DATAPATH)/
	cp -r static $(DATAPATH)/
	sed -e "s%=database%=$(DATAPATH)/database%g" \
		-e "s%=templates%=$(DATAPATH)/templates%g" \
		-e "s%=static%=$(DATAPATH)/static%g" \
		< bloat.conf > $(ETCPATH)/bloat.conf

uninstall:
	rm -f $(BINPATH)/bloat
	rm -fr $(DATAPATH)/templates
	rm -fr $(DATAPATH)/static
	rm -f $(ETCPATH)/bloat.conf

clean: 
	rm -f bloat

run: bloat
	./bloat -f bloat.conf