Makefile 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. # ---------- ---------- ---------- ---------- ---------- ----------
  2. #
  3. # med-appointments Makefile
  4. #
  5. # 1) config, vars, and target
  6. # 2) functions
  7. # 3) phonies
  8. #
  9. # ---------- ---------- ---------- ---------- ---------- ----------
  10. target: help
  11. # ---------- ---------- ---------- ---------- ---------- ----------
  12. # functions
  13. # ---------- ---------- ---------- ---------- ---------- ----------
  14. define fix
  15. @npx prettier --write ./src/*/*.js ./src/*/*.vue
  16. endef
  17. # ---------- ---------- ---------- ---------- ---------- ----------
  18. # phonies
  19. # ---------- ---------- ---------- ---------- ---------- ----------
  20. .PHONY: help
  21. help:
  22. @echo "Usage: make [PHONY]"
  23. @sed -n -e '/sed/! s/\.PHONY: //p' Makefile
  24. .PHONY: run
  25. run:
  26. @npm run serve
  27. .PHONY: rerun
  28. rerun: dev run
  29. .PHONY: upgrade
  30. upgrade:
  31. vue upgrade
  32. npm audit fix || echo ""
  33. @echo "Suggestion: sudo npm update -g @vue/cli"
  34. .PHONY: build
  35. build:
  36. @npm run build
  37. @mkdir -p output
  38. @rsync -va ./dist/ ./output/
  39. @mkdir -p output/css || echo "pass"
  40. @mkdir -p output/js || echo "pass"
  41. @cp -r ./dist/css/app.*.css ./output/css/app.css
  42. @cp -r ./dist/js/about.*.js ./output/js/about.js
  43. @cp -r ./dist/js/about.*.js.map ./output/js/about.js.map
  44. @cp -r ./dist/js/app.*.js ./output/js/app.js
  45. @cp -r ./dist/js/app.*.js.map ./output/js/app.js.map
  46. @cp -r ./dist/js/chunk-vendors.*.js ./output/js/chunk-vendors.js
  47. @cp -r ./dist/js/chunk-vendors.*.js.map ./output/js/chunk-vendors.js.map
  48. @printf '\n '`git rev-parse HEAD`
  49. @printf '\n\n'
  50. .PHONY: dev
  51. dev:
  52. @$(call fix)
  53. .PHONY: rebuild
  54. rebuild: clean build
  55. .PHONY: clean
  56. clean:
  57. @rm -rf dist/ output/