Subversion Repositories avr32-toolchain

Compare Revisions

Ignore whitespace Rev 18 → Rev 19

/branches/try_gdb/ReleaseNotes
1,3 → 1,17
try_gdb_0_5_0 (jjessich on Mon Apr 09 00:42:21 CEST 2012):
+ Added description.
+ Simplify maintainer mode and regenerating.
+ Add support for the new binutils patches from the anw
site (newpatchesbinutils).
NOTE: This is currently a hack and will be changed, if all patches for
all tools are finished.
+ Adding dejagnu (1.5) to new supp tools test.
+ Default extract command can be now overwritten.
+ Default patch level can be now overwritten.
+ New build-xxx-clean rule.
+ Default for xxx_build_cmds.
+ Help text improved.
 
try_gdb_0_4_0 (jjessich on Sun Apr 08 02:09:43 CEST 2012):
+ Use binutils 2.22, automake 1.11.1.
+ Adding libtool (2.2.6b) to supp tools.
/branches/try_gdb/Makefile
1,6 → 1,6
# AVR32 Toolchain Makefile
#
# Copyright (C) 2011 by James Snyder <jbsnyder@fanplastic.org>
# Copyright (C) 2012 by Jasmin Jessich <jasmin.jessich@frequentis.com>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
19,7 → 19,20
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
#
# This Makefile is based on the one from here:
# https://github.com/jsnyder/avr32-toolchain/blob/master/Makefile
# Copyright (C) 2011 by James Snyder <jbsnyder@fanplastic.org>
 
#
# This makefile uses macros to generate the different rules for the different
# tools. This saves a lot of work, when a new tool is added. Moreover, bugfixes
# have to be done only one place.
#
# NOTE: Currently ONLY binutils is finished!
#
 
 
#### PRIMARY TOOLCHAIN VERSIONS #####
 
GCC_VERSION = 4.4.3
37,7 → 50,6
 
SHELL = /bin/bash
TARGET = avr32
# maybe better: avr32-unknown-none
 
TODAY = $(shell date "+%Y%m%d")
GIT_REV = $(shell git rev-parse --verify HEAD --short 2> /dev/null)
65,6 → 77,13
PROCS ?= 2
endif
 
# enable maintainer-mode with yes
M_MODE ?= no
 
# enable binutils autotool file regeneration with yes
BINUTILS_REGEN ?= no
 
 
SUPP_PREFIX = $(CURDIR)/supp
PATH := ${PREFIX}/bin:${SUPP_PREFIX}/bin:${PATH}
AUTOCONF = $(SUPP_PREFIX)/bin/autoconf
77,8 → 96,8
ifeq ($(strip $(BUG_URL)),)
BUG_URL = https://github.com/jsnyder/avr32-toolchain
endif
#PKG_VERSION = "AVR 32 bit GNU Toolchain-$(AVR_PATCH_REV)-$(TOOL_REV)"
PKG_VERSION = "AVR 32 bit GNU Toolchain-$(TOOL_REV)"
#PKG_VERSION ?= "AVR 32 bit GNU Toolchain-$(AVR_PATCH_REV)-$(TOOL_REV)"
PKG_VERSION ?= "AVR 32 bit GNU Toolchain-$(TOOL_REV)"
 
 
#### PRIMARY TOOLCHAIN URLS #####
107,6 → 126,11
AVR32PATCHES_MD5 = 69a03828a328068f25d457cfd8341857
install_dir_avr32patches := source/avr32
 
NEWPATCHESBINUTILS_ARCHIVE = binutils-2.22-avr32-full.patch
NEWPATCHESBINUTILS_URL=http://avr.anw.at/avr32/patches/binutils/2_22/$(NEWPATCHESBINUTILS_ARCHIVE)
NEWPATCHESBINUTILS_MD5 = aca9dd1aaeda63fa1a0cc4c68b94fa6f
install_dir_newpatchesbinutils := source/avr32/binutils
 
AVR32HEADERS_ARCHIVE = avr32-headers-$(AVR_HEADER_REV).zip
AVR32HEADERS_URL=http://www.atmel.com/dyn/resources/prod_documents/$(AVR32HEADERS_ARCHIVE)
AVR32HEADERS_MD5 = 3293d70a46e460d342e1f939b8e0d228
121,6 → 145,7
#AUTOMAKE_VERSION = 1.11
AUTOMAKE_VERSION = 1.11.1
LIBTOOL_VERSION = 2.2.6b
DEJAGNU_VERSION = 1.5
MPC_VERSION = 0.8.1
 
AUTOCONF_ARCHIVE = autoconf-$(AUTOCONF_VERSION).tar.bz2
138,9 → 163,15
LIBTOOL_URL = http://mirror.anl.gov/pub/gnu/libtool/$(LIBTOOL_ARCHIVE)
LIBTOOL_MD5 = 07da460450490148c6d2df0f21481a25
 
DEJAGNU_ARCHIVE = dejagnu-$(DEJAGNU_VERSION).tar.gz
DEJAGNU_URL = http://mirror.anl.gov/pub/gnu/dejagnu/$(DEJAGNU_ARCHIVE)
DEJAGNU_MD5 = 3df1cbca885e751e22d3ebd1ac64dc3c
 
SUPP_TOOLS := autoconf automake libtool
ALL_TOOLS := gcc gdb binutils newlib avr32patches avr32headers dfu $(SUPP_TOOLS)
SUPP_TOOLS_TEST := dejagnu
ALL_TOOLS := gcc gdb binutils newlib avr32patches avr32headers dfu \
newpatchesbinutils \
$(SUPP_TOOLS) $(SUPP_TOOLS_TEST)
 
 
all: install-cross
234,8 → 265,9
 
## create the extract rule and force extract rule
define EXTRACT_template
$(1)_extract_cmds ?= $($(2)) $$< $(3)
 
extract-$(1)_TEXT := "Extracting $$($(1)_ARCHIVE)"
 
extract-$(1): $(call name_stamp,extract-$(1))
extract-$(1)-f $(call name_stamp,extract-$(1)): $(DOWNLOAD_DIR)/$$($(1)_ARCHIVE)
@(rm -rf $(1)-*; \
243,7 → 275,7
[ "$$$$t1" = "$$($(1)_MD5)" ] || \
( echo "Bad Checksum! Please remove the following file and retry: $$<" && false ))
$(call quiet_text,$$(extract-$(1)_TEXT))
$($(2)) $$< $(3)
$$($(1)_extract_cmds)
$(call make_stamp,extract-$(1))
 
extract-$(1)-remove:
259,14 → 291,17
 
## create the patch rule
define PATCH_template
$(1)_patch_level ?= -p0
 
patch-$(1)_TEXT := "Patching $$($(1)_ARCHIVE)"
patch-$(1): $(call name_stamp,patch-$(1))
$(call name_stamp,patch-$(1)): $(call name_stamp,extract-$(1)) $(call name_stamp,extract-avr32patches)
$(call name_stamp,patch-$(1)): $(call name_stamp,extract-$(1)) $(call name_stamp,extract-avr32patches) \
$(call name_stamp,extract-newpatchesbinutils)
$(call quiet_text,$$(patch-$(1)_TEXT))
@(pushd $(1)-$$($(1)_VERSION) ; \
for f in ../$(install_dir_avr32patches)/$(1)/*.patch; do \
echo "Patching using: $$$${f}" ; \
patch -N -p0 --no-backup-if-mismatch < $$$${f} ; \
patch -N $$($(1)_patch_level) --no-backup-if-mismatch -i $$$${f} ; \
if [ $$$$? -ne 0 ] ; then exit -1 ; fi ; \
done ; \
popd)
324,6 → 359,12
define CONF_template
conf-$(1)_TEXT := "Configuring $(1) $$($(1)_VERSION)"
conf-$(1): $(call name_stamp,conf-$(1))
 
# we need configure parameters!
ifeq ($$(strip $$($(1)_conf_opts)),)
$$(error "Configure options '$(1)_conf_opts' not defined")
endif
 
conf-$(1)-f $(call name_stamp,conf-$(1)): $(call name_stamp,$(2)-$(1)) $$($(1)_conf_deps)
@(rm -rf $(BUILD_DIR)/$(1) ; mkdir -p $(BUILD_DIR)/$(1))
$(call quiet_text,$$(conf-$(1)_TEXT))
343,23 → 384,36
 
## create the build rule and force build rule
define BUILD_template
build-$(1): $(call name_stamp,build-$(1))
build-$(1)-f: build-$(1)-clean build-$(1)
 
# default commands overrideable
$(1)_build_cmds ?= $(MAKE) -j$(PROCS)
$(1)_build_clean_cmds ?= $(MAKE) clean
 
build-$(1)_TEXT := "Building $(1) $$($(1)_VERSION)"
build-$(1): $(call name_stamp,build-$(1))
build-$(1)-f $(call name_stamp,build-$(1)): $(call name_stamp,conf-$(1))
$(call name_stamp,build-$(1)): $(call name_stamp,conf-$(1))
$(call quiet_text,$$(build-$(1)_TEXT))
cd $(BUILD_DIR)/$(1) && \
$$($(1)_build_cmds)
$(call make_stamp,build-$(1))
 
build-$(1)-clean_TEXT := "Cleaning $(1) $$($(1)_VERSION)"
build-$(1)-clean:
$(call quiet_text,$$(build-$(1)-clean_TEXT))
cd $(BUILD_DIR)/$(1) && \
$$($(1)_build_clean_cmds)
$(call rm_stamp,build-$(1))
 
build-$(1)-remove:
rm -rf $(BUILD_DIR)/$(1)
$(call rm_stamp,build-$(1))
 
clean_build_$(1)_rule := build-$(1)-remove
 
available_targets += build-$(1) build-$(1)-f build-$(1)-remove
available_targets += build-$(1) build-$(1)-f build-$(1)-clean build-$(1)-remove
 
PHONY += build-$(1) build-$(1)-f build-$(1)-remove
PHONY += build-$(1) build-$(1)-f build-$(1)-clean build-$(1)-remove
endef
 
## create the install rule and force install rule
418,8 → 472,6
$(eval $(call EXTRACT_template,autoconf,EXT_BZ2))
autoconf_conf_opts := --prefix="$(SUPP_PREFIX)"
$(eval $(call CONF_template,autoconf,extract))
autoconf_build_cmds :=\
$(MAKE) clean && $(MAKE) -j$(PROCS)
$(eval $(call BUILD_template,autoconf))
$(eval $(call INSTALL_template,autoconf))
$(eval $(call CLEAN_template,autoconf))
433,7 → 485,6
# automake needs the new autoconf allready installed
automake_conf_deps := $(call name_stamp,install-autoconf)
$(eval $(call CONF_template,automake,extract))
automake_build_cmds := $(autoconf_build_cmds)
$(eval $(call BUILD_template,automake))
$(eval $(call INSTALL_template,automake))
$(eval $(call CLEAN_template,automake))
448,12 → 499,25
libtool_conf_deps := $(call name_stamp,install-autoconf) \
$(call name_stamp,install-automake)
$(eval $(call CONF_template,libtool,extract))
libtool_build_cmds := $(autoconf_build_cmds)
$(eval $(call BUILD_template,libtool))
$(eval $(call INSTALL_template,libtool))
$(eval $(call CLEAN_template,libtool))
 
 
############ SUPP-TEST: DEJAGNU ############
 
$(eval $(call DOWNLOAD_template,dejagnu))
$(eval $(call EXTRACT_template,dejagnu,EXT_TGZ))
dejagnu_conf_opts := --prefix="$(SUPP_PREFIX)"
# dejagnu needs the new autoconf/automake allready installed
dejagnu_conf_deps := $(call name_stamp,install-autoconf) \
$(call name_stamp,install-automake)
$(eval $(call CONF_template,dejagnu,extract))
$(eval $(call BUILD_template,dejagnu))
$(eval $(call INSTALL_template,dejagnu))
$(eval $(call CLEAN_template,dejagnu))
 
 
############# AVR32 PATCHES ############
 
$(eval $(call DOWNLOAD_template,avr32patches))
469,6 → 533,27
$(eval $(call CLEAN_template,avr32patches))
 
 
############# NEWPATCHESBINUTILS ############
 
$(eval $(call DOWNLOAD_template,newpatchesbinutils))
newpatchesbinutils_extract_cmds := \
@([ -d $(install_dir_newpatchesbinutils) ] && \
mv $(install_dir_newpatchesbinutils) $(install_dir_newpatchesbinutils).x ; \
mkdir -p $(install_dir_newpatchesbinutils) ; \
cp $(DOWNLOAD_DIR)/$(NEWPATCHESBINUTILS_ARCHIVE) $(install_dir_newpatchesbinutils) \
)
$(eval $(call EXTRACT_template,newpatchesbinutils))
 
## use the uninstall-XXX rule to remove the patches directory
PHONY += uninstall-avr32patches
uninstall-newpatchesbinutils:
rm -rf $(install_dir_newpatchesbinutils)
 
clean_uninstall_newpatchesbinutils_rule = uninstall-newpatchesbinutils
 
$(eval $(call CLEAN_template,newpatchesbinutils))
 
 
############# AVR32 HEADERS ############
$(eval $(call DOWNLOAD_template,avr32headers))
 
492,33 → 577,38
 
$(eval $(call DOWNLOAD_template,binutils))
$(eval $(call EXTRACT_template,binutils,EXT_BZ2))
binutils_patch_level := -p1
$(eval $(call PATCH_template,binutils))
binutils_regen_dirs := bfd opcodes binutils gas ld
$(eval $(call REGEN_template,binutils,patch))
# --enable-maintainer-mode \
 
ifneq ($(M_MODE),no)
binutils_maintainer_mode := --enable-maintainer-mode
endif
 
ifneq ($(BINUTILS_REGEN),no)
binutils_conf_depend :=regen
else
binutils_conf_depend :=patch
endif
 
binutils_conf_opts := \
$(binutils_maintainer_mode) \
--prefix="$(PREFIX)" --target=$(TARGET) --disable-nls \
--disable-shared --disable-werror \
--enable-ld=yes --enable-gold=no \
--with-pkgversion=$(PKG_VERSION) \
--with-sysroot="$(PREFIX)/$(TARGET)" --with-bugurl=$(BUG_URL)
$(eval $(call CONF_template,binutils,regen))
binutils_build_cmds := \
$(MAKE) -j$(PROCS)
# $(MAKE) clean && $(MAKE) -j$(PROCS)
--with-sysroot="$(PREFIX)/$(TARGET)"
# --with-bugurl=$(BUG_URL)
 
# $(MAKE) all-bfd TARGET-bfd=headers; \
# rm bfd/Makefile; \
# make configure-bfd; \
# $(MAKE)
 
$(eval $(call CONF_template,binutils,$(binutils_conf_depend)))
#binutils_build_cmds := ???
#binutils_build_clean_cmds := ???
$(eval $(call BUILD_template,binutils))
$(eval $(call INSTALL_template,binutils))
$(eval $(call CLEAN_template,binutils))
 
 
 
.PHONY: $(PHONY)
 
 
566,6 → 656,15
@echo "help : this inforamtion"
@echo "helpx : this inforamtion + available targets"
@echo ""
@echo "The installation prefix can be set by"
@echo " PREFIX=.... make aaa-XXX"
@echo "And the package version with"
@echo " PKG_VERSION=\"AVR 32 bit GNU Toolchain-XXX\""
@echo ""
@echo "Maintainers may use"
@echo " M_MODE=y or BINUTILS_REGEN=y"
@echo "Please have a look to the Makefile for details"
@echo ""
 
define print_target
@echo "$(1)"
601,9 → 700,26
clean: $(clean_rules)
 
realclean: $(realclean_rules)
# rm -rf build *-$(CS_BASE) binutils-* gcc-* gdb-* newlib-* mpc-* $(LOCAL_BASE) dfu-programmer-* autoconf-* automake-* stamps/* source supp
 
 
 
#################################################################
#################################################################
#### ######
#### ######
#### ######
#### FROM HERE ON OLD CODE OF ORIGINAL MAKEFILE ######
#### COMPLETELY UNSUPPORTED AND FOR PATTERN FOR ######
#### ADDITIONAL WORK ONLY ######
#### ######
#### ######
#### ######
#################################################################
#################################################################
 
 
 
 
############ SUPP: AUTOMAKE ############
 
##.PHONY: download-automake download-automake-force