<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="bbPress/1.0.2" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>LeafLabs Garden &#187; Topic: How to use more than one source file</title>
		<link>http://forums.leaflabs.com/topic.php?id=180</link>
		<description>A place to share, learn, and grow...</description>
		<language>en-US</language>
		<pubDate>Fri, 22 Jan 2016 00:12:55 +0000</pubDate>
		<generator>http://bbpress.org/?v=1.0.2</generator>
		<textInput>
			<title><![CDATA[Search]]></title>
			<description><![CDATA[Search all topics from these forums.]]></description>
			<name>q</name>
			<link>http://forums.leaflabs.com/search.php</link>
		</textInput>
		<atom:link href="http://forums.leaflabs.com/rss.php?topic=180" rel="self" type="application/rss+xml" />

		<item>
			<title>robodude666 on "How to use more than one source file"</title>
			<link>http://forums.leaflabs.com/topic.php?id=180#post-4610</link>
			<pubDate>Sat, 14 May 2011 19:32:38 +0000</pubDate>
			<dc:creator>robodude666</dc:creator>
			<guid isPermaLink="false">4610@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;Nothing specific.&#60;/p&#62;
&#60;p&#62;After a few hours of messing around, and referencing my AVR makefiles, I ended up with something similar though not as pretty. I'll update my makefile later when I reorganize my project.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>mbolivar on "How to use more than one source file"</title>
			<link>http://forums.leaflabs.com/topic.php?id=180#post-4604</link>
			<pubDate>Sat, 14 May 2011 17:41:53 +0000</pubDate>
			<dc:creator>mbolivar</dc:creator>
			<guid isPermaLink="false">4604@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;robodude666,&#60;/p&#62;
&#60;p&#62;Not sure what you mean by &#34;pretty&#34; -- what sort of thing would you like?&#60;/p&#62;
&#60;p&#62;If you don't like the idea of linking against libmaple.a, you may be able to modify Xavier's setup in his preen project to your purposes:&#60;/p&#62;
&#60;p&#62;&#60;a href=&#34;https://github.com/Ixox/preen&#34; rel=&#34;nofollow&#34;&#62;https://github.com/Ixox/preen&#60;/a&#62;
&#60;/p&#62;</description>
		</item>
		<item>
			<title>robodude666 on "How to use more than one source file"</title>
			<link>http://forums.leaflabs.com/topic.php?id=180#post-4600</link>
			<pubDate>Sat, 14 May 2011 15:04:45 +0000</pubDate>
			<dc:creator>robodude666</dc:creator>
			<guid isPermaLink="false">4600@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;Until a pretty way for supporting multiple source files is released, is it possible to have some documentation on how to &#34;hack&#34; the &#60;code&#62;build-targets.mk&#60;/code&#62; file to support multiple source files? I have my main.cpp file, but I also have a few other c and cpp files I need compiled. I could of course copy everything into main.cpp, but then I'd have an unorganized mess.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>mbolivar on "How to use more than one source file"</title>
			<link>http://forums.leaflabs.com/topic.php?id=180#post-4516</link>
			<pubDate>Fri, 06 May 2011 17:50:59 +0000</pubDate>
			<dc:creator>mbolivar</dc:creator>
			<guid isPermaLink="false">4516@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;Tokenekie,&#60;/p&#62;
&#60;p&#62;Modifying build-targets.mk was a hack I proposed so that snigelen could get his job done.  The right thing to do for multiple source files is to link against a precompiled libmaple archive.  Instructions for building a libmaple.a are in the top-level README of libmaple's master branch (at the bottom, section &#34;Instructions to create a library&#34;). (This information will be folded into the official 0.0.10 docs).&#60;/p&#62;
&#60;p&#62;If you're asking for more information about libmaple's build structure, it is based on the recommendations made in the paper &#34;Recursive Make Considered Harmful&#34;:&#60;/p&#62;
&#60;p&#62;&#60;a href=&#34;http://miller.emu.id.au/pmiller/books/rmch/&#34; rel=&#34;nofollow&#34;&#62;http://miller.emu.id.au/pmiller/books/rmch/&#60;/a&#62;
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Tokenekie on "How to use more than one source file"</title>
			<link>http://forums.leaflabs.com/topic.php?id=180#post-4501</link>
			<pubDate>Thu, 05 May 2011 17:15:25 +0000</pubDate>
			<dc:creator>Tokenekie</dc:creator>
			<guid isPermaLink="false">4501@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;Sorry, I'm new to makefiles and build-targets.mk makes no sense to me right now.&#60;/p&#62;
&#60;p&#62;Where can I learn to understand the &#34;prerequisites&#34; of build-targets.mk if I need to compile other source files within my project folder during make?
&#60;/p&#62;</description>
		</item>
		<item>
			<title>mbolivar on "How to use more than one source file"</title>
			<link>http://forums.leaflabs.com/topic.php?id=180#post-1200</link>
			<pubDate>Mon, 13 Sep 2010 15:17:58 +0000</pubDate>
			<dc:creator>mbolivar</dc:creator>
			<guid isPermaLink="false">1200@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;Great, glad to hear it!  Let us know if you run into any more problems.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>snigelen on "How to use more than one source file"</title>
			<link>http://forums.leaflabs.com/topic.php?id=180#post-1199</link>
			<pubDate>Mon, 13 Sep 2010 15:11:44 +0000</pubDate>
			<dc:creator>snigelen</dc:creator>
			<guid isPermaLink="false">1199@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;Yeah, that seems to work. I've got a small test.h/test.c to compile and link with the main program.&#60;br /&#62;
Thanks!
&#60;/p&#62;</description>
		</item>
		<item>
			<title>mbolivar on "How to use more than one source file"</title>
			<link>http://forums.leaflabs.com/topic.php?id=180#post-1194</link>
			<pubDate>Mon, 13 Sep 2010 14:23:55 +0000</pubDate>
			<dc:creator>mbolivar</dc:creator>
			<guid isPermaLink="false">1194@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;I see what you mean. The make rule which targeted main.o was previously in a pretty hidden place; I've pushed a change to our libmaple github repository which exposes it:&#60;br /&#62;
    $ cd $LIB_MAPLE_HOME&#60;br /&#62;
    $ git pull&#60;/p&#62;
&#60;p&#62;You should see some noise about build-targets.mk, and the top-level directory will then contain a file by that name.  That's where the rule to build main.o lives.  Copy it over to your project directory as well (the same way you did with the Makefile). Hopefully, you can add to its prerequisites to get everything to build correctly for your project; if you're using emacs and make, hopefully you know what that means.&#60;/p&#62;
&#60;p&#62;I realize that this is not too user-friendly and apologize, but we're all pushing towards IDE 0.0.7 at the moment.  We'll fix things up later so you'll only have to edit a list of your c/c++ sources and update this thread then.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>snigelen on "How to use more than one source file"</title>
			<link>http://forums.leaflabs.com/topic.php?id=180#post-1193</link>
			<pubDate>Mon, 13 Sep 2010 13:05:52 +0000</pubDate>
			<dc:creator>snigelen</dc:creator>
			<guid isPermaLink="false">1193@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;Yes header files are included. But the .c-files aren't compiled, and if I can make them be compiled, the wirish and libmaple directories aren't in the include path. And if I manage to get the include path there, the compiled object files aren't linked with the final app...&#60;/p&#62;
&#60;p&#62;But do you mean that if I have foo.h and foo.c (or .cpp) in the same directory as main.cpp it's supposed to work without mentioning any of them in the Makefile? In my tests it was diskio.h, sd_spi_stm32.c, ff.h, ff.c (i.e. not always .h/.c-pairs) for a start, but no .c file is compiled.&#60;/p&#62;
&#60;p&#62;(btw. I'm not talking about the IDE, I prefer to use emacs and make)
&#60;/p&#62;</description>
		</item>
		<item>
			<title>mbolivar on "How to use more than one source file"</title>
			<link>http://forums.leaflabs.com/topic.php?id=180#post-1191</link>
			<pubDate>Mon, 13 Sep 2010 12:45:43 +0000</pubDate>
			<dc:creator>mbolivar</dc:creator>
			<guid isPermaLink="false">1191@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;If you have more than one file, they have to be #include-d from main.cpp as appropriate, but that should just work.  Have you tried that?
&#60;/p&#62;</description>
		</item>
		<item>
			<title>snigelen on "How to use more than one source file"</title>
			<link>http://forums.leaflabs.com/topic.php?id=180#post-1176</link>
			<pubDate>Mon, 13 Sep 2010 02:27:29 +0000</pubDate>
			<dc:creator>snigelen</dc:creator>
			<guid isPermaLink="false">1176@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;How do I add more source files to the Makefile when using the Unix-toolchain? I've tried a lot of different things but there's always something missing.
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
