ch03s06.html 4.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. <html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>Cross-Compiling on GNU/Linux</title><meta name="generator" content="DocBook XSL Stylesheets V1.76.1"><meta name="keywords" content="Intellon, Atheros, Qualcomm, HomePlug, powerline, communications, INT6000, INT6300, INT6400, AR7400, AR7420"><link rel="home" href="index.html" title="Qualcomm Atheros Open Powerline Toolkit"><link rel="up" href="ch03.html" title="Chapter 3.  Software"><link rel="prev" href="ch03s05.html" title="Stand-alone Compiling on GNU/Linux"><link rel="next" href="ch03s07.html" title="Compilation with Visual Studio .NET 2003"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">
  2. Cross-Compiling on GNU/Linux
  3. </th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ch03s05.html">Prev</a> </td><th width="60%" align="center">Chapter 3. 
  4. Software
  5. </th><td width="20%" align="right"> <a accesskey="n" href="ch03s07.html">Next</a></td></tr></table><hr></div><div class="section" title="Cross-Compiling on GNU/Linux"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="software-cross-compile"></a>
  6. Cross-Compiling on GNU/Linux
  7. </h2></div></div></div><p>
  8. Makefiles are setup for cross-compilation using custom toolchains. File <code class="filename">make.def</code>, in the main toolkit folder, defines cross-comilation symbols referenced in lower-level makefiles. Lower-level makefiles include <code class="filename">make.def</code> before building their targets. The following is an example <code class="filename">make.def</code> file used when cross-compiling for the ADM5120 MIPSEL-based gateway.
  9. </p><div class="example"><a name="idp20831144"></a><p class="title"><b>Example 3.3. 
  10. Cross-compiling with make.def
  11. </b></p><div class="example-contents"><pre class="programlisting">
  12. # file: make.def
  13. # ====================================================================
  14. # Edimax Hardware;
  15. # --------------------------------------------------------------------
  16. PLATFORM=-D_ADM5120_
  17. MODEL=-D_6104KP_
  18. ENDIAN=-D_LITTLE_ENDIAN_
  19. GATEWAY=y
  20. # ====================================================================
  21. # AMiLDA Software; uncomment these lines when cross-compiling;
  22. # --------------------------------------------------------------------
  23. # CROSS=/export/tools/mipsel-linux-uclibc/bin/mipsel-uclibc-
  24. # CROSS_LINUX=/export/tools/bin/mipsel-linux-
  25. # ====================================================================
  26. # toolchain;
  27. # --------------------------------------------------------------------
  28. CC=$(CROSS)gcc
  29. STRIP=$(CROSS)strip
  30. LD=$(CROSS)ld
  31. AR=$(CROSS)ar
  32. RANLIB=$(CROSS)ranlib
  33. CAS=$(CROSS)gcc -c
  34. CPP=$(CROSS)gcc -E
  35. # ====================================================================
  36. # folders;
  37. # --------------------------------------------------------------------
  38. BIN=/usr/local/bin
  39. MAN=/usr/share/man/man7
  40. WWW=/home/www
  41. DOC=/home/www/software/plc-utils/
  42. # ====================================================================
  43. # permissions;
  44. # --------------------------------------------------------------------
  45. OWNER=0
  46. GROUP=0
  47. </pre></div></div><br class="example-break"><p>
  48. Developers are encouraged to make changes in this file rather than adding additional variables to the lower-level makefiles. For example, you can edit variable <code class="varname">BIN</code> to install toolkit programs in some location other than <code class="filename">/usr/local/bin</code> or variable <code class="varname">WWW</code> to install <acronym class="acronym">HTML</acronym> documentation on your local website.
  49. </p></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ch03s05.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="ch03.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="ch03s07.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">
  50. Stand-alone Compiling on GNU/Linux
  51.  </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> 
  52. Compilation with Visual Studio .NET 2003
  53. </td></tr></table></div></body></html>