2019-12-13 20:08:26 +02:00
|
|
|
GO=go
|
2020-02-01 13:31:44 +02:00
|
|
|
GOFLAGS=-mod=vendor
|
2020-02-18 23:48:21 +02:00
|
|
|
PREFIX=/usr/local
|
|
|
|
BINPATH=$(PREFIX)/bin
|
|
|
|
SHAREPATH=$(PREFIX)/share/bloat
|
2019-12-13 20:08:26 +02:00
|
|
|
|
2020-02-18 23:48:21 +02:00
|
|
|
TMPL=templates/*.tmpl
|
|
|
|
SRC=main.go \
|
|
|
|
config/*.go \
|
|
|
|
kv/*.go \
|
|
|
|
mastodon/*.go \
|
|
|
|
model/*.go \
|
|
|
|
renderer/*.go \
|
|
|
|
repo/*.go \
|
|
|
|
service/*.go \
|
|
|
|
util/*.go \
|
2019-12-13 20:08:26 +02:00
|
|
|
|
2020-02-18 23:48:21 +02:00
|
|
|
all: bloat bloat.def.conf
|
|
|
|
|
|
|
|
bloat: $(SRC) $(TMPL)
|
2020-01-01 17:58:27 +02:00
|
|
|
$(GO) build $(GOFLAGS) -o bloat main.go
|
2019-12-13 20:08:26 +02:00
|
|
|
|
2020-02-18 23:48:21 +02:00
|
|
|
bloat.def.conf:
|
|
|
|
sed -e "s%=database%=/var/bloat%g" \
|
|
|
|
-e "s%=templates%=$(SHAREPATH)/templates%g" \
|
|
|
|
-e "s%=static%=$(SHAREPATH)/static%g" \
|
|
|
|
< bloat.conf > bloat.def.conf
|
|
|
|
|
2020-01-31 20:18:31 +02:00
|
|
|
install: bloat
|
2020-02-18 23:48:21 +02:00
|
|
|
mkdir -p $(BINPATH) $(SHAREPATH)/templates $(SHAREPATH)/static
|
2020-01-31 20:18:31 +02:00
|
|
|
cp bloat $(BINPATH)/bloat
|
|
|
|
chmod 0755 $(BINPATH)/bloat
|
2020-02-18 23:48:21 +02:00
|
|
|
cp -r templates/* $(SHAREPATH)/templates
|
|
|
|
chmod 0644 $(SHAREPATH)/templates/*
|
|
|
|
cp -r static/* $(SHAREPATH)/static
|
|
|
|
chmod 0644 $(SHAREPATH)/static/*
|
|
|
|
|
2020-01-31 20:18:31 +02:00
|
|
|
uninstall:
|
|
|
|
rm -f $(BINPATH)/bloat
|
2020-02-18 23:48:21 +02:00
|
|
|
rm -fr $(SHAREPATH)/templates
|
|
|
|
rm -fr $(SHAREPATH)/static
|
2020-01-31 20:18:31 +02:00
|
|
|
|
|
|
|
clean:
|
|
|
|
rm -f bloat
|
2020-02-18 23:48:21 +02:00
|
|
|
rm -f bloat.def.conf
|