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.

83 lines
2.0 KiB

4 years ago
4 years ago
4 years ago
4 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. #extra plugins
  26. @if [ $(PLUGINS) = 1 ]; then \
  27. fi
  28. #install npm dependencies
  29. npm install
  30. npm run libs:dev
  31. npm run build:js
  32. #compile
  33. @make css
  34. @make compile
  35. @make frontend
  36. @make templates
  37. @echo "Well, it looks like everything is fine : librairies are installed, backend and frontend has been compiled !"
  38. #compile backend to Neko
  39. compile:
  40. @if [ $(PLUGINS) = 1 ]; then \
  41. echo "compile Cagette.net with plugins"; \
  42. haxe cagetteAllPlugins.hxml; \
  43. else \
  44. echo "compile CagettePéi core"; \
  45. haxe cagette.hxml; \
  46. fi
  47. #compile SASS files to CSS
  48. css:
  49. npm run build:sass
  50. #compile frontend to JS
  51. frontend:
  52. @if [ $(PLUGINS) = 1 ]; then \
  53. haxe cagetteAllPluginsJs.hxml; \
  54. else \
  55. haxe cagetteJs.hxml; \
  56. fi
  57. mkdir -p tmp
  58. chown www-data:www-data tmp
  59. #update POT file from source
  60. i18n:
  61. haxe potGeneration.hxml
  62. #compile templates in each language, required for production env.
  63. templates:
  64. mkdir -p lang/master/tmp
  65. haxe cagette.hxml -D i18n_generation
  66. @make LANG=fr ctemplates
  67. msgfmt www/lang/texts_fr.po -o www/lang/texts_fr.mo
  68. chown www-data:www-data -R www
  69. ctemplates:
  70. (cd lang/$(LANG)/tpl; temploc2 -macros macros.mtt -output ../tmp/ *.mtt */*.mtt */*/*.mtt)