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.

81 lines
2.0 KiB

4 years ago
3 years ago
3 years ago
3 years ago
4 years ago
3 years ago
4 years ago
  1. ROPTS=-zav --no-p --chmod=u=rw,g=rw,o=r --delete --exclude=www/.htaccess --exclude=.svn --exclude=.git --exclude=*.mtt --exclude=tpl/css --exclude=www/file --exclude=*node_modules* --exclude=*.php --exclude=tests.n
  2. LANG=fr
  3. PLUGINS?=0
  4. ENV?="dev"
  5. #To compile project with plugins, add PLUGINS=1 or type `export PLUGINS=1`
  6. install:
  7. #copy config file from template first time only
  8. @if [ ! -f config.xml ]; then \
  9. cp config.xml.dist config.xml; \
  10. fi
  11. @if [ $(ENV) = "dev" ]; then \
  12. make install_dev; \
  13. fi
  14. #setup dev environnement from source
  15. install_dev:
  16. #set config file to debug=1
  17. #@sed -e 's?debug=.*?debug="1"?g' --in-place config.xml
  18. #install haxe dependencies in .haxelib
  19. haxelib newrepo
  20. haxelib -always install cagette.hxml
  21. haxelib -always install cagetteJs.hxml
  22. #template tools
  23. haxelib run templo
  24. sudo mv temploc2 /usr/bin
  25. #install npm dependencies
  26. npm install
  27. npm run libs:dev
  28. npm run build:js
  29. #compile
  30. @make css
  31. @make compile
  32. @make frontend
  33. @make templates
  34. @echo "Well, it looks like everything is fine : librairies are installed, backend and frontend has been compiled !"
  35. #compile backend to Neko
  36. compile:
  37. @if [ $(PLUGINS) = 1 ]; then \
  38. echo "compile CagettePéi plugins"; \
  39. haxe cagetteAllPlugins.hxml; \
  40. else \
  41. echo "compile CagettePéi core"; \
  42. haxe cagette.hxml; \
  43. fi
  44. #compile SASS files to CSS
  45. css:
  46. npm run build:sass
  47. #compile frontend to JS
  48. frontend:
  49. @if [ $(PLUGINS) = 1 ]; then \
  50. haxe cagetteAllPluginsJs.hxml; \
  51. else \
  52. haxe cagetteJs.hxml; \
  53. fi
  54. mkdir -p tmp
  55. chown www-data:www-data tmp
  56. #update POT file from source
  57. i18n:
  58. haxe potGeneration.hxml
  59. #compile templates in each language, required for production env.
  60. templates:
  61. mkdir -p lang/master/tmp
  62. haxe cagette.hxml -D i18n_generation
  63. @make LANG=fr ctemplates
  64. msgfmt www/lang/texts_fr.po -o www/lang/texts_fr.mo
  65. chown www-data:www-data -R www
  66. chown www-data:www-data -R lang/fr
  67. ctemplates:
  68. (cd lang/$(LANG)/tpl; temploc2 -macros macros.mtt -output ../tmp/ *.mtt */*.mtt */*/*.mtt)