mkfile 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. ALL=`echo static/img/*.svg | sed 's/svg/webp/g'` amuse
  2. all:V: $ALL
  3. reallyall:V: $ALL pymodule
  4. amuse: router.go go.mod go.sum `echo front/*.go i18n/*.go libamuse/*.go protocol/*.go tmdb/*.go utils/*.go wikidata/*.go`
  5. 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. # https://github.com/go-python/gopy
  30. pymodule:QV: `echo **/*.go`
  31. echo "NOTE: This only works with glibc"
  32. gopy build -output pymodule notabug.org/apiote/amuse/libamuse
  33. cd pymodule
  34. go build -ldflags "-s -w" -buildmode=c-archive -o libamuse_go.a .
  35. gcc libamuse.c libamuse_go.a -o _libamuse.so $(python3.7-config --cflags) $(python3.7-config --ldflags) -fPIC --shared
  36. rm -f Makefile __pycache__ build.py libamuse.c libamuse_go.h __init__.py libamuse.go libamuse_go.so libamuse_go.a