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 \
|
|
|
|
mastodon/*.go \
|
|
|
|
model/*.go \
|
|
|
|
renderer/*.go \
|
|
|
|
service/*.go \
|
|
|
|
util/*.go \
|
2019-12-13 20:08:26 +02:00
|
|
|
|
2022-01-02 12:52:15 +02:00
|
|
|
all: bloat
|
2020-02-18 23:48:21 +02:00
|
|
|
|
|
|
|
bloat: $(SRC) $(TMPL)
|
2020-01-01 17:58:27 +02:00
|
|
|
$(GO) build $(GOFLAGS) -o bloat main.go
|
2022-10-25 16:40:49 +03:00
|
|
|
sed -e "s%=templates%=$(SHAREPATH)/templates%g" \
|
2022-02-10 18:03:44 +02:00
|
|
|
-e "s%=static%=$(SHAREPATH)/static%g" \
|
|
|
|
< bloat.conf > bloat.gen.conf
|
2019-12-13 20:08:26 +02:00
|
|
|
|
2020-01-31 20:18:31 +02:00
|
|
|
install: bloat
|
2021-04-02 21:00:21 +03:00
|
|
|
mkdir -p $(DESTDIR)$(BINPATH) \
|
|
|
|
$(DESTDIR)$(SHAREPATH)/templates \
|
|
|
|
$(DESTDIR)$(SHAREPATH)/static
|
|
|
|
cp bloat $(DESTDIR)$(BINPATH)/bloat
|
|
|
|
chmod 0755 $(DESTDIR)$(BINPATH)/bloat
|
|
|
|
cp -r templates/* $(DESTDIR)$(SHAREPATH)/templates
|
|
|
|
chmod 0644 $(DESTDIR)$(SHAREPATH)/templates/*
|
|
|
|
cp -r static/* $(DESTDIR)$(SHAREPATH)/static
|
|
|
|
chmod 0644 $(DESTDIR)$(SHAREPATH)/static/*
|
2020-02-18 23:48:21 +02:00
|
|
|
|
2020-01-31 20:18:31 +02:00
|
|
|
uninstall:
|
2021-04-02 21:00:21 +03:00
|
|
|
rm -f $(DESTDIR)$(BINPATH)/bloat
|
|
|
|
rm -fr $(DESTDIR)$(SHAREPATH)
|
2020-01-31 20:18:31 +02:00
|
|
|
|
|
|
|
clean:
|
|
|
|
rm -f bloat
|
2022-02-10 18:03:44 +02:00
|
|
|
rm -f bloat.gen.conf
|