<?xml version="1.0"?>
<rss version="2.0">
	<channel>
		<title>Source distribution</title>
		<link>http://www.allegro.cc/forums/view/589222</link>
		<description>Allegro.cc Forum Thread</description>
		<webMaster>matthew@allegro.cc (Matthew Leverton)</webMaster>
		<lastBuildDate>Fri, 29 Dec 2006 02:15:50 +0000</lastBuildDate>
	</channel>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>This may sound like a silly question, but how do I distribute my source code for Linux and Mac users? The most common problem I see when people distribute a game with source included is Linux/Mac people having to comb through it to change #include&#39;s to fix path issues.</p><p>Are there other things I should avoid, and what should I include with the code? I&#39;ve never made a makefile, will I have to do this?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (ngiacomelli)</author>
		<pubDate>Fri, 22 Dec 2006 04:04:40 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>1. make the source available<br />2. wait for a kindly user to fix the path issues and probably write a makefile<br />3. profit!
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (kazzmir)</author>
		<pubDate>Fri, 22 Dec 2006 04:14:54 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>kazzmir, as much as I enjoy numeric lists, I actually posted here so that I could take steps towards avoiding having a &#39;kindly user&#39; fix my code. </p><p>I keep all of my source and header files in a single directory, so path issues shouldn&#39;t be a problem. Are there any good tutorials for creating my own makefile?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (ngiacomelli)</author>
		<pubDate>Fri, 22 Dec 2006 04:53:22 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p><a href="http://www.gnu.org/software/make/manual/make.html">You could begin with the manual.</a>
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Joel Pettersson)</author>
		<pubDate>Fri, 22 Dec 2006 06:17:15 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
how do I distribute my source code for Linux and Mac users?
</p></div></div><p>
With Linux, you could run a LiveCD and install Allegro (temporarily) for it and fix your code until it compiles and runs.</p><p>I don&#39;t know about the Mac though... If their MacOSX was free I would test it.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Archon)</author>
		<pubDate>Fri, 22 Dec 2006 11:31:58 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I got the hint from your post that you weren&#39;t actually going to try compiling your project for Linux or Mac yourself and just pray to the gods it would work somehow. If thats the case then I guarantee it will fail. If it is not the case then your line of questioning doesn&#39;t make too much sense because if you can&#39;t compile it yourself then how is someone else going to.</p><p>I have Linux and OSX, so I wouldn&#39;t mind fixing it for you( as long as its not a beast of a project ).
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (kazzmir)</author>
		<pubDate>Fri, 22 Dec 2006 11:34:59 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>kazzmir: sorry about the grumpy reply, I must not have been in a particularly festive mood! </p><p>Here&#39;s an example snippet from the file render.c: </p><div class="source-code snippet"><div class="inner"><pre><span class="p">#include &lt;allegro.h&gt;</span>
<span class="p">#include &lt;math.h&gt;</span>
<span class="p">#include &lt;stdio.h&gt;</span>
<span class="p">#include "canvas.h"</span>
<span class="p">#include "application.h"</span>
<span class="p">#include "player.h"</span>
<span class="p">#include "object.h"</span>
<span class="p">#include "monster.h"</span>
<span class="p">#include "shop.h"</span>
<span class="p">#include "map.h"</span>
</pre></div></div><p>

As I stated, all of my files are in the same folder. What I was really hoping to do was create a makefile and then have someone test it, rather than fix my code for me. Are there any other code-related pitfalls I should watch out for?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (ngiacomelli)</author>
		<pubDate>Sat, 23 Dec 2006 21:40:26 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
Are there any other code-related pitfalls I should watch out for?
</p></div></div><p>
I&#39;m not sure what you know, but here&#39;s what I can think of:
</p><ul><li><p>File paths are case sensitive (for linux at least)
</p></li><li><p>Use / instead of \ (for file paths again)
</p></li><li><p>Use &quot;\ &quot; (slash + space) when there is a space
</p></li><li><p>Can&#39;t use winalleg.h without the #ifdef WINDOWS or whatever.
</p></li><li><p>If you change compilers, there may be changes in the syntax (mainly with MSVC vs GCC)
</p></li><li><p>Maybe there could be features not implemented in the MAC OSX version of Allegro
</p></li></ul></div>]]>
		</description>
		<author>no-reply@allegro.cc (Archon)</author>
		<pubDate>Sat, 23 Dec 2006 21:58:28 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><ul><li><p>End-of-line separator is \n\r in the DOS family, \n in *nix, \r on Mac. If you need to read/write TEXT files with the libc functions, be sure to specify &quot;t&quot; in the fopen() mode, and then the functions will interpret your &#39;\n&#39; accordingly.
</p></li></ul></div>]]>
		</description>
		<author>no-reply@allegro.cc (Audric)</author>
		<pubDate>Sun, 24 Dec 2006 01:06:07 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Archon, since when did you need a &#39;\ &#39;?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (James Stanley)</author>
		<pubDate>Sun, 24 Dec 2006 02:35:01 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
Archon, since when did you need a &#39;\ &#39;?
</p></div></div><p>

Alternatively, avoid spaces in filenames.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Indeterminatus)</author>
		<pubDate>Sun, 24 Dec 2006 03:14:52 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>If you don&#39;t include platform-specific headers (ie, only standard C headers and allegro.h), there shouldn&#39;t be a problem with headers. Case sensitivity and / vs \<br /> are the most common problems beside that, but they are easy to fix and avoid.</p><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
Archon, since when did you need a &#39;\ &#39;?
</p></div></div><p>
I&#39;ve always needed it (when there&#39;s a space in the filename). How else do you tell that the space is part of the name and not a separation character (yes, they should be avoided)?</p><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
End-of-line separator is \n\r in the DOS family, \n in *nix, \r on Mac.
</p></div></div><p>
MacOS X is UNIX based, and the line separator is \n.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Evert)</author>
		<pubDate>Sun, 24 Dec 2006 14:45:00 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p><span class="source-code"><a href="http://www.allegro.cc/manual/fix_filename_slashes" target="_blank"><span class="a">fix_filename_slashes</span></a><span class="k2">(</span><span class="k2">)</span></span>
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Andrei Ellman)</author>
		<pubDate>Thu, 28 Dec 2006 23:40:58 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Nial Giacomelli,</p><p>Since most of the regular C/C++ code you will write use the allegro functions (which wraps the appropriate Windows/*nix/Mac calls it needs to do its thing), I would say that most of your code should be easily ported to other platforms.</p><p>Besides the good ideas posted above, you may still have SOME functions that require OS-specific code.  In that case, some people put those specific functions into separate files: dos.c, linux.c, mac.c, win.c, ...</p><p>Then, just like Allegro&#39;s &quot;fix.bat&quot; does, create the different makefiles you wish to use to compile the program.  If you use &quot;fix.bat mac&quot;, it may #include the &quot;makefile.mac&quot;, while the &quot;fix.bat mingw&quot; would #include &quot;makefile.win&quot;, etc.  Those separate makefiles would specify that their respective &quot;OS-specific&quot; files needed to be added to the list of compiled sources when you&#39;re making your final program.</p><p>Then, if you don&#39;t know how to code specifically for the individual OS (like, I don&#39;t know how to code for Mac/Linux very well), someone else may be able to come along and provide the OS-specific things you need for your code, and you can almost entirely dismiss the need for <b>#ifdef WINDOWS</b> or <b>#ifdef LINUX</b>, etc.</p><p>-My 2 cents
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (TeamTerradactyl)</author>
		<pubDate>Fri, 29 Dec 2006 00:26:33 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Another pitfall that is OSX specific: Allegro apps do not run in fullscreen mode in a 16bit depth. If you&#39;re defaulting to 16bit for your project, you need some kind of catch that will find an alternate, or #ifdef block/define to default your Mac build to go 15 (or 32).</p><p>Stuff like this is a pain to know, but once you know it you should be all set. That aside, if you&#39;re worried about compilation issues: if it builds in Linux/Unix with a plain makefile, chances are it should build without a hitch under OSX.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Ultio)</author>
		<pubDate>Fri, 29 Dec 2006 02:15:50 +0000</pubDate>
	</item>
</rss>
