This week only. Pastebin PRO Accounts Christmas Special! Don't miss out!Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Sep 8th, 2012  |  syntax: None  |  size: 1.07 KB  |  views: 24  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. #!/bin/sh
  2.  
  3. if [ "$1" == "" ]; then
  4.     echo "usage:
  5. $0 application-name
  6. create application skeleton in current folder"
  7.     exit
  8. fi
  9.  
  10.  
  11. mkdir -p $1
  12. mkdir -p $1/ebin
  13. mkdir -p $1/tests
  14. mkdir -p $1/scripts
  15. #
  16. # mkdir -p $1/support
  17. #
  18. mkdir -p $1/src
  19. cat <<EOF > $1/src/$1.app
  20. {application, $1,
  21.  [
  22.   {description, ""}, %% description here
  23.   {vsn, "0.0"},      %% version
  24.   {id, "$1"},        %% identifier
  25.   %% {modules,      []},
  26.   {applications, [kernel, stdlib]}, %% dependences
  27.   %%  {mod, {$1, START_ARGS}},  %% Specify the module name to start the application, plus args
  28.   {env, []} %% environement
  29.  ]
  30. }.
  31. EOF
  32.  
  33. cat <<EOF > $1/src/Makefile
  34. include ../support/include.mk
  35.  
  36. all: $(EBIN_FILES)
  37.  
  38. debug:
  39.         $(MAKE) DEBUG=-DDEBUG
  40.  
  41. clean:
  42.         rm -rf $(EBIN_FILES)
  43.  
  44. EOF
  45.  
  46. cat <<EOF > $1/Makefile
  47. all:
  48.         (cd src;$(MAKE))
  49.  
  50. clean:
  51.         (cd src;$(MAKE) clean)
  52.         (cd tests;$(MAKE) clean)
  53.  
  54. test: all
  55.         (cd tests;$(MAKE) test)
  56.        
  57. clean_logs:
  58.         (cd tests;$(MAKE) clean_logs)
  59.  
  60. compile:
  61.         erl -make
  62.         cp src/$1.app ebin/$1.app      
  63. clean:
  64.         rm -rf ./ebin/*.*
  65.  
  66. EOF
  67.  
  68. echo "Project skeleton created.
  69. change project settings in  $1/src/$1.app
  70. "
clone this paste RAW Paste Data