Subversion Repositories avr32-toolchain

Rev

Rev 17 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 17 Rev 19
Line 1... Line 1...
1
# AVR32 Toolchain Makefile
1
# AVR32 Toolchain Makefile
2
#
2
#
3
# Copyright (C) 2011 by James Snyder <jbsnyder@fanplastic.org>
3
# Copyright (C) 2012 by Jasmin Jessich <jasmin.jessich@frequentis.com>
4
#
4
#
5
# Permission is hereby granted, free of charge, to any person obtaining a copy
5
# Permission is hereby granted, free of charge, to any person obtaining a copy
6
# of this software and associated documentation files (the "Software"), to deal
6
# of this software and associated documentation files (the "Software"), to deal
7
# in the Software without restriction, including without limitation the rights
7
# in the Software without restriction, including without limitation the rights
8
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
Line 17... Line 17...
17
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
# THE SOFTWARE.
21
# THE SOFTWARE.
-
 
22
#
-
 
23
# This Makefile is based on the one from here:
-
 
24
#    https://github.com/jsnyder/avr32-toolchain/blob/master/Makefile
-
 
25
#    Copyright (C) 2011 by James Snyder <jbsnyder@fanplastic.org>
-
 
26
-
 
27
#
-
 
28
# This makefile uses macros to generate the different rules for the different
-
 
29
# tools. This saves a lot of work, when a new tool is added. Moreover, bugfixes
-
 
30
# have to be done only one place.
-
 
31
#
-
 
32
# NOTE: Currently ONLY binutils is finished!
-
 
33
#
-
 
34
22
35
23
#### PRIMARY TOOLCHAIN VERSIONS #####
36
#### PRIMARY TOOLCHAIN VERSIONS #####
24
37
25
GCC_VERSION       = 4.4.3
38
GCC_VERSION       = 4.4.3
26
GDB_VERSION       = 6.7.1
39
GDB_VERSION       = 6.7.1
Line 35... Line 48...
35
48
36
#### PATHS AND ENVIRONMENT VARIABLES #####
49
#### PATHS AND ENVIRONMENT VARIABLES #####
37
50
38
SHELL       = /bin/bash
51
SHELL       = /bin/bash
39
TARGET      = avr32
52
TARGET      = avr32
40
# maybe better: avr32-unknown-none
-
 
41
53
42
TODAY = $(shell date "+%Y%m%d")
54
TODAY = $(shell date "+%Y%m%d")
43
GIT_REV	    = $(shell git rev-parse --verify HEAD --short 2> /dev/null)
55
GIT_REV	    = $(shell git rev-parse --verify HEAD --short 2> /dev/null)
44
SVN_REV	    = $(shell head -1 ReleaseNotes 2> /dev/null | cut -f 1 -d " ")
56
SVN_REV	    = $(shell head -1 ReleaseNotes 2> /dev/null | cut -f 1 -d " ")
45
57
Line 63... Line 75...
63
PROCS  ?= $(shell sysctl hw.ncpu | awk '{print $$2}')
75
PROCS  ?= $(shell sysctl hw.ncpu | awk '{print $$2}')
64
else
76
else
65
PROCS  ?= 2
77
PROCS  ?= 2
66
endif
78
endif
67
79
-
 
80
# enable maintainer-mode with yes
-
 
81
M_MODE ?= no
-
 
82
-
 
83
# enable binutils autotool file regeneration with yes
-
 
84
BINUTILS_REGEN ?= no
-
 
85
-
 
86
68
SUPP_PREFIX = $(CURDIR)/supp
87
SUPP_PREFIX = $(CURDIR)/supp
69
PATH       := ${PREFIX}/bin:${SUPP_PREFIX}/bin:${PATH}
88
PATH       := ${PREFIX}/bin:${SUPP_PREFIX}/bin:${PATH}
70
AUTOCONF    = $(SUPP_PREFIX)/bin/autoconf
89
AUTOCONF    = $(SUPP_PREFIX)/bin/autoconf
71
AUTOMAKE    = $(SUPP_PREFIX)/bin/automake
90
AUTOMAKE    = $(SUPP_PREFIX)/bin/automake
72
91
Line 75... Line 94...
75
BUILD_DIR := $(CURDIR)/build
94
BUILD_DIR := $(CURDIR)/build
76
95
77
ifeq ($(strip $(BUG_URL)),)
96
ifeq ($(strip $(BUG_URL)),)
78
BUG_URL = https://github.com/jsnyder/avr32-toolchain
97
BUG_URL = https://github.com/jsnyder/avr32-toolchain
79
endif
98
endif
80
#PKG_VERSION = "AVR 32 bit GNU Toolchain-$(AVR_PATCH_REV)-$(TOOL_REV)"
99
#PKG_VERSION ?= "AVR 32 bit GNU Toolchain-$(AVR_PATCH_REV)-$(TOOL_REV)"
81
PKG_VERSION = "AVR 32 bit GNU Toolchain-$(TOOL_REV)"
100
PKG_VERSION ?= "AVR 32 bit GNU Toolchain-$(TOOL_REV)"
82
101
83
102
84
#### PRIMARY TOOLCHAIN URLS #####
103
#### PRIMARY TOOLCHAIN URLS #####
85
104
86
GCC_ARCHIVE = gcc-$(GCC_VERSION).tar.bz2
105
GCC_ARCHIVE = gcc-$(GCC_VERSION).tar.bz2
Line 105... Line 124...
105
AVR32PATCHES_ARCHIVE = avr32-gnu-toolchain-$(AVR_PATCH_REV)-source.zip
124
AVR32PATCHES_ARCHIVE = avr32-gnu-toolchain-$(AVR_PATCH_REV)-source.zip
106
AVR32PATCHES_URL=http://www.atmel.com/dyn/resources/prod_documents/$(AVR32PATCHES_ARCHIVE)
125
AVR32PATCHES_URL=http://www.atmel.com/dyn/resources/prod_documents/$(AVR32PATCHES_ARCHIVE)
107
AVR32PATCHES_MD5 = 69a03828a328068f25d457cfd8341857
126
AVR32PATCHES_MD5 = 69a03828a328068f25d457cfd8341857
108
install_dir_avr32patches := source/avr32
127
install_dir_avr32patches := source/avr32
109
128
-
 
129
NEWPATCHESBINUTILS_ARCHIVE = binutils-2.22-avr32-full.patch
-
 
130
NEWPATCHESBINUTILS_URL=http://avr.anw.at/avr32/patches/binutils/2_22/$(NEWPATCHESBINUTILS_ARCHIVE)
-
 
131
NEWPATCHESBINUTILS_MD5 = aca9dd1aaeda63fa1a0cc4c68b94fa6f
-
 
132
install_dir_newpatchesbinutils := source/avr32/binutils
-
 
133
110
AVR32HEADERS_ARCHIVE = avr32-headers-$(AVR_HEADER_REV).zip
134
AVR32HEADERS_ARCHIVE = avr32-headers-$(AVR_HEADER_REV).zip
111
AVR32HEADERS_URL=http://www.atmel.com/dyn/resources/prod_documents/$(AVR32HEADERS_ARCHIVE)
135
AVR32HEADERS_URL=http://www.atmel.com/dyn/resources/prod_documents/$(AVR32HEADERS_ARCHIVE)
112
AVR32HEADERS_MD5 = 3293d70a46e460d342e1f939b8e0d228
136
AVR32HEADERS_MD5 = 3293d70a46e460d342e1f939b8e0d228
113
137
114
DFU_ARCHIVE = dfu-programmer-$(DFU_VERSION).tar.gz
138
DFU_ARCHIVE = dfu-programmer-$(DFU_VERSION).tar.gz
Line 119... Line 143...
119
##### SUPPORT TOOLS VERSIONS / URLS ######
143
##### SUPPORT TOOLS VERSIONS / URLS ######
120
AUTOCONF_VERSION = 2.64
144
AUTOCONF_VERSION = 2.64
121
#AUTOMAKE_VERSION = 1.11
145
#AUTOMAKE_VERSION = 1.11
122
AUTOMAKE_VERSION = 1.11.1
146
AUTOMAKE_VERSION = 1.11.1
123
LIBTOOL_VERSION = 2.2.6b
147
LIBTOOL_VERSION = 2.2.6b
-
 
148
DEJAGNU_VERSION = 1.5
124
MPC_VERSION = 0.8.1
149
MPC_VERSION = 0.8.1
125
150
126
AUTOCONF_ARCHIVE = autoconf-$(AUTOCONF_VERSION).tar.bz2
151
AUTOCONF_ARCHIVE = autoconf-$(AUTOCONF_VERSION).tar.bz2
127
AUTOCONF_URL = http://mirror.anl.gov/pub/gnu/autoconf/$(AUTOCONF_ARCHIVE)
152
AUTOCONF_URL = http://mirror.anl.gov/pub/gnu/autoconf/$(AUTOCONF_ARCHIVE)
128
AUTOCONF_MD5 = ef400d672005e0be21e0d20648169074
153
AUTOCONF_MD5 = ef400d672005e0be21e0d20648169074
Line 136... Line 161...
136
161
137
LIBTOOL_ARCHIVE = libtool-$(LIBTOOL_VERSION).tar.gz
162
LIBTOOL_ARCHIVE = libtool-$(LIBTOOL_VERSION).tar.gz
138
LIBTOOL_URL = http://mirror.anl.gov/pub/gnu/libtool/$(LIBTOOL_ARCHIVE)
163
LIBTOOL_URL = http://mirror.anl.gov/pub/gnu/libtool/$(LIBTOOL_ARCHIVE)
139
LIBTOOL_MD5 = 07da460450490148c6d2df0f21481a25
164
LIBTOOL_MD5 = 07da460450490148c6d2df0f21481a25
140
165
-
 
166
DEJAGNU_ARCHIVE = dejagnu-$(DEJAGNU_VERSION).tar.gz
-
 
167
DEJAGNU_URL = http://mirror.anl.gov/pub/gnu/dejagnu/$(DEJAGNU_ARCHIVE)
-
 
168
DEJAGNU_MD5 = 3df1cbca885e751e22d3ebd1ac64dc3c
141
169
142
SUPP_TOOLS := autoconf automake libtool
170
SUPP_TOOLS := autoconf automake libtool
-
 
171
SUPP_TOOLS_TEST := dejagnu
143
ALL_TOOLS := gcc gdb binutils newlib avr32patches avr32headers dfu $(SUPP_TOOLS)
172
ALL_TOOLS := gcc gdb binutils newlib avr32patches avr32headers dfu \
-
 
173
             newpatchesbinutils \
-
 
174
             $(SUPP_TOOLS) $(SUPP_TOOLS_TEST)
144
175
145
176
146
all: install-cross
177
all: install-cross
147
178
148
179
Line 232... Line 263...
232
EXT_TGZ := tar -xf
263
EXT_TGZ := tar -xf
233
EXT_ZIP := unzip -o
264
EXT_ZIP := unzip -o
234
265
235
## create the extract rule and force extract rule
266
## create the extract rule and force extract rule
236
define EXTRACT_template
267
define EXTRACT_template
237
extract-$(1)_TEXT := "Extracting $$($(1)_ARCHIVE)"
268
$(1)_extract_cmds ?= $($(2)) $$< $(3)
238
269
-
 
270
extract-$(1)_TEXT := "Extracting $$($(1)_ARCHIVE)"
239
extract-$(1): $(call name_stamp,extract-$(1))
271
extract-$(1): $(call name_stamp,extract-$(1))
240
extract-$(1)-f $(call name_stamp,extract-$(1)): $(DOWNLOAD_DIR)/$$($(1)_ARCHIVE)
272
extract-$(1)-f $(call name_stamp,extract-$(1)): $(DOWNLOAD_DIR)/$$($(1)_ARCHIVE)
241
	@(rm -rf $(1)-*; \
273
	@(rm -rf $(1)-*; \
242
	t1=`openssl md5 $$< | cut -f 2 -d " " -` && \
274
	t1=`openssl md5 $$< | cut -f 2 -d " " -` && \
243
	[ "$$$$t1" = "$$($(1)_MD5)" ] || \
275
	[ "$$$$t1" = "$$($(1)_MD5)" ] || \
244
	( echo "Bad Checksum! Please remove the following file and retry: $$<" && false ))
276
	( echo "Bad Checksum! Please remove the following file and retry: $$<" && false ))
245
	$(call quiet_text,$$(extract-$(1)_TEXT))
277
	$(call quiet_text,$$(extract-$(1)_TEXT))
246
	$($(2)) $$< $(3)
278
	$$($(1)_extract_cmds)
247
	$(call make_stamp,extract-$(1))
279
	$(call make_stamp,extract-$(1))
248
280
249
extract-$(1)-remove:
281
extract-$(1)-remove:
250
	rm -rf $(1)-*
282
	rm -rf $(1)-*
251
	$(call rm_stamp,extract-$(1))
283
	$(call rm_stamp,extract-$(1))
Line 257... Line 289...
257
PHONY += extract-$(1) extract-$(1)-f extract-$(1)-remove
289
PHONY += extract-$(1) extract-$(1)-f extract-$(1)-remove
258
endef
290
endef
259
291
260
## create the patch rule
292
## create the patch rule
261
define PATCH_template
293
define PATCH_template
-
 
294
$(1)_patch_level ?= -p0
-
 
295
262
patch-$(1)_TEXT := "Patching $$($(1)_ARCHIVE)"
296
patch-$(1)_TEXT := "Patching $$($(1)_ARCHIVE)"
263
patch-$(1): $(call name_stamp,patch-$(1))
297
patch-$(1): $(call name_stamp,patch-$(1))
264
$(call name_stamp,patch-$(1)): $(call name_stamp,extract-$(1)) $(call name_stamp,extract-avr32patches)
298
$(call name_stamp,patch-$(1)): $(call name_stamp,extract-$(1)) $(call name_stamp,extract-avr32patches) \
-
 
299
                               $(call name_stamp,extract-newpatchesbinutils)
265
	$(call quiet_text,$$(patch-$(1)_TEXT))
300
	$(call quiet_text,$$(patch-$(1)_TEXT))
266
	@(pushd $(1)-$$($(1)_VERSION) ; \
301
	@(pushd $(1)-$$($(1)_VERSION) ; \
267
	for f in ../$(install_dir_avr32patches)/$(1)/*.patch; do \
302
	for f in ../$(install_dir_avr32patches)/$(1)/*.patch; do \
268
	echo "Patching using: $$$${f}" ; \
303
	echo "Patching using: $$$${f}" ; \
269
	patch -N -p0 --no-backup-if-mismatch < $$$${f} ; \
304
	patch -N $$($(1)_patch_level) --no-backup-if-mismatch -i $$$${f} ; \
270
	if [ $$$$? -ne 0 ] ; then exit -1 ; fi ; \
305
	if [ $$$$? -ne 0 ] ; then exit -1 ; fi ; \
271
	done ; \
306
	done ; \
272
	popd)
307
	popd)
273
	$(call make_stamp,patch-$(1))
308
	$(call make_stamp,patch-$(1))
274
309
Line 322... Line 357...
322
357
323
## create the configure rule and force configure rule
358
## create the configure rule and force configure rule
324
define CONF_template
359
define CONF_template
325
conf-$(1)_TEXT := "Configuring $(1) $$($(1)_VERSION)"
360
conf-$(1)_TEXT := "Configuring $(1) $$($(1)_VERSION)"
326
conf-$(1): $(call name_stamp,conf-$(1))
361
conf-$(1): $(call name_stamp,conf-$(1))
-
 
362
-
 
363
# we need configure parameters!
-
 
364
ifeq ($$(strip $$($(1)_conf_opts)),)
-
 
365
$$(error "Configure options '$(1)_conf_opts' not defined")
-
 
366
endif
-
 
367
327
conf-$(1)-f $(call name_stamp,conf-$(1)): $(call name_stamp,$(2)-$(1)) $$($(1)_conf_deps)
368
conf-$(1)-f $(call name_stamp,conf-$(1)): $(call name_stamp,$(2)-$(1)) $$($(1)_conf_deps)
328
	@(rm -rf $(BUILD_DIR)/$(1) ; mkdir -p $(BUILD_DIR)/$(1))
369
	@(rm -rf $(BUILD_DIR)/$(1) ; mkdir -p $(BUILD_DIR)/$(1))
329
	$(call quiet_text,$$(conf-$(1)_TEXT))
370
	$(call quiet_text,$$(conf-$(1)_TEXT))
330
	cd $(BUILD_DIR)/$(1) && \
371
	cd $(BUILD_DIR)/$(1) && \
331
	../../$(1)-$$($(1)_VERSION)/configure $$($(1)_conf_opts)
372
	../../$(1)-$$($(1)_VERSION)/configure $$($(1)_conf_opts)
Line 341... Line 382...
341
PHONY += conf-$(1) conf-$(1)-f conf-$(1)-remove
382
PHONY += conf-$(1) conf-$(1)-f conf-$(1)-remove
342
endef
383
endef
343
384
344
## create the build rule and force build rule
385
## create the build rule and force build rule
345
define BUILD_template
386
define BUILD_template
346
build-$(1)_TEXT := "Building $(1) $$($(1)_VERSION)"
-
 
347
build-$(1): $(call name_stamp,build-$(1))
387
build-$(1): $(call name_stamp,build-$(1))
-
 
388
build-$(1)-f: build-$(1)-clean build-$(1)
-
 
389
-
 
390
# default commands overrideable
-
 
391
$(1)_build_cmds ?= $(MAKE) -j$(PROCS)
-
 
392
$(1)_build_clean_cmds ?= $(MAKE) clean
-
 
393
-
 
394
build-$(1)_TEXT := "Building $(1) $$($(1)_VERSION)"
348
build-$(1)-f $(call name_stamp,build-$(1)): $(call name_stamp,conf-$(1))
395
$(call name_stamp,build-$(1)): $(call name_stamp,conf-$(1))
349
	$(call quiet_text,$$(build-$(1)_TEXT))
396
	$(call quiet_text,$$(build-$(1)_TEXT))
350
	cd $(BUILD_DIR)/$(1) && \
397
	cd $(BUILD_DIR)/$(1) && \
351
	$$($(1)_build_cmds)
398
	$$($(1)_build_cmds)
352
	$(call make_stamp,build-$(1))
399
	$(call make_stamp,build-$(1))
353
400
-
 
401
build-$(1)-clean_TEXT := "Cleaning $(1) $$($(1)_VERSION)"
-
 
402
build-$(1)-clean:
-
 
403
	$(call quiet_text,$$(build-$(1)-clean_TEXT))
-
 
404
	cd $(BUILD_DIR)/$(1) && \
-
 
405
	$$($(1)_build_clean_cmds)
-
 
406
	$(call rm_stamp,build-$(1))
-
 
407
354
build-$(1)-remove:
408
build-$(1)-remove:
355
	rm -rf $(BUILD_DIR)/$(1)
409
	rm -rf $(BUILD_DIR)/$(1)
356
	$(call rm_stamp,build-$(1))
410
	$(call rm_stamp,build-$(1))
357
411
358
clean_build_$(1)_rule := build-$(1)-remove
412
clean_build_$(1)_rule := build-$(1)-remove
359
413
360
available_targets += build-$(1) build-$(1)-f build-$(1)-remove
414
available_targets += build-$(1) build-$(1)-f build-$(1)-clean build-$(1)-remove
361
415
362
PHONY += build-$(1) build-$(1)-f build-$(1)-remove
416
PHONY += build-$(1) build-$(1)-f build-$(1)-clean build-$(1)-remove
363
endef
417
endef
364
418
365
## create the install rule and force install rule
419
## create the install rule and force install rule
366
define INSTALL_template
420
define INSTALL_template
367
install-$(1)_TEXT := "Installing $(1) $$($(1)_VERSION)"
421
install-$(1)_TEXT := "Installing $(1) $$($(1)_VERSION)"
Line 416... Line 470...
416
470
417
$(eval $(call DOWNLOAD_template,autoconf))
471
$(eval $(call DOWNLOAD_template,autoconf))
418
$(eval $(call EXTRACT_template,autoconf,EXT_BZ2))
472
$(eval $(call EXTRACT_template,autoconf,EXT_BZ2))
419
autoconf_conf_opts := --prefix="$(SUPP_PREFIX)"
473
autoconf_conf_opts := --prefix="$(SUPP_PREFIX)"
420
$(eval $(call CONF_template,autoconf,extract))
474
$(eval $(call CONF_template,autoconf,extract))
421
autoconf_build_cmds :=\
-
 
422
  $(MAKE) clean && $(MAKE) -j$(PROCS)
-
 
423
$(eval $(call BUILD_template,autoconf))
475
$(eval $(call BUILD_template,autoconf))
424
$(eval $(call INSTALL_template,autoconf))
476
$(eval $(call INSTALL_template,autoconf))
425
$(eval $(call CLEAN_template,autoconf))
477
$(eval $(call CLEAN_template,autoconf))
426
478
427
479
Line 431... Line 483...
431
$(eval $(call EXTRACT_template,automake,EXT_BZ2))
483
$(eval $(call EXTRACT_template,automake,EXT_BZ2))
432
automake_conf_opts := --prefix="$(SUPP_PREFIX)"
484
automake_conf_opts := --prefix="$(SUPP_PREFIX)"
433
# automake needs the new autoconf allready installed
485
# automake needs the new autoconf allready installed
434
automake_conf_deps := $(call name_stamp,install-autoconf)
486
automake_conf_deps := $(call name_stamp,install-autoconf)
435
$(eval $(call CONF_template,automake,extract))
487
$(eval $(call CONF_template,automake,extract))
436
automake_build_cmds := $(autoconf_build_cmds)
-
 
437
$(eval $(call BUILD_template,automake))
488
$(eval $(call BUILD_template,automake))
438
$(eval $(call INSTALL_template,automake))
489
$(eval $(call INSTALL_template,automake))
439
$(eval $(call CLEAN_template,automake))
490
$(eval $(call CLEAN_template,automake))
440
491
441
492
Line 446... Line 497...
446
libtool_conf_opts := --prefix="$(SUPP_PREFIX)"
497
libtool_conf_opts := --prefix="$(SUPP_PREFIX)"
447
# libtool needs the new autoconf/automake allready installed
498
# libtool needs the new autoconf/automake allready installed
448
libtool_conf_deps := $(call name_stamp,install-autoconf) \
499
libtool_conf_deps := $(call name_stamp,install-autoconf) \
449
                     $(call name_stamp,install-automake)
500
                     $(call name_stamp,install-automake)
450
$(eval $(call CONF_template,libtool,extract))
501
$(eval $(call CONF_template,libtool,extract))
451
libtool_build_cmds := $(autoconf_build_cmds)
-
 
452
$(eval $(call BUILD_template,libtool))
502
$(eval $(call BUILD_template,libtool))
453
$(eval $(call INSTALL_template,libtool))
503
$(eval $(call INSTALL_template,libtool))
454
$(eval $(call CLEAN_template,libtool))
504
$(eval $(call CLEAN_template,libtool))
455
505
456
506
-
 
507
############ SUPP-TEST: DEJAGNU ############
-
 
508
-
 
509
$(eval $(call DOWNLOAD_template,dejagnu))
-
 
510
$(eval $(call EXTRACT_template,dejagnu,EXT_TGZ))
-
 
511
dejagnu_conf_opts := --prefix="$(SUPP_PREFIX)"
-
 
512
# dejagnu needs the new autoconf/automake allready installed
-
 
513
dejagnu_conf_deps := $(call name_stamp,install-autoconf) \
-
 
514
                     $(call name_stamp,install-automake)
-
 
515
$(eval $(call CONF_template,dejagnu,extract))
-
 
516
$(eval $(call BUILD_template,dejagnu))
-
 
517
$(eval $(call INSTALL_template,dejagnu))
-
 
518
$(eval $(call CLEAN_template,dejagnu))
-
 
519
-
 
520
457
############# AVR32 PATCHES ############
521
############# AVR32 PATCHES ############
458
522
459
$(eval $(call DOWNLOAD_template,avr32patches))
523
$(eval $(call DOWNLOAD_template,avr32patches))
460
$(eval $(call EXTRACT_template,avr32patches,EXT_ZIP))
524
$(eval $(call EXTRACT_template,avr32patches,EXT_ZIP))
461
525
Line 467... Line 531...
467
clean_uninstall_avr32patches_rule = uninstall-avr32patches
531
clean_uninstall_avr32patches_rule = uninstall-avr32patches
468
532
469
$(eval $(call CLEAN_template,avr32patches))
533
$(eval $(call CLEAN_template,avr32patches))
470
534
471
535
-
 
536
############# NEWPATCHESBINUTILS ############
-
 
537
-
 
538
$(eval $(call DOWNLOAD_template,newpatchesbinutils))
-
 
539
newpatchesbinutils_extract_cmds := \
-
 
540
@([ -d $(install_dir_newpatchesbinutils) ] && \
-
 
541
  mv $(install_dir_newpatchesbinutils) $(install_dir_newpatchesbinutils).x ; \
-
 
542
  mkdir -p $(install_dir_newpatchesbinutils) ; \
-
 
543
  cp $(DOWNLOAD_DIR)/$(NEWPATCHESBINUTILS_ARCHIVE) $(install_dir_newpatchesbinutils) \
-
 
544
)
-
 
545
$(eval $(call EXTRACT_template,newpatchesbinutils))
-
 
546
-
 
547
## use the uninstall-XXX rule to remove the patches directory
-
 
548
PHONY += uninstall-avr32patches
-
 
549
uninstall-newpatchesbinutils:
-
 
550
	rm -rf $(install_dir_newpatchesbinutils)
-
 
551
-
 
552
clean_uninstall_newpatchesbinutils_rule = uninstall-newpatchesbinutils
-
 
553
-
 
554
$(eval $(call CLEAN_template,newpatchesbinutils))
-
 
555
-
 
556
472
############# AVR32 HEADERS ############
557
############# AVR32 HEADERS ############
473
$(eval $(call DOWNLOAD_template,avr32headers))
558
$(eval $(call DOWNLOAD_template,avr32headers))
474
559
475
###### FIXME: Need to add a dependency to "stamps/install-final-gcc"
560
###### FIXME: Need to add a dependency to "stamps/install-final-gcc"
476
install_path_avr32headers := $(PREFIX)/$(TARGET)/include
561
install_path_avr32headers := $(PREFIX)/$(TARGET)/include
Line 490... Line 575...
490
575
491
################ BINUTILS ################
576
################ BINUTILS ################
492
577
493
$(eval $(call DOWNLOAD_template,binutils))
578
$(eval $(call DOWNLOAD_template,binutils))
494
$(eval $(call EXTRACT_template,binutils,EXT_BZ2))
579
$(eval $(call EXTRACT_template,binutils,EXT_BZ2))
-
 
580
binutils_patch_level := -p1
495
$(eval $(call PATCH_template,binutils))
581
$(eval $(call PATCH_template,binutils))
496
binutils_regen_dirs := bfd opcodes binutils gas ld
582
binutils_regen_dirs := bfd opcodes binutils gas ld
497
$(eval $(call REGEN_template,binutils,patch))
583
$(eval $(call REGEN_template,binutils,patch))
-
 
584
-
 
585
ifneq ($(M_MODE),no)
498
#  --enable-maintainer-mode \
586
binutils_maintainer_mode := --enable-maintainer-mode
-
 
587
endif
-
 
588
-
 
589
ifneq ($(BINUTILS_REGEN),no)
-
 
590
binutils_conf_depend :=regen
-
 
591
else	
-
 
592
binutils_conf_depend :=patch
-
 
593
endif
499
594
500
binutils_conf_opts := \
595
binutils_conf_opts := \
-
 
596
  $(binutils_maintainer_mode) \
501
  --prefix="$(PREFIX)" --target=$(TARGET) --disable-nls \
597
  --prefix="$(PREFIX)" --target=$(TARGET) --disable-nls \
502
  --disable-shared --disable-werror \
598
  --disable-shared --disable-werror \
503
  --enable-ld=yes --enable-gold=no \
599
  --enable-ld=yes --enable-gold=no \
504
  --with-pkgversion=$(PKG_VERSION) \
600
  --with-pkgversion=$(PKG_VERSION) \
505
  --with-sysroot="$(PREFIX)/$(TARGET)" --with-bugurl=$(BUG_URL)
601
  --with-sysroot="$(PREFIX)/$(TARGET)"
506
$(eval $(call CONF_template,binutils,regen))
-
 
507
binutils_build_cmds := \
-
 
508
  $(MAKE) -j$(PROCS)
-
 
509
#   $(MAKE) clean && $(MAKE) -j$(PROCS)
-
 
510
-
 
511
#  $(MAKE) all-bfd TARGET-bfd=headers; \
-
 
512
#  rm bfd/Makefile; \
-
 
513
#  make configure-bfd; \
602
#  --with-bugurl=$(BUG_URL)
514
#  $(MAKE)
-
 
515
603
-
 
604
$(eval $(call CONF_template,binutils,$(binutils_conf_depend)))
-
 
605
#binutils_build_cmds := ???
-
 
606
#binutils_build_clean_cmds := ???
516
$(eval $(call BUILD_template,binutils))
607
$(eval $(call BUILD_template,binutils))
517
$(eval $(call INSTALL_template,binutils))
608
$(eval $(call INSTALL_template,binutils))
518
$(eval $(call CLEAN_template,binutils))
609
$(eval $(call CLEAN_template,binutils))
519
610
520
611
521
-
 
522
.PHONY: $(PHONY)
612
.PHONY: $(PHONY)
523
613
524
614
525
615
526
616
Line 564... Line 654...
564
	@echo "                  packages, too (execute all realclean-XXX rules)"
654
	@echo "                  packages, too (execute all realclean-XXX rules)"
565
	@echo ""
655
	@echo ""
566
	@echo "help		: this inforamtion"
656
	@echo "help		: this inforamtion"
567
	@echo "helpx		: this inforamtion + available targets"
657
	@echo "helpx		: this inforamtion + available targets"
568
	@echo ""
658
	@echo ""
-
 
659
	@echo "The installation prefix can be set by"
-
 
660
	@echo " PREFIX=.... make aaa-XXX"
-
 
661
	@echo "And the package version with"
-
 
662
	@echo " PKG_VERSION=\"AVR 32 bit GNU Toolchain-XXX\""
-
 
663
	@echo ""
-
 
664
	@echo "Maintainers may use"
-
 
665
	@echo " M_MODE=y or BINUTILS_REGEN=y"
-
 
666
	@echo "Please have a look to the Makefile for details"
-
 
667
	@echo ""
569
668
570
define print_target
669
define print_target
571
	@echo "$(1)"
670
	@echo "$(1)"
572
671
573
endef
672
endef
Line 599... Line 698...
599
698
600
.PHONY : clean realclean
699
.PHONY : clean realclean
601
clean: $(clean_rules)
700
clean: $(clean_rules)
602
701
603
realclean: $(realclean_rules)
702
realclean: $(realclean_rules)
-
 
703
-
 
704
-
 
705
-
 
706
#################################################################
-
 
707
#################################################################
-
 
708
####                                                        ######
-
 
709
####                                                        ######
-
 
710
####                                                        ######
604
#	rm -rf build *-$(CS_BASE) binutils-* gcc-* gdb-* newlib-* mpc-* $(LOCAL_BASE) dfu-programmer-* autoconf-* automake-* stamps/* source supp
711
####      FROM HERE ON OLD CODE OF ORIGINAL MAKEFILE        ######
-
 
712
####      COMPLETELY UNSUPPORTED AND FOR PATTERN FOR        ######
-
 
713
####      ADDITIONAL WORK ONLY                              ######
-
 
714
####                                                        ######
-
 
715
####                                                        ######
-
 
716
####                                                        ######
-
 
717
#################################################################
-
 
718
#################################################################
-
 
719
-
 
720
605
721
606
722
607
############ SUPP: AUTOMAKE ############
723
############ SUPP: AUTOMAKE ############
608
724
609
##.PHONY: download-automake download-automake-force
725
##.PHONY: download-automake download-automake-force