Makefile 965 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. GO=go
  2. GOFLAGS=-mod=vendor
  3. PREFIX=/usr/local
  4. BINPATH=$(PREFIX)/bin
  5. SHAREPATH=$(PREFIX)/share/bloat
  6. TMPL=templates/*.tmpl
  7. SRC=main.go \
  8. config/*.go \
  9. mastodon/*.go \
  10. model/*.go \
  11. renderer/*.go \
  12. repo/*.go \
  13. service/*.go \
  14. util/*.go \
  15. all: bloat
  16. bloat: $(SRC) $(TMPL)
  17. $(GO) build $(GOFLAGS) -o bloat main.go
  18. install: bloat
  19. mkdir -p $(DESTDIR)$(BINPATH) \
  20. $(DESTDIR)$(SHAREPATH)/templates \
  21. $(DESTDIR)$(SHAREPATH)/static
  22. cp bloat $(DESTDIR)$(BINPATH)/bloat
  23. chmod 0755 $(DESTDIR)$(BINPATH)/bloat
  24. cp -r templates/* $(DESTDIR)$(SHAREPATH)/templates
  25. chmod 0644 $(DESTDIR)$(SHAREPATH)/templates/*
  26. cp -r static/* $(DESTDIR)$(SHAREPATH)/static
  27. chmod 0644 $(DESTDIR)$(SHAREPATH)/static/*
  28. sed -e "s%=database%=/var/bloat%g" \
  29. -e "s%=templates%=$(SHAREPATH)/templates%g" \
  30. -e "s%=static%=$(SHAREPATH)/static%g" \
  31. < bloat.conf > /etc/bloat.conf
  32. uninstall:
  33. rm -f $(DESTDIR)$(BINPATH)/bloat
  34. rm -fr $(DESTDIR)$(SHAREPATH)
  35. clean:
  36. rm -f bloat