<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> <!--Converted with LaTeX2HTML 2008 (1.71) original version by: Nikos Drakos, CBLU, University of Leeds * revised and updated by: Marcus Hennecke, Ross Moore, Herb Swan * with significant contributions from: Jens Lippmann, Marek Rouchal, Martin Wilck and others --> <HTML> <HEAD> <TITLE>2.4.8 VPATH feature</TITLE> <META NAME="description" CONTENT="2.4.8 VPATH feature"> <META NAME="keywords" CONTENT="sdccman"> <META NAME="resource-type" CONTENT="document"> <META NAME="distribution" CONTENT="global"> <META NAME="Generator" CONTENT="LaTeX2HTML v2008"> <META HTTP-EQUIV="Content-Style-Type" CONTENT="text/css"> <LINK REL="STYLESHEET" HREF="sdccman.css"> <LINK REL="previous" HREF="node21.html"> <LINK REL="up" HREF="node14.html"> <LINK REL="next" HREF="node23.html"> </HEAD> <BODY > <!--Navigation Panel--> <A NAME="tex2html919" HREF="node23.html"> <IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="next.png"></A> <A NAME="tex2html913" HREF="node14.html"> <IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="up.png"></A> <A NAME="tex2html909" HREF="node21.html"> <IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="prev.png"></A> <A NAME="tex2html915" HREF="node1.html"> <IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="contents.png"></A> <A NAME="tex2html917" HREF="node191.html"> <IMG WIDTH="43" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="index" SRC="index.png"></A> <BR> <B> Next:</B> <A NAME="tex2html920" HREF="node23.html">2.5 Building the Documentation</A> <B> Up:</B> <A NAME="tex2html914" HREF="node14.html">2.4 Building SDCC</A> <B> Previous:</B> <A NAME="tex2html910" HREF="node21.html">2.4.7 Windows Install Using</A> <B> <A NAME="tex2html916" HREF="node1.html">Contents</A></B> <B> <A NAME="tex2html918" HREF="node191.html">Index</A></B> <BR> <BR> <!--End of Navigation Panel--> <H2><A NAME="SECTION00348000000000000000"></A><A NAME="567"></A> <BR> 2.4.8 VPATH feature </H2> <P> SDCC supports the VPATH feature provided by configure and make. It allows to separate the source and build trees. Here's an example: <P> <TT>cd ~ # cd $HOME</TT> <P> <TT>tar -xjf sdcc-src-yyyymmdd-rrrr.tar.bz2 # extract source to directory sdcc</TT> <P> <TT>mkdir sdcc.build # put output in sdcc.build</TT> <P> <TT>cd sdcc.build</TT> <P> <TT>../sdcc/configure # configure is doing all the magic!</TT> <P> <TT>make</TT> <P> That's it! <B>configure</B> will create the directory tree will all the necessary Makefiles in ~/sdcc.build. It automagically computes the variables srcdir, top_srcdir and top_buildir for each directory. After running <B>make</B> the generated files will be in ~/sdcc.build, while the source files stay in ~/sdcc. <BR> This is not only usefull for building different binaries, e.g. when cross compiling. It also gives you a much better overview in the source tree when all the generated files are not scattered between the source files. And the best thing is: if you want to change a file you can leave the original file untouched in the source directory. Simply copy it to the build directory, edit it, enter `make clean', `rm Makefile.dep' and `make'. <B>make</B> will do the rest for you! <P> <HR> <!--Navigation Panel--> <A NAME="tex2html919" HREF="node23.html"> <IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="next.png"></A> <A NAME="tex2html913" HREF="node14.html"> <IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="up.png"></A> <A NAME="tex2html909" HREF="node21.html"> <IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="prev.png"></A> <A NAME="tex2html915" HREF="node1.html"> <IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="contents.png"></A> <A NAME="tex2html917" HREF="node191.html"> <IMG WIDTH="43" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="index" SRC="index.png"></A> <BR> <B> Next:</B> <A NAME="tex2html920" HREF="node23.html">2.5 Building the Documentation</A> <B> Up:</B> <A NAME="tex2html914" HREF="node14.html">2.4 Building SDCC</A> <B> Previous:</B> <A NAME="tex2html910" HREF="node21.html">2.4.7 Windows Install Using</A> <B> <A NAME="tex2html916" HREF="node1.html">Contents</A></B> <B> <A NAME="tex2html918" HREF="node191.html">Index</A></B> <!--End of Navigation Panel--> <ADDRESS> 2011-03-20 </ADDRESS> </BODY> </HTML>