<?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: Makefile Error in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/makefile-error/m-p/4046989#M94181</link>
    <description>&lt;BR /&gt;Doesn't -o need to be followed immediately with the output filename?  Something like cc -o test -c test.c&lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Tue, 31 Jul 2007 08:29:16 GMT</pubDate>
    <dc:creator>Dave Hutton</dc:creator>
    <dc:date>2007-07-31T08:29:16Z</dc:date>
    <item>
      <title>Makefile Error</title>
      <link>https://community.hpe.com/t5/operating-system-linux/makefile-error/m-p/4046988#M94180</link>
      <description>Hi all,&lt;BR /&gt;&lt;BR /&gt;1)I have written a small C- Program and wtitten the following makefile.&lt;BR /&gt;&lt;BR /&gt;CC  = cc&lt;BR /&gt;CFLAGS = -o&lt;BR /&gt;OBJS = Test.o&lt;BR /&gt;TARGET  = Test&lt;BR /&gt;&lt;BR /&gt;Test : $(OBJS)&lt;BR /&gt;#       echo "Hello"&lt;BR /&gt;       $(CC) -o $@ $+&lt;BR /&gt;&lt;BR /&gt;%.o : Test.c&lt;BR /&gt;        #echo $+&lt;BR /&gt;        $(CC) -c $+&lt;BR /&gt;&lt;BR /&gt;clean : Test Test.o&lt;BR /&gt;        rm Test Test.o&lt;BR /&gt;&lt;BR /&gt;        If i run the Makefile i m not able to&lt;BR /&gt;get the exe Test.&lt;BR /&gt;&lt;BR /&gt;        It says&lt;BR /&gt;&lt;BR /&gt;bash-2.04$ make -f TestMakefile      &lt;BR /&gt;        cc -o -c Test.c&lt;BR /&gt;cc: error 1410: Illegal name for output file: "-c".&lt;BR /&gt;*** Error exit code 8&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;       I am not understanding what i have missed here.&lt;BR /&gt;&lt;BR /&gt; 2)Also i want to write a Makefile wherein i can test the conditions &lt;BR /&gt;   for ex- if ($Var1)&lt;BR /&gt;               CC Test.c&lt;BR /&gt;           else($Var2)&lt;BR /&gt;               GCC Test.c &lt;BR /&gt;&lt;BR /&gt;         I know (please correct me if i m wrong) i cant write the if loops in Makefile .&lt;BR /&gt;   But, i want to know how can i achieve the above goal in Makefile.  &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;  Please suggest some solutions to these problems .&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;thanks and regards&lt;BR /&gt;Vikram&lt;BR /&gt;            &lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 31 Jul 2007 08:21:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/makefile-error/m-p/4046988#M94180</guid>
      <dc:creator>CA1490051</dc:creator>
      <dc:date>2007-07-31T08:21:48Z</dc:date>
    </item>
    <item>
      <title>Re: Makefile Error</title>
      <link>https://community.hpe.com/t5/operating-system-linux/makefile-error/m-p/4046989#M94181</link>
      <description>&lt;BR /&gt;Doesn't -o need to be followed immediately with the output filename?  Something like cc -o test -c test.c&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 31 Jul 2007 08:29:16 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/makefile-error/m-p/4046989#M94181</guid>
      <dc:creator>Dave Hutton</dc:creator>
      <dc:date>2007-07-31T08:29:16Z</dc:date>
    </item>
    <item>
      <title>Re: Makefile Error</title>
      <link>https://community.hpe.com/t5/operating-system-linux/makefile-error/m-p/4046990#M94182</link>
      <description>&lt;!--!*#--&gt;&amp;gt;  Doesn't -o need to be followed immediately&lt;BR /&gt;&amp;gt; with the output filename?  [...]&lt;BR /&gt;&lt;BR /&gt;Exactly.  Typically, when "cc -c" isn't good&lt;BR /&gt;enough, the "make" file will include an&lt;BR /&gt;explict rule which includes the "-o" option.&lt;BR /&gt;For example, to create both fred.o and&lt;BR /&gt;fred_.o from fred.c (using an additional&lt;BR /&gt;"-DUTIL" for fred_.o):&lt;BR /&gt;&lt;BR /&gt;.SUFFIXES:&lt;BR /&gt;.SUFFIXES: _.o .o .c&lt;BR /&gt;.c_.o:&lt;BR /&gt;        $(CC) -c $(CFLAGS) -DUTIL -o $@ $&amp;lt;&lt;BR /&gt;&lt;BR /&gt;.c.o:&lt;BR /&gt;        $(CC) -c $(CFLAGS) $&amp;lt;&lt;BR /&gt;</description>
      <pubDate>Tue, 31 Jul 2007 11:36:41 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/makefile-error/m-p/4046990#M94182</guid>
      <dc:creator>Steven Schweda</dc:creator>
      <dc:date>2007-07-31T11:36:41Z</dc:date>
    </item>
    <item>
      <title>Re: Makefile Error</title>
      <link>https://community.hpe.com/t5/operating-system-linux/makefile-error/m-p/4046991#M94183</link>
      <description>sample Makefile&lt;BR /&gt;CC can be set in the environment variable&lt;BR /&gt;&lt;BR /&gt;export CC=aCC&lt;BR /&gt;or&lt;BR /&gt;export CC=cc&lt;BR /&gt;&lt;BR /&gt;[code]&lt;BR /&gt;#CC=cc This is commented here.&lt;BR /&gt;SOURCE=Test.c&lt;BR /&gt;OBJS=$(SOURCE:.c=.o)&lt;BR /&gt;BUILD=$(OBJS:.o=)&lt;BR /&gt;&lt;BR /&gt;$(BUILD): $(OBJS)&lt;BR /&gt; @[[ "$$CC" != "cc" ]] ; \&lt;BR /&gt; echo SOURCE set ; \&lt;BR /&gt; echo $(SOURCE) ; \&lt;BR /&gt; echo "BUILDING ... " $@&lt;BR /&gt; $(CC) $(OBJS) -o Test&lt;BR /&gt;$(OBJS): $(SOURCE)&lt;BR /&gt; $(CC) +DAportable -c $(SOURCE)&lt;BR /&gt;clean:&lt;BR /&gt; rm -f $(BUILD) $(OBJS)&lt;BR /&gt;[/code]</description>
      <pubDate>Wed, 01 Aug 2007 04:05:26 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/makefile-error/m-p/4046991#M94183</guid>
      <dc:creator>MurugesanGCT</dc:creator>
      <dc:date>2007-08-01T04:05:26Z</dc:date>
    </item>
    <item>
      <title>Re: Makefile Error</title>
      <link>https://community.hpe.com/t5/operating-system-linux/makefile-error/m-p/4046992#M94184</link>
      <description>As Dave and Steven point out, you would never ever have a naked -o in CFLAGS.&lt;BR /&gt;Perhaps you have a typo and mean the typically CFLAGS default of -O, for optimization?&lt;BR /&gt;&lt;BR /&gt;&amp;gt;2)Also i want to write a Makefile wherein i can test the conditions&lt;BR /&gt;&lt;BR /&gt;You can only do that in gmake.&lt;BR /&gt;&lt;BR /&gt;&amp;gt;MurugesanGCT: CC can be set in the environment variable&lt;BR /&gt;&lt;BR /&gt;Typically this is not a good practice.  It is better if you put it on the make command line:&lt;BR /&gt;$ make CC=cc&lt;BR /&gt;&lt;BR /&gt;(And don't even think of using -e. ;-)</description>
      <pubDate>Wed, 01 Aug 2007 07:10:47 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/makefile-error/m-p/4046992#M94184</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2007-08-01T07:10:47Z</dc:date>
    </item>
  </channel>
</rss>

