bloat/Makefile

34 lines
666 B
Makefile
Raw Normal View History

2019-12-13 18:08:26 +00:00
GO=go
2020-02-01 11:31:44 +00:00
GOFLAGS=-mod=vendor
BINPATH=/usr/local/bin
DATAPATH=/var/bloat
ETCPATH=/etc
2019-12-13 18:08:26 +00:00
2020-01-01 15:58:27 +00:00
all: bloat
2019-12-13 18:08:26 +00:00
bloat: main.go
2020-01-01 15:58:27 +00:00
$(GO) build $(GOFLAGS) -o bloat main.go
2019-12-13 18:08:26 +00:00
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
2020-01-01 15:58:27 +00:00
run: bloat
2020-02-01 15:06:32 +00:00
./bloat -f bloat.conf