<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Set make file variable depending on Target in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/set-make-file-variable-depending-on-target/m-p/6775201#M494637</link>
    <description>&lt;P&gt;&amp;nbsp;&amp;nbsp; Are you talking about using what the GNU "make" folks call a&lt;BR /&gt;'sub-"make"'?&amp;nbsp; For example (tested on a Mac, using "GNU Make 3.81", but&lt;BR /&gt;I don't think that there's anything exotic&amp;nbsp;or GNU-specific here):&lt;BR /&gt;&lt;BR /&gt;mba$ cat Makefile&lt;BR /&gt;def:&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $(CC) $(CFLAGS) -o test test.c&lt;BR /&gt;&lt;BR /&gt;alt:&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @$(MAKE) CFLAGS='-O0 -g'&lt;BR /&gt;&lt;BR /&gt;mba$ rm test&lt;BR /&gt;mba$ make&lt;BR /&gt;cc&amp;nbsp; -o test test.c&lt;BR /&gt;&lt;BR /&gt;mba$ rm test&lt;BR /&gt;mba$ make alt&lt;BR /&gt;cc -O0 -g -o test test.c&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; Remove the "@" on the "alt" action line to see what's happening.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; I set CFLAGS, but setting CC should work, too.&lt;/P&gt;</description>
    <pubDate>Sat, 15 Aug 2015 19:59:43 GMT</pubDate>
    <dc:creator>Steven Schweda</dc:creator>
    <dc:date>2015-08-15T19:59:43Z</dc:date>
    <item>
      <title>Set make file variable depending on Target</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/set-make-file-variable-depending-on-target/m-p/6774960#M494635</link>
      <description>&lt;P&gt;Hoe to update Variable in target of a makefile:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;CC=aCC&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;all:&lt;/P&gt;&lt;P&gt;&amp;lt;Builds source&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;update_cc:&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;lt;Here I want&amp;nbsp;CC="cadvice +wall aCC"&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Change_CC: update_cc all&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;---------------------------------------&lt;/P&gt;&lt;P&gt;In above make, if I call &amp;gt;&amp;gt; make&amp;nbsp;&lt;SPAN&gt;Change_CC, It shuold build with "cadvice +wall aCC". Otherwise alll should be same&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 14 Aug 2015 11:33:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/set-make-file-variable-depending-on-target/m-p/6774960#M494635</guid>
      <dc:creator>Debd001</dc:creator>
      <dc:date>2015-08-14T11:33:39Z</dc:date>
    </item>
    <item>
      <title>Re: Set makefile variable depending on target</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/set-make-file-variable-depending-on-target/m-p/6775124#M494636</link>
      <description>&lt;DIV&gt;&lt;DIV&gt;&lt;P&gt;&amp;gt;How to update variable in target of a makefile&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I don't think you can, those lines are passed to the shell.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;SPAN&gt;&amp;gt;I want&amp;nbsp;CC="cadvise +wall aCC"&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The simplest way to do this is set the variable on the command line:&lt;/P&gt;&lt;P&gt;make &lt;SPAN&gt;CC="cadvise +wall aCC"&lt;/SPAN&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 14 Aug 2015 23:50:50 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/set-make-file-variable-depending-on-target/m-p/6775124#M494636</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2015-08-14T23:50:50Z</dc:date>
    </item>
    <item>
      <title>Re: Set make file variable depending on Target</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/set-make-file-variable-depending-on-target/m-p/6775201#M494637</link>
      <description>&lt;P&gt;&amp;nbsp;&amp;nbsp; Are you talking about using what the GNU "make" folks call a&lt;BR /&gt;'sub-"make"'?&amp;nbsp; For example (tested on a Mac, using "GNU Make 3.81", but&lt;BR /&gt;I don't think that there's anything exotic&amp;nbsp;or GNU-specific here):&lt;BR /&gt;&lt;BR /&gt;mba$ cat Makefile&lt;BR /&gt;def:&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $(CC) $(CFLAGS) -o test test.c&lt;BR /&gt;&lt;BR /&gt;alt:&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @$(MAKE) CFLAGS='-O0 -g'&lt;BR /&gt;&lt;BR /&gt;mba$ rm test&lt;BR /&gt;mba$ make&lt;BR /&gt;cc&amp;nbsp; -o test test.c&lt;BR /&gt;&lt;BR /&gt;mba$ rm test&lt;BR /&gt;mba$ make alt&lt;BR /&gt;cc -O0 -g -o test test.c&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; Remove the "@" on the "alt" action line to see what's happening.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; I set CFLAGS, but setting CC should work, too.&lt;/P&gt;</description>
      <pubDate>Sat, 15 Aug 2015 19:59:43 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/set-make-file-variable-depending-on-target/m-p/6775201#M494637</guid>
      <dc:creator>Steven Schweda</dc:creator>
      <dc:date>2015-08-15T19:59:43Z</dc:date>
    </item>
  </channel>
</rss>

