mkfile 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. ALL=`echo static/img/*.svg | sed 's/svg/webp/g'` amuse
  2. all:V: $ALL
  3. reallyall:V: $ALL pymodule
  4. amuse: main.go router.go go.mod go.sum `echo front/*.go i18n/*.go libamuse/*.go tmdb/*.go wikidata/*.go inventaire/*.go db/*.go datastructure/*.go network/*.go accounts/*.go`
  5. CGO_CFLAGS="-D_LARGEFILE64_SOURCE" go build -ldflags "-s -w -linkmode external -extldflags -static"
  6. static/img/%.webp: static/img/%.svg
  7. rendersvg static/img/$stem.svg static/img/$stem.png
  8. cwebp -lossless static/img/$stem.png -o static/img/$stem.webp
  9. rm static/img/$stem.png
  10. PREFIX=`echo ${PREFIX:-/usr/local}`
  11. install:V: amuse
  12. mkdir -m755 -p $PREFIX/bin
  13. mkdir -m755 -p $PREFIX/share/amuse
  14. mkdir -m755 -p $PREFIX/share/amuse/templates
  15. mkdir -m755 -p $PREFIX/share/amuse/i18n
  16. mkdir -m755 -p $PREFIX/share/amuse/static/style
  17. mkdir -m755 -p $PREFIX/share/amuse/static/img
  18. mkdir -m755 -p $PREFIX/share/amuse/static/fonts
  19. install -m755 amuse $PREFIX/bin/amuse
  20. install -m644 templates/*.html $PREFIX/share/amuse/templates/
  21. install -m644 i18n/*-*.toml $PREFIX/share/amuse/i18n/
  22. ln -s $PREFIX/share/amuse/i18n/en-GB.toml $PREFIX/share/amuse/i18n/default.toml
  23. install -m644 static/style/style.css $PREFIX/share/amuse/static/style/style.css
  24. install -m644 static/img/*.webp $PREFIX/share/amuse/static/img/
  25. install -m644 static/fonts/MaterialIcons-Regular.woff2 $PREFIX/share/amuse/static/fonts/MaterialIcons-Regular.woff2
  26. uninstall:V:
  27. rm $PREFIX/bin/amuse
  28. rm -r $PREFIX/share/amuse
  29. zip:V: amuse.tgz
  30. amuse.tgz: amuse `echo templates/* static/* i18n/*`
  31. tar czf amuse.tgz templates i18n/??-??.toml static amuse