Browse Source

add openocd

master
Olaf Rempel 9 years ago
parent
commit
8dd67d29a0
4 changed files with 89 additions and 19 deletions
  1. 2
    0
      .gitignore
  2. 87
    19
      Makefile
  3. 0
    0
      download/.keep
  4. 0
    0
      source/.keep

+ 2
- 0
.gitignore View File

@@ -0,0 +1,2 @@
1
+download/*
2
+source/*

+ 87
- 19
Makefile View File

@@ -4,10 +4,12 @@ TOOLCHAIN=/opt/arm-toolchain
4 4
 # build arch:
5 5
 BUILDARCH=i686-linux-gnu
6 6
 
7
+MAKEOPTS=-j4
8
+
7 9
 # #####################################################################
8 10
 # MAIN TARGETS (binutils, gcc, g++, newlib, gdb for arm7tdmi)
9 11
 # #####################################################################
10
-toolchain: binutils gcc newlib gdb
12
+toolchain: binutils gcc newlib gdb openocd
11 13
 
12 14
 # #####################################################################
13 15
 BASE=$(shell /bin/pwd)
@@ -18,34 +20,53 @@ PATH:=$(PATH):$(TOOLCHAIN)/bin
18 20
 WGET:=/usr/bin/wget --passive-ftp -nd
19 21
 
20 22
 # #####################################################################
21
-BINUTILS_VERSION=2.17
23
+BINUTILS_VERSION=2.19.1
22 24
 BINUTILS_PACKAGE=binutils-$(BINUTILS_VERSION).tar.bz2
23
-BINUTILS_DOWNLOAD=http://www.gnuarm.com/$(BINUTILS_PACKAGE)
25
+BINUTILS_DOWNLOAD=http://ftp.gnu.org/gnu/binutils/$(BINUTILS_PACKAGE)
24 26
 BINUTILS_SOURCE=$(SOURCE)/binutils-$(BINUTILS_VERSION)
25 27
 BINUTILS_BUILD=$(BINUTILS_SOURCE)-build
26 28
 
27 29
 # #####################################################################
28
-GCC_VERSION=4.1.1
30
+GCC_VERSION=4.3.3
29 31
 GCC_PACKAGE=gcc-$(GCC_VERSION).tar.bz2
30
-GCC_DOWNLOAD=http://www.gnuarm.com/$(GCC_PACKAGE)
32
+GCC_DOWNLOAD=http://ftp.gnu.org/gnu/gcc/gcc-$(GCC_VERSION)/$(GCC_PACKAGE)
31 33
 GCC_SOURCE=$(SOURCE)/gcc-$(GCC_VERSION)
32 34
 GCC_BUILD=$(GCC_SOURCE)-build
33 35
 
34 36
 # #####################################################################
35
-NEWLIB_VERSION=1.14.0
37
+GMP_VERSION=4.3.0
38
+GMP_PACKAGE=gmp-$(GMP_VERSION).tar.bz2
39
+GMP_DOWNLOAD=http://ftp.gnu.org/gnu/gmp/$(GMP_PACKAGE)
40
+GMP_SOURCE=$(GCC_SOURCE)/gmp-$(GMP_VERSION)
41
+
42
+# #####################################################################
43
+MPFR_VERSION=2.4.1
44
+MPFR_PACKAGE=mpfr-$(MPFR_VERSION).tar.bz2
45
+MPFR_DOWNLOAD=http://www.mpfr.org/mpfr-$(MPFR_VERSION)/$(MPFR_PACKAGE)
46
+MPFR_SOURCE=$(GCC_SOURCE)/mpfr-$(MPFR_VERSION)
47
+
48
+# #####################################################################
49
+NEWLIB_VERSION=1.17.0
36 50
 NEWLIB_PACKAGE=newlib-$(NEWLIB_VERSION).tar.gz
37
-NEWLIB_DOWNLOAD=http://www.gnuarm.com/$(NEWLIB_PACKAGE)
51
+NEWLIB_DOWNLOAD=ftp://sources.redhat.com/pub/newlib/$(NEWLIB_PACKAGE)
38 52
 NEWLIB_SOURCE=$(SOURCE)/newlib-$(NEWLIB_VERSION)
39 53
 NEWLIB_BUILD=$(NEWLIB_SOURCE)-build
40 54
 
41 55
 # #####################################################################
42
-GDB_VERSION=6.6
56
+GDB_VERSION=6.8
43 57
 GDB_PACKAGE=gdb-$(GDB_VERSION).tar.bz2
44 58
 GDB_DOWNLOAD=http://ftp.gnu.org/gnu/gdb/$(GDB_PACKAGE)
45 59
 GDB_SOURCE=$(SOURCE)/gdb-$(GDB_VERSION)
46 60
 GDB_BUILD=$(GDB_SOURCE)-build
47 61
 
48 62
 # #####################################################################
63
+OOCD_VERSION=0.4.0
64
+OOCD_PACKAGE=openocd-$(OOCD_VERSION).tar.bz2
65
+OOCD_DOWNLOAD=http://downloads.sourceforge.net/project/openocd/openocd/$(OOCD_VERSION)/$(OOCD_PACKAGE)
66
+OOCD_SOURCE=$(SOURCE)/openocd-$(OOCD_VERSION)
67
+OOCD_BUILD=$(OOCD_SOURCE)-build
68
+
69
+# #####################################################################
49 70
 binutils: $(BINUTILS_BUILD)/.installed
50 71
 
51 72
 $(DOWNLOADS)/$(BINUTILS_PACKAGE):
@@ -67,11 +88,11 @@ $(BINUTILS_BUILD)/.configured: $(BINUTILS_SOURCE)/.unpacked
67 88
 	touch $@
68 89
 
69 90
 $(BINUTILS_BUILD)/.compiled: $(BINUTILS_BUILD)/.configured
70
-	make -C $(BINUTILS_BUILD) all
91
+	$(MAKE) -C $(BINUTILS_BUILD) $(MAKEOPTS) all
71 92
 	touch $@
72 93
 
73 94
 $(BINUTILS_BUILD)/.installed: $(BINUTILS_BUILD)/.compiled
74
-	make -C $(BINUTILS_BUILD) install
95
+	$(MAKE) -C $(BINUTILS_BUILD) install
75 96
 	touch $@
76 97
 
77 98
 # #####################################################################
@@ -84,7 +105,7 @@ $(GCC_SOURCE)/.unpacked: $(DOWNLOADS)/$(GCC_PACKAGE)
84 105
 	tar -C $(SOURCE) -xjf $^
85 106
 	touch $@
86 107
 
87
-$(GCC_BUILD)/.configured: $(GCC_SOURCE)/.unpacked $(NEWLIB_SOURCE)/.unpacked
108
+$(GCC_BUILD)/.configured: $(GCC_SOURCE)/.unpacked $(GMP_SOURCE)/.unpacked $(MPFR_SOURCE)/.unpacked $(NEWLIB_SOURCE)/.unpacked
88 109
 	mkdir -p $(GCC_BUILD)
89 110
 	(cd $(GCC_BUILD); $(GCC_SOURCE)/configure \
90 111
 		--build=$(BUILDARCH) --host=$(BUILDARCH) --target=arm-elf \
@@ -99,25 +120,43 @@ $(GCC_BUILD)/.configured: $(GCC_SOURCE)/.unpacked $(NEWLIB_SOURCE)/.unpacked
99 120
 	touch $@
100 121
 
101 122
 $(GCC_BUILD)/.stage1.compiled: $(GCC_BUILD)/.configured $(BINUTILS_BUILD)/.installed
102
-	make -C $(GCC_BUILD) all-gcc
123
+	$(MAKE) -C $(GCC_BUILD) $(MAKEOPTS) all-gcc
103 124
 	touch $@
104 125
 
105 126
 $(GCC_BUILD)/.stage1.installed: $(GCC_BUILD)/.stage1.compiled
106
-	make -C $(GCC_BUILD) install-gcc
127
+	$(MAKE) -C $(GCC_BUILD) install-gcc
107 128
 	touch $@
108 129
 
109 130
 $(GCC_BUILD)/.stage2.compiled: $(GCC_BUILD)/.stage1.installed $(NEWLIB_BUILD)/.installed
110
-	make -C $(GCC_BUILD) all
131
+	$(MAKE) -C $(GCC_BUILD) $(MAKEOPTS) all
111 132
 	touch $@
112 133
 
113 134
 $(GCC_BUILD)/.stage2.installed: $(GCC_BUILD)/.stage2.compiled
114
-	make -C $(GCC_BUILD) install
135
+	$(MAKE) -C $(GCC_BUILD) install
115 136
 	touch $@
116 137
 
117 138
 $(GCC_BUILD)/.installed: $(GCC_BUILD)/.stage1.installed $(GCC_BUILD)/.stage2.installed
118 139
 	touch $@
119 140
 
120 141
 # #####################################################################
142
+$(DOWNLOADS)/$(GMP_PACKAGE):
143
+	$(WGET) -P $(DOWNLOADS) $(GMP_DOWNLOAD)
144
+
145
+$(GMP_SOURCE)/.unpacked: $(DOWNLOADS)/$(GMP_PACKAGE) $(GCC_SOURCE)/.unpacked
146
+	tar -C $(GCC_SOURCE) -xjf $(DOWNLOADS)/$(GMP_PACKAGE)
147
+	ln -s gmp-$(GMP_VERSION) $(GCC_SOURCE)/gmp
148
+	touch $@
149
+
150
+# #####################################################################
151
+$(DOWNLOADS)/$(MPFR_PACKAGE):
152
+	$(WGET) -P $(DOWNLOADS) $(MPFR_DOWNLOAD)
153
+
154
+$(MPFR_SOURCE)/.unpacked: $(DOWNLOADS)/$(MPFR_PACKAGE) $(GCC_SOURCE)/.unpacked
155
+	tar -C $(GCC_SOURCE) -xjf $(DOWNLOADS)/$(MPFR_PACKAGE)
156
+	ln -s mpfr-$(MPFR_VERSION) $(GCC_SOURCE)/mpfr
157
+	touch $@
158
+
159
+# #####################################################################
121 160
 newlib: $(NEWLIB_BUILD)/.installed
122 161
 
123 162
 $(DOWNLOADS)/$(NEWLIB_PACKAGE):
@@ -139,11 +178,11 @@ $(NEWLIB_BUILD)/.configured: $(NEWLIB_SOURCE)/.unpacked $(GCC_BUILD)/.stage1.ins
139 178
 	touch $@
140 179
 
141 180
 $(NEWLIB_BUILD)/.compiled: $(NEWLIB_BUILD)/.configured
142
-	make -C $(NEWLIB_BUILD) all
181
+	$(MAKE) -C $(NEWLIB_BUILD) $(MAKEOPTS) all
143 182
 	touch $@
144 183
 
145 184
 $(NEWLIB_BUILD)/.installed: $(NEWLIB_BUILD)/.compiled
146
-	make -C $(NEWLIB_BUILD) install
185
+	$(MAKE) -C $(NEWLIB_BUILD) install
147 186
 	touch $@
148 187
 
149 188
 # #####################################################################
@@ -168,9 +207,38 @@ $(GDB_BUILD)/.configured: $(GDB_SOURCE)/.unpacked $(GCC_BUILD)/.installed
168 207
 	touch $@
169 208
 
170 209
 $(GDB_BUILD)/.compiled: $(GDB_BUILD)/.configured
171
-	make -C $(GDB_BUILD) all
210
+	$(MAKE) -C $(GDB_BUILD) $(MAKEOPTS) all
172 211
 	touch $@
173 212
 
174 213
 $(GDB_BUILD)/.installed: $(GDB_BUILD)/.compiled
175
-	make -C $(GDB_BUILD) install
214
+	$(MAKE) -C $(GDB_BUILD) install
215
+	touch $@
216
+
217
+# #####################################################################
218
+openocd: $(OOCD_BUILD)/.installed
219
+
220
+$(DOWNLOADS)/$(OOCD_PACKAGE):
221
+	$(WGET) -P $(DOWNLOADS) $(OOCD_DOWNLOAD)
222
+
223
+$(OOCD_SOURCE)/.unpacked: $(DOWNLOADS)/$(OOCD_PACKAGE)
224
+	tar -C $(SOURCE) -xjf $^
225
+	touch $@
226
+
227
+$(OOCD_BUILD)/.configured: $(OOCD_SOURCE)/.unpacked
228
+	mkdir -p $(OOCD_BUILD)
229
+	(cd $(OOCD_BUILD); $(OOCD_SOURCE)/configure \
230
+		--prefix=$(TOOLCHAIN) \
231
+		--disable-static \
232
+		--disable-doxygen-html \
233
+		--enable-parport \
234
+		--enable-ft2232_libftdi \
235
+		);
236
+	touch $@
237
+
238
+$(OOCD_BUILD)/.compiled: $(OOCD_BUILD)/.configured
239
+	$(MAKE) -C $(OOCD_BUILD) $(MAKEOPTS) all
240
+	touch $@
241
+
242
+$(OOCD_BUILD)/.installed: $(OOCD_BUILD)/.compiled
243
+	$(MAKE) -C $(OOCD_BUILD) install
176 244
 	touch $@

+ 0
- 0
download/.keep View File


+ 0
- 0
source/.keep View File


Loading…
Cancel
Save