mirror of
https://gitea.phreedom.club/localhost_frssoft/bloat.git
synced 2024-11-05 06:33:01 +00:00
003233d60d
- Look for both local and global config file - Directly generate the global config file with make install
43 lines
965 B
Makefile
43 lines
965 B
Makefile
GO=go
|
|
GOFLAGS=-mod=vendor
|
|
PREFIX=/usr/local
|
|
BINPATH=$(PREFIX)/bin
|
|
SHAREPATH=$(PREFIX)/share/bloat
|
|
|
|
TMPL=templates/*.tmpl
|
|
SRC=main.go \
|
|
config/*.go \
|
|
mastodon/*.go \
|
|
model/*.go \
|
|
renderer/*.go \
|
|
repo/*.go \
|
|
service/*.go \
|
|
util/*.go \
|
|
|
|
all: bloat
|
|
|
|
bloat: $(SRC) $(TMPL)
|
|
$(GO) build $(GOFLAGS) -o bloat main.go
|
|
|
|
install: bloat
|
|
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/*
|
|
sed -e "s%=database%=/var/bloat%g" \
|
|
-e "s%=templates%=$(SHAREPATH)/templates%g" \
|
|
-e "s%=static%=$(SHAREPATH)/static%g" \
|
|
< bloat.conf > /etc/bloat.conf
|
|
|
|
uninstall:
|
|
rm -f $(DESTDIR)$(BINPATH)/bloat
|
|
rm -fr $(DESTDIR)$(SHAREPATH)
|
|
|
|
clean:
|
|
rm -f bloat
|