Makefile 714 B

12345678910111213141516171819202122232425262728293031
  1. define delete-files
  2. python3 -c "import shutil;shutil.rmtree('$(1)', ignore_errors=True)"
  3. endef
  4. codestyle: deps
  5. npm run lint
  6. codestyle-fix: deps
  7. npm run lint:fix
  8. unittests: deps
  9. npm test
  10. clean:
  11. $(call delete-files,dist)
  12. # Only run npm ci again when package.json or the lockfile is newer than the
  13. # last clean install, or when npm has changed node_modules since (for example
  14. # npm install), which rewrites node_modules/.package-lock.json.
  15. deps: node_modules/.npm-ci-stamp
  16. node_modules/.npm-ci-stamp: package.json package-lock.json $(wildcard node_modules/.package-lock.json)
  17. npm ci
  18. touch $@
  19. build:
  20. npm run build
  21. dist: deps clean build
  22. .PHONY: codestyle codestyle-fix unittests deps build dist clean