Makefile 937 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  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. service/*.go \
  13. util/*.go \
  14. all: bloat
  15. bloat: $(SRC) $(TMPL)
  16. $(GO) build $(GOFLAGS) -o bloat main.go
  17. sed -e "s%=templates%=$(SHAREPATH)/templates%g" \
  18. -e "s%=static%=$(SHAREPATH)/static%g" \
  19. < bloat.conf > bloat.gen.conf
  20. install: bloat
  21. mkdir -p $(DESTDIR)$(BINPATH) \
  22. $(DESTDIR)$(SHAREPATH)/templates \
  23. $(DESTDIR)$(SHAREPATH)/static
  24. cp bloat $(DESTDIR)$(BINPATH)/bloat
  25. chmod 0755 $(DESTDIR)$(BINPATH)/bloat
  26. cp -r templates/* $(DESTDIR)$(SHAREPATH)/templates
  27. chmod 0644 $(DESTDIR)$(SHAREPATH)/templates/*
  28. cp -r static/* $(DESTDIR)$(SHAREPATH)/static
  29. chmod 0644 $(DESTDIR)$(SHAREPATH)/static/*
  30. uninstall:
  31. rm -f $(DESTDIR)$(BINPATH)/bloat
  32. rm -fr $(DESTDIR)$(SHAREPATH)
  33. clean:
  34. rm -f bloat
  35. rm -f bloat.gen.conf