title: Start erlang with user defined variable (using rebar)?
body: <p>I'd like to be able to use the following macro in my modules:</p>
  
  <pre><code>-ifdef(debug).
  </code></pre>
  
  <p>My startup script looks something like the following:</p>
  
  <pre><code>#!/bin/sh
  PWD="$(pwd)"
  #NAME="$(basename $PWD)"
  erl -pa "$PWD/ebin" deps/*/ebin -boot start_sasl \
      -name foo@127.0.0.1 \
      -debug 1 \
      -s $NAME \
      +K true \
      +P 65536 
  </code></pre>
  
  <p>What else would need to be added so that debug is defined in my module? I need this to be dynamic so I don't have to modify source code for deployment into production. Using different startup scripts per dev/qa/prod environments is fine, but modifying source code shouldn't be necessary.</p>
  
  <p>With <code>erlc</code> this can be done with <code>-Ddebug</code>. I use rebar however, and am not sure how to do it with that. I've tried adding the following to my rebar.config:</p>
  
  <p><code>{erl_opts, [{D, "debug"}]}.</code></p>
  
  <p>This gives the following error:</p>
  
  <pre><code>{error,
   {1,
    erl_parse,
    "bad term"}}
  </code></pre>