Makefile 938 B

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