You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

89 lines
1.2 KiB

3 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. #
  2. # Variables
  3. #
  4. NAME = Switchery
  5. #
  6. # Paths
  7. #
  8. COMPONENT_BUILD = node_modules/.bin/component-build
  9. COMPONENT_INSTALL = node_modules/.bin/component-install
  10. UGLIFYJS = node_modules/uglify-js/bin/uglifyjs
  11. UGLIFYCSS = node_modules/uglifycss/uglifycss
  12. JS_DEST = dist/switchery.js
  13. JS_MIN_DEST = dist/switchery.min.js
  14. CSS_DEST = dist/switchery.css
  15. CSS_MIN_DEST = dist/switchery.min.css
  16. #
  17. # All
  18. #
  19. all: install
  20. #
  21. # Install
  22. #
  23. install: node_modules components build
  24. #
  25. # Make a new development build
  26. #
  27. build: components switchery.js switchery.css
  28. @$(COMPONENT_BUILD) --dev
  29. #
  30. # Install components (+ dev)
  31. #
  32. components: component.json
  33. @$(COMPONENT_INSTALL) --dev
  34. #
  35. # Make a standalone version that doesn't depend on component etc.
  36. #
  37. standalone: build components
  38. @$(COMPONENT_BUILD) -s $(NAME) -o .
  39. @mv build.js $(JS_DEST)
  40. @mv build.css $(CSS_DEST)
  41. @$(UGLIFYJS) $(JS_DEST) --output $(JS_MIN_DEST)
  42. @$(UGLIFYCSS) $(CSS_DEST) > $(CSS_MIN_DEST)
  43. #
  44. # Install Node.js modules
  45. #
  46. node_modules:
  47. @npm install
  48. #
  49. # Clean all
  50. #
  51. clean: clean-components clean-node
  52. #
  53. # Clean components & build
  54. #
  55. clean-components:
  56. @rm -rf build
  57. @rm -rf components
  58. #
  59. # Clean the installed Node.js modules
  60. #
  61. clean-node:
  62. @rm -rf node_modules
  63. #
  64. # Instructions
  65. #
  66. .PHONY: clean build components