<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://xinu.cs.mu.edu/index.php?action=history&amp;feed=atom&amp;title=Build_System</id>
	<title>Build System - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://xinu.cs.mu.edu/index.php?action=history&amp;feed=atom&amp;title=Build_System"/>
	<link rel="alternate" type="text/html" href="https://xinu.cs.mu.edu/index.php?title=Build_System&amp;action=history"/>
	<updated>2026-06-15T16:09:05Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.34.2</generator>
	<entry>
		<id>https://xinu.cs.mu.edu/index.php?title=Build_System&amp;diff=2681&amp;oldid=prev</id>
		<title>Amallen at 22:45, 17 June 2008</title>
		<link rel="alternate" type="text/html" href="https://xinu.cs.mu.edu/index.php?title=Build_System&amp;diff=2681&amp;oldid=prev"/>
		<updated>2008-06-17T22:45:53Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;Revision as of 22:45, 17 June 2008&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot; &gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Building [[Embedded XINU]] is as simple as typing &amp;lt;code&amp;gt;make&amp;lt;/code&amp;gt; in the &amp;lt;code&amp;gt;compile&amp;lt;/code&amp;gt; directory.  However, if you want to understand how the build system works you'll need to acquaint yourself with the &amp;lt;code&amp;gt;Makefile&amp;lt;/code&amp;gt;.  It should be noted that this is not a recursive build process (make only calls another make process when building the libraries and a few other special cases), but rather a single Makefile that sources rules to build logically separated components.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Building [[Embedded XINU]] is as simple as typing &amp;lt;code&amp;gt;make&amp;lt;/code&amp;gt; in the &amp;lt;code&amp;gt;compile&amp;lt;/code&amp;gt; directory.  However, if you want to understand how the build system works you'll need to acquaint yourself with the &amp;lt;code&amp;gt;Makefile&amp;lt;/code&amp;gt;.  It should be noted that this is not a recursive build process (make only calls another make process when building the libraries and a few other special cases), but rather a single Makefile that sources rules to build logically separated components.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;This is a description of the build process for building &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;XINU from &lt;/del&gt;[[trunk]] and may not be applicable to all versions.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;This is a description of the build process for building &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;the &lt;/ins&gt;[[trunk]] &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;version of XINU &lt;/ins&gt;and may not be applicable to all versions.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Makefile ==&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Makefile ==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Amallen</name></author>
		
	</entry>
	<entry>
		<id>https://xinu.cs.mu.edu/index.php?title=Build_System&amp;diff=2680&amp;oldid=prev</id>
		<title>Amallen at 22:40, 17 June 2008</title>
		<link rel="alternate" type="text/html" href="https://xinu.cs.mu.edu/index.php?title=Build_System&amp;diff=2680&amp;oldid=prev"/>
		<updated>2008-06-17T22:40:47Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;Revision as of 22:40, 17 June 2008&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot; &gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Building [[Embedded XINU]] is as simple as typing &amp;lt;code&amp;gt;make&amp;lt;/code&amp;gt; in the &amp;lt;code&amp;gt;compile&amp;lt;/code&amp;gt; directory.  However, if you want to understand how the build system works you'll need acquaint yourself with the &amp;lt;code&amp;gt;Makefile&amp;lt;/code&amp;gt;.  It should be noted that this is not a recursive build process (make only calls another make process when building the libraries and a few other special cases), but rather a single Makefile that sources rules to build logically separated components.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Building [[Embedded XINU]] is as simple as typing &amp;lt;code&amp;gt;make&amp;lt;/code&amp;gt; in the &amp;lt;code&amp;gt;compile&amp;lt;/code&amp;gt; directory.  However, if you want to understand how the build system works you'll need &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;to &lt;/ins&gt;acquaint yourself with the &amp;lt;code&amp;gt;Makefile&amp;lt;/code&amp;gt;.  It should be noted that this is not a recursive build process (make only calls another make process when building the libraries and a few other special cases), but rather a single Makefile that sources rules to build logically separated components.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;This is a description of the build process for building XINU from [[trunk]] and may not be applicable to all versions.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;This is a description of the build process for building XINU from [[trunk]] and may not be applicable to all versions.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Amallen</name></author>
		
	</entry>
	<entry>
		<id>https://xinu.cs.mu.edu/index.php?title=Build_System&amp;diff=2294&amp;oldid=prev</id>
		<title>Michael: Created page describing the build system of Embedded XINU</title>
		<link rel="alternate" type="text/html" href="https://xinu.cs.mu.edu/index.php?title=Build_System&amp;diff=2294&amp;oldid=prev"/>
		<updated>2008-02-05T23:29:21Z</updated>

		<summary type="html">&lt;p&gt;Created page describing the build system of Embedded XINU&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;Building [[Embedded XINU]] is as simple as typing &amp;lt;code&amp;gt;make&amp;lt;/code&amp;gt; in the &amp;lt;code&amp;gt;compile&amp;lt;/code&amp;gt; directory.  However, if you want to understand how the build system works you'll need acquaint yourself with the &amp;lt;code&amp;gt;Makefile&amp;lt;/code&amp;gt;.  It should be noted that this is not a recursive build process (make only calls another make process when building the libraries and a few other special cases), but rather a single Makefile that sources rules to build logically separated components.&lt;br /&gt;
&lt;br /&gt;
This is a description of the build process for building XINU from [[trunk]] and may not be applicable to all versions.&lt;br /&gt;
&lt;br /&gt;
== Makefile ==&lt;br /&gt;
&lt;br /&gt;
Open &amp;lt;code&amp;gt;compile/Makefile&amp;lt;/code&amp;gt; and you'll discover numerous variables and settings for building XINU.  The first is the directive to &amp;lt;code&amp;gt;include mipsVars&amp;lt;/code&amp;gt;.  This simply adds the contents of the &amp;lt;code&amp;gt;compile/mipsVars&amp;lt;/code&amp;gt; file to the Makefile.  We chose to &amp;lt;code&amp;gt;include&amp;lt;/code&amp;gt; this file so that moving from system to system is easier by storing dynamic variables in an external file.  The less we change the Makefile the better.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;mipsVars&amp;lt;/code&amp;gt; defines the location of the [[cross-compiler]] and various flags for compiling C and assembly source files.&lt;br /&gt;
&lt;br /&gt;
After the local configuration is included we set a number of variables giving the final compiled image name, an archive file to create (if requested), where the main program is located, flags to pass to the loader, and file locations.  Then there is the default make target which will be called when &amp;lt;code&amp;gt;make&amp;lt;/code&amp;gt; with no arguments is typed at the shell prompt.&lt;br /&gt;
&lt;br /&gt;
Now, the next two variables are very important. &amp;lt;code&amp;gt;COMPS&amp;lt;/code&amp;gt; is a listing of the major system [[components]] we should include while building.  Similarly &amp;lt;code&amp;gt;LIBS&amp;lt;/code&amp;gt; is a listing of the libraries we will include when building the system.  From the &amp;lt;code&amp;gt;COMPS&amp;lt;/code&amp;gt; line we use another &amp;lt;code&amp;gt;include&amp;lt;/code&amp;gt; directive, this time sourcing a &amp;lt;code&amp;gt;Makerules&amp;lt;/code&amp;gt; file located in the directory to which each component points.  Each Makerules file will append the source files to build that component into the kernel image.  After all the source files are loaded, the Makefile converts the collection of C source files and assembly files to make one massive listing of object files.&lt;br /&gt;
&lt;br /&gt;
Now, that all the important variables are set up there are a number of targets that can be executed.  The most common target is &amp;lt;code&amp;gt;${BOOTIMAGE}&amp;lt;/code&amp;gt; (which is typically &amp;lt;code&amp;gt;xinu.boot&amp;lt;/code&amp;gt;), this depends on all the object files, library files, and the loader script.  Then it will link all the object files together to create the boot image.  There is also a &amp;lt;code&amp;gt;objects&amp;lt;/code&amp;gt; target that will only build the object files for the system (and not link them).&lt;br /&gt;
&lt;br /&gt;
There are several ways of cleaning the source tree.  &amp;lt;code&amp;gt;make clean&amp;lt;/code&amp;gt; will remove all the object files and the bootimage. &amp;lt;code&amp;gt;make libclean&amp;lt;/code&amp;gt; will call the clean target for all the libraries. &amp;lt;code&amp;gt;make depclean&amp;lt;/code&amp;gt; removes all the header file dependencies from the Makefile.  &amp;lt;code&amp;gt;make docclean&amp;lt;/code&amp;gt; will remove the documentation generated by the &amp;lt;code&amp;gt;make docs&amp;lt;/code&amp;gt; command.  &amp;lt;code&amp;gt;make realclean&amp;lt;/code&amp;gt; will do all of the above and remove the &amp;lt;code&amp;gt;vn&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;version&amp;lt;/code&amp;gt; files as well.&lt;br /&gt;
&lt;br /&gt;
Moving above and beyond those targets, there are also a few special targets that can be called.  &amp;lt;code&amp;gt;make [component]&amp;lt;/code&amp;gt; will create object files only for the specified subsystem (useful during development).  &amp;lt;code&amp;gt;make [libname]&amp;lt;/code&amp;gt; will build the library archive, and &amp;lt;code&amp;gt;make [libname]-clean&amp;lt;/code&amp;gt; will clean the library.&lt;br /&gt;
&lt;br /&gt;
== Makerules ==&lt;br /&gt;
&lt;br /&gt;
As mentioned above a &amp;lt;code&amp;gt;Makerules&amp;lt;/code&amp;gt; file resides in each component directory.  This file will append a listing of the source files for the component.  There are two important factors about this file:&lt;br /&gt;
# At the top of the file, make sure that &amp;lt;code&amp;gt;COMP&amp;lt;/code&amp;gt; is the name of the component '''and''' the name of the directory.&lt;br /&gt;
# Make sure you append all the files to the &amp;lt;code&amp;gt;COMP_SRC&amp;lt;/code&amp;gt; variable and that they are prefixed with the proper directory (so gcc can find them.)&lt;br /&gt;
&lt;br /&gt;
Within the file itself you can breakup files as you see fit.  Typically, assembly files are stored in local &amp;lt;code&amp;gt;S_FILES&amp;lt;/code&amp;gt; variables while C source is stored in &amp;lt;code&amp;gt;C_FILES&amp;lt;/code&amp;gt; variables.  This is not strictly needed, but makes it easier to read in some cases.&lt;br /&gt;
&lt;br /&gt;
== Library ==&lt;br /&gt;
&lt;br /&gt;
XINU libraries are built using the recursive make paradigm.  Since the libraries do not change commonly they are not removed between builds unless specially requested.  In the master Makefile all relevant variables are exported (including the location of the cross-compiler, C and assembly flags), the library Makefile then uses those to build its files and create an archive of the object files.&lt;br /&gt;
&lt;br /&gt;
This allows all important build variables to be in one location and not leave possible dependency issues if something were to change in the build system.&lt;/div&gt;</summary>
		<author><name>Michael</name></author>
		
	</entry>
</feed>