<?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 Related in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/make-file-related/m-p/4204588#M91535</link>
    <description>&lt;!-- !*# --&gt;&lt;P&gt;You can create your own compile rules:&lt;BR /&gt;$(objdir)/foo.o: foo.c&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $(CC) -o $@ -c foo.c $(CFLAGS)&lt;BR /&gt;&lt;BR /&gt;And when you link, you use a macro with a list of all of the objects created as above.&lt;/P&gt;</description>
    <pubDate>Sun, 11 Sep 2011 21:59:25 GMT</pubDate>
    <dc:creator>Dennis Handly</dc:creator>
    <dc:date>2011-09-11T21:59:25Z</dc:date>
    <item>
      <title>Make file Related</title>
      <link>https://community.hpe.com/t5/operating-system-linux/make-file-related/m-p/4204587#M91534</link>
      <description>How to make .o files to get created in a different directory and how to make use of them (from different directories) in linking?</description>
      <pubDate>Mon, 26 May 2008 11:50:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/make-file-related/m-p/4204587#M91534</guid>
      <dc:creator>Anil Kumar Malepati</dc:creator>
      <dc:date>2008-05-26T11:50:05Z</dc:date>
    </item>
    <item>
      <title>Re: Makefile Related</title>
      <link>https://community.hpe.com/t5/operating-system-linux/make-file-related/m-p/4204588#M91535</link>
      <description>&lt;!-- !*# --&gt;&lt;P&gt;You can create your own compile rules:&lt;BR /&gt;$(objdir)/foo.o: foo.c&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $(CC) -o $@ -c foo.c $(CFLAGS)&lt;BR /&gt;&lt;BR /&gt;And when you link, you use a macro with a list of all of the objects created as above.&lt;/P&gt;</description>
      <pubDate>Sun, 11 Sep 2011 21:59:25 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/make-file-related/m-p/4204588#M91535</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2011-09-11T21:59:25Z</dc:date>
    </item>
    <item>
      <title>Re: Make file Related</title>
      <link>https://community.hpe.com/t5/operating-system-linux/make-file-related/m-p/4204589#M91536</link>
      <description>&lt;!--!*#--&gt;Hi,&lt;BR /&gt;&lt;BR /&gt;you can else use the VPATH macro to reference source files not residing in the current dir (see manual).&lt;BR /&gt;&lt;BR /&gt;For linking it's best to build libraries out of your object files (perhaps one lib per directory?) and reference these.&lt;BR /&gt;&lt;BR /&gt;In dir1/Makefile:&lt;BR /&gt;...&lt;BR /&gt;OBJS=$(SRCS:.c=.o)&lt;BR /&gt;$(LIBDIR)/libdir1.a: $(OBJS)&lt;BR /&gt;   ar c $@ $(OBJS)&lt;BR /&gt;&lt;BR /&gt;In exe/Makefile:&lt;BR /&gt;...&lt;BR /&gt;USERLIBS=-L$(LIBDIR) -ldir1 -ldir2 ...&lt;BR /&gt;...&lt;BR /&gt;myexe:&lt;BR /&gt;   $(CC) -o $@ ... $(USERLIBS) ...&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;mfG Peter&lt;BR /&gt;</description>
      <pubDate>Mon, 26 May 2008 15:46:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/make-file-related/m-p/4204589#M91536</guid>
      <dc:creator>Peter Nikitka</dc:creator>
      <dc:date>2008-05-26T15:46:37Z</dc:date>
    </item>
    <item>
      <title>Re: Make file Related</title>
      <link>https://community.hpe.com/t5/operating-system-linux/make-file-related/m-p/4204590#M91537</link>
      <description>I tried using VPATH. But it doesn't find the source files in a different directory. Following is the make file contents.&lt;BR /&gt;&lt;BR /&gt;LIBDIR=${PWD}/lib&lt;BR /&gt;BINDIR=${PWD}/bin&lt;BR /&gt;SRCDIR=${PWD}/src&lt;BR /&gt;&lt;BR /&gt;VPATH=${SRCDIR}&lt;BR /&gt;&lt;BR /&gt;all: clean ${LIBDIR}/session.o&lt;BR /&gt;#${LIBDIR}/session.o: ${SRCDIR}/session.c ${SRCDIR}/session.h&lt;BR /&gt;#       ${CC} ${CFLAGS} -o $@ -c ${SRCDIR}/session.c&lt;BR /&gt;&lt;BR /&gt;${LIBDIR}/session.o: session.c session.h&lt;BR /&gt;        ${CC} ${CFLAGS} -o $@ -c session.c&lt;BR /&gt;&lt;BR /&gt;clean:&lt;BR /&gt;        rm -f ${LIBDIR}/*.o&lt;BR /&gt;        rm -f ${BINDIR}/*&lt;BR /&gt;&lt;BR /&gt;Make fails with the following error</description>
      <pubDate>Tue, 27 May 2008 07:04:03 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/make-file-related/m-p/4204590#M91537</guid>
      <dc:creator>Anil Kumar Malepati</dc:creator>
      <dc:date>2008-05-27T07:04:03Z</dc:date>
    </item>
    <item>
      <title>Re: Make file Related</title>
      <link>https://community.hpe.com/t5/operating-system-linux/make-file-related/m-p/4204591#M91538</link>
      <description>Forgot pasting the error in my reply (above).&lt;BR /&gt;(Bundled) cc: error 1913: `session.c' does not exist or cannot be read&lt;BR /&gt;*** Error exit code 1</description>
      <pubDate>Tue, 27 May 2008 07:12:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/make-file-related/m-p/4204591#M91538</guid>
      <dc:creator>Anil Kumar Malepati</dc:creator>
      <dc:date>2008-05-27T07:12:10Z</dc:date>
    </item>
    <item>
      <title>Re: Makefile Related</title>
      <link>https://community.hpe.com/t5/operating-system-linux/make-file-related/m-p/4204592#M91539</link>
      <description>&lt;P&gt;&amp;gt;I tried using VPATH. But it doesn't find the source files in a different directory.&lt;BR /&gt;&lt;BR /&gt;Why are you using new-fangled VPATH?&lt;BR /&gt;Why not the tried and true relative path that points exactly to it?&lt;BR /&gt;&lt;BR /&gt;If you use VPATH, as with any new and hard to use option, you need to read the documentation:&lt;BR /&gt;&lt;A target="_blank" href="http://www.gnu.org/software/automake/manual/make/General-Search.html#General-Search"&gt;http://www.gnu.org/software/automake/manual/make/General-Search.html#General-Search&lt;/A&gt;&lt;BR /&gt;&lt;A target="_blank" href="http://www.gnu.org/software/automake/manual/make/Commands_002fSearch.html#Commands_002fSearch"&gt;http://www.gnu.org/software/automake/manual/make/Commands_002fSearch.html#Commands_002fSearch&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;The second link indicates you need to use "$^" instead of session.c.&lt;BR /&gt;Unfortunately, make(1) while it documents VPATH, it is almost useless since it doesn't mention "$^" nor say that "$&amp;lt;" works for anything except inference rules.&lt;BR /&gt;&lt;BR /&gt;#${LIBDIR}/session.o: ${SRCDIR}/session.c ${SRCDIR}/session.h&lt;BR /&gt;# ${CC} ${CFLAGS} -o $@ -c ${SRCDIR}/session.c&lt;BR /&gt;&lt;BR /&gt;I assume this works?&lt;BR /&gt;&lt;BR /&gt;&amp;gt;(Bundled) cc: error 1913: `session.c' does not exist or cannot be read&lt;BR /&gt;&lt;BR /&gt;This indicates that VPATH isn't working.&lt;BR /&gt;Also, why are you using cc_bundled(1)?&lt;/P&gt;</description>
      <pubDate>Sun, 11 Sep 2011 22:00:35 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/make-file-related/m-p/4204592#M91539</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2011-09-11T22:00:35Z</dc:date>
    </item>
  </channel>
</rss>

