Rev 4 | Details | Compare with Previous | Last modification | View Log | RSS feed
| Rev | Author | Line No. | Line |
|---|---|---|---|
| 4 | jasmin | 1 | == AVR32 Toolchain Builder == |
| 2 | |||
| 3 | This is a early implementation of a Makefile for an AVR32 toolchain |
||
| 4 | builder for Mac OS X & Linux, and it has not been extensively tested. |
||
| 5 | That said the patches are taken directly from Atmel, and basic testing |
||
| 6 | is done with some more complicated builds (i.e.: |
||
| 7 | link:http://eluaproject.net[eLua] in float and integer mode) to ensure |
||
| 8 | that that at least these work after toolchain modifications. |
||
| 9 | |||
| 10 | Note: If you have previously built a toolchain of another version, out |
||
| 11 | of the same builder directory, make sure to do the following first |
||
| 12 | before building with newer sources: |
||
| 13 | |||
| 14 | ---- |
||
| 15 | make clean |
||
| 16 | ---- |
||
| 17 | |||
| 18 | === Requirements (OS X) === |
||
| 19 | |||
| 20 | You will need to have GCC, make and binutils on your machine to |
||
| 21 | compile all of this. You can get all of these on Mac OS X, by just |
||
| 22 | installing the Apple |
||
| 23 | link:http://developer.apple.com/technologies/tools/[Developer Tools]. |
||
| 24 | You should be able to download free versions of 3.x from the ADC |
||
| 25 | website, install from the OS X install disc that came with your |
||
| 26 | machine, or download XCode 4 from the App Store (now free again for |
||
| 27 | all registered users). |
||
| 28 | |||
| 29 | You will also need gmp, mpfr and mpc first. I recommend installing |
||
| 30 | these from link:https://github.com/mxcl/homebrew[homebrew] for now. |
||
| 31 | I'll add these to the Makefile once I have a consistent configuration |
||
| 32 | that can be used for both Linux & OS X. |
||
| 33 | |||
| 34 | With homebrew you can install those dependencies like this: |
||
| 35 | ---- |
||
| 36 | brew install mpfr gmp libmpc texinfo |
||
| 37 | ---- |
||
| 38 | |||
| 39 | If you would like to build dfu-programmer, also install libusb: |
||
| 40 | |||
| 41 | ---- |
||
| 42 | brew install libusb-compat |
||
| 43 | ---- |
||
| 44 | |||
| 45 | |||
| 46 | === Requirements (Ubuntu) === |
||
| 47 | |||
| 48 | These instructions should now also work on Ubuntu Linux, provided the |
||
| 49 | following packages have been installed prior to attempting the build: |
||
| 50 | |||
| 51 | ---- |
||
| 52 | sudo apt-get install curl flex bison libgmp3-dev libmpfr-dev autoconf build-essential libncurses5-dev libmpc-dev texinfo |
||
| 53 | ---- |
||
| 54 | |||
| 55 | If you would like to build dfu-programmer, also install libusb: |
||
| 56 | |||
| 57 | ---- |
||
| 58 | sudo apt-get install libusb-dev |
||
| 59 | ---- |
||
| 60 | |||
| 61 | === Main Build Instructions === |
||
| 62 | |||
| 63 | Next build the toolchain: |
||
| 64 | |||
| 65 | ---- |
||
| 66 | make install-cross |
||
| 67 | ---- |
||
| 68 | |||
| 69 | You should be able to also specify a specific install/prefix location |
||
| 70 | by building using the following type of invokation: |
||
| 71 | |||
| 72 | ---- |
||
| 73 | PREFIX=$HOME/avr32-tools make install-cross |
||
| 74 | ---- |
||
| 75 | |||
| 76 | If you do this, make sure you have permissions to create a directory |
||
| 77 | at this location and/or to create directories within this location if |
||
| 78 | the directory already exists. |
||
| 79 | |||
| 80 | |||
| 81 | *NOTE:* If you're running Mac OS X Lion or XCode 4.1 you may find that |
||
| 82 | you're unable to bootstrap GCC. To work around this until the issue |
||
| 83 | is fixed in Apple's distribution of llvm-gcc, use the following |
||
| 84 | command instead of the above to build. |
||
| 85 | |||
| 86 | ---- |
||
| 87 | CC=gcc-4.2 make install-cross |
||
| 88 | ---- |
||
| 89 | |||
| 90 | |||
| 91 | |||
| 92 | This should build the compiler, newlib, gdb, etc.. and install them all |
||
| 93 | into a directory called arm-cs-tools in your home directory. If you |
||
| 94 | want to install to another location, feel free to change the export |
||
| 95 | lines and to adjust the definitions at the top of the Makefile. |
||
| 96 | |||
| 97 | Keep in mind that the Makefile does install at the end of each build. |
||
| 98 | |||
| 99 | Once you’re done, the makefile should notify you of the install |
||
| 100 | location, which will be based on the git revision if you cloned the |
||
| 101 | repository or the current date if you grabbed a tarball and/or you |
||
| 102 | don't have the git binary. The message should look like the following: |
||
| 103 | |||
| 104 | ---- |
||
| 105 | ====== INSTALLATION NOTE ====== |
||
| 106 | Your tools have now been installed at the following prefix: |
||
| 107 | /Users/jsnyder/avr32-tools-bd2485b |
||
| 108 | |||
| 109 | Please be sure to add something similar to the following to your .bash_profile, .zshrc, etc: |
||
| 110 | export PATH=/Users/jsnyder/avr32-tools-bd2485b/bin:$PATH |
||
| 111 | ---- |
||
| 112 | |||
| 113 | If it uses the date instead the the git short revision will bve |
||
| 114 | replaced with a date number like: 20110726. |
||
| 115 | |||
| 116 | If you also would like dfu-programmer installed intalled (make sure |
||
| 117 | you have previously installed libusb as described in requirements): |
||
| 118 | |||
| 119 | ---- |
||
| 120 | make install-dfu |
||
| 121 | ---- |
||
| 122 | |||
| 123 | === Special Thanks === |
||
| 124 | |||
| 125 | Special thanks to Rob Emanuele for the basis of this Makefile: |
||
| 126 | http://elua-development.2368040.n2.nabble.com/Building-GCC-for-Cortex-td2421927.html |