Makefile 734 B

123456789101112131415161718192021222324252627282930313233
  1. .PHONY: runtime compiler test dist
  2. default: dev
  3. K_COMPILER_BIN = build/dev/compiler
  4. K_RUNTIME_JS = build/dev/runtime.js
  5. compiler:
  6. go build -o $(K_COMPILER_BIN) main.go
  7. runtime: compiler
  8. ./bundle.py runtime/runtime.js transpiler/CONST.go \
  9. > $(K_RUNTIME_JS)
  10. echo ";(function(Runtime) { let KumaChan = Runtime;" \
  11. >> $(K_RUNTIME_JS)
  12. $(K_COMPILER_BIN) module runtime/modules/Std/Std.k \
  13. >> $(K_RUNTIME_JS)
  14. echo "})((typeof KumaChan != 'undefined')? KumaChan: module.exports)" \
  15. >> $(K_RUNTIME_JS)
  16. test: compiler runtime
  17. ./test.js
  18. dev: compiler runtime test
  19. dist: dev
  20. cp $(K_COMPILER_BIN) build/dist/kumachan
  21. terser -c -m -- $(K_RUNTIME_JS) > build/dist/kumachan-runtime.js
  22. clean:
  23. rm build/dev/*
  24. rm build/dist/*