ALL=`echo static/img/*.svg | sed 's/svg/webp/g'` amuse

all:V: $ALL
reallyall:V: $ALL pymodule

amuse: router.go `echo front/*.go i18n/*.go libamuse/*.go protocol/*.go tmdb/*.go utils/*.go`
	go build -ldflags "-s -w" -o $target router.go
static/img/%.webp: static/img/%.svg
	inkscape -e - static/img/$stem.svg | cwebp -lossless -o static/img/$stem.webp -- -

# https://github.com/go-python/gopy
pymodule:QV: `echo **/*.go`
	echo "NOTE: This only works with glibc"
	gopy build -output pymodule notabug.org/apiote/amuse/libamuse
	cd pymodule
	go build -ldflags "-s -w" -buildmode=c-archive -o libamuse_go.a .
	gcc libamuse.c libamuse_go.a -o _libamuse.so $(python3.7-config --cflags) $(python3.7-config --ldflags) -fPIC --shared
	rm -f Makefile __pycache__ build.py libamuse.c libamuse_go.h __init__.py libamuse.go libamuse_go.so libamuse_go.a
