title: How to pass compile time parameter for Yocto project?
body: <p>I am new to Yocto build environment. I have a C code which has some code as below:</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  int main ()
  {
      printf("HELLO WORLD\n");
  
  #ifdef MYDEF
      printf("MYDEF is defined\n");
  #endif
  
      return 0;
  }
  </code></pre>
  
  <p>I want to pass a flag/parameter MYDEF in local.conf file. I tried following defines but they didn't work. Any thoughts on what am I doing wrong and what possibly can fix it?</p>
  
  <pre><code>MYDEF = 'y'
  MYDEF ?= 'y'
  MYDEF ??= 'y'
  CFLAGS = "-DMYDEF"
  TARGET_CFLAGS = "-DMYDEF"
  BUILD_CFLAGS = "-DMYDEF"
  </code></pre>
  
  <p>Thanks.</p>