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