OSDN Git Service

Backport from 2013-01-07 trunk r194968.
authorgjl <gjl@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 7 Jan 2013 13:12:10 +0000 (13:12 +0000)
committergjl <gjl@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 7 Jan 2013 13:12:10 +0000 (13:12 +0000)
PR other/55243
* config/avr/t-avr: Don't automatically rebuild
$(srcdir)/config/avr/t-multilib
$(srcdir)/config/avr/avr-tables.opt
(avr-mcus): New phony target to build them on request.
(s-avr-mlib): Remove.
* avr/avr-mcus.def: Adjust comments.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-4_7-branch@194970 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/config/avr/avr-mcus.def
gcc/config/avr/t-avr

index aa06998..ce1060a 100644 (file)
@@ -1,3 +1,15 @@
+2013-01-07  Georg-Johann Lay  <avr@gjlay.de>
+
+       Backport from 2013-01-07 trunk r194968.
+       
+       PR other/55243
+       * config/avr/t-avr: Don't automatically rebuild
+       $(srcdir)/config/avr/t-multilib
+       $(srcdir)/config/avr/avr-tables.opt
+       (avr-mcus): New phony target to build them on request.
+       (s-avr-mlib): Remove.
+       * avr/avr-mcus.def: Adjust comments.
+
 2013-01-07  Terry Guo  <terry.guo@arm.com>
 
        Backport from mainline
index 7d28829..4e26cdd 100644 (file)
@@ -1,5 +1,5 @@
 /* AVR MCUs.
-   Copyright (C) 2009, 2010, 2011
+   Copyright (C) 2009 -- 2013
    Free Software Foundation, Inc.
 
    This file is part of GCC.
    along with GCC; see the file COPYING3.  If not see
    <http://www.gnu.org/licenses/>.  */
 
-/* List of all known AVR MCU types - if updated, it has to be kept
-   in sync in several places (FIXME: is there a better way?):
-    - here;
-    - gas/config/tc-avr.c;
-    - avr-libc.
+/* List of all known AVR MCU types.  If updated, cd to $(builddir)/gcc and run
+
+   $ make avr-mcus
+
+   This will regenerate / update the following source files:
+
+   -  $(srcdir)/config/avr/t-multilib
+   -  $(srcdir)/config/avr/avr-tables.opt
+
+   After that, rebuild everything and check-in the new sources to the repo.
+   The device list below has to be kept in sync with the following places:
+
+   -  here
+   -  gcc/doc/invoke.texi
+   -  gas/config/tc-avr.c
+   -  avr-libc
 
    Before including this file, define a macro:
 
-   AVR_MCU (NAME, ARCH, MACRO, SHORT_SP, ERRATA_SKIP, DATA_SEC, N_FLASH, LIBRARY_NAME)
+   AVR_MCU (NAME, ARCH, MACRO, SHORT_SP, ERRATA_SKIP, DATA_SEC, N_FLASH,
+            LIBRARY_NAME)
+
+   where the arguments are the fields of struct mcu_type_s:
+   
+       NAME         Accept -mmcu=<NAME>
+
+       ARCH         Specifies the multilib variant together with SHORT_SP
+
+       MACRO        If NULL, this is a core and not a device.  If non-NULL,
+                    supply respective built-in macro.
+
+       SHORT_SP     The device / multilib has an 8-bit stack pointer (no SPH).
+
+       ERRATA_SKIP  Apply work-around for the "skip 32-bit instruction"
+                    silicon bug:  Don't skip 32-bit instrctions.
+
+       DATA_SEC     First address of SRAM, used in  -Tdata=  by the driver.
+
+       N_FLASH      Number of 64 KiB flash segments, rounded up.
 
-   where the arguments are the fields of struct mcu_type_s.  */
+       LIBRARY_NAME Used by the driver to linke startup code from avr-libc
+                    as of  crt<LIBRARY_NAME>.o
 
-/* "avr2" must be first for the "0" default to work as intended.  */
+   "avr2" must be first for the "0" default to work as intended.  */
 
 /* Classic, <= 8K.  */
 AVR_MCU ("avr2",                 ARCH_AVR2, NULL,                        0, 1, 0x0060, 6, "s8515")
index 9963833..6889b1a 100644 (file)
@@ -1,5 +1,4 @@
-# Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,
-# 2009, 2010, 2011 Free Software Foundation, Inc.
+# Copyright (C) 2000 -- 2013 Free Software Foundation, Inc.
 #
 # This file is part of GCC.
 #
@@ -40,19 +39,27 @@ avr.o avr-c.o: $(srcdir)/config/avr/builtins.def
 
 AVR_MCUS = $(srcdir)/config/avr/avr-mcus.def
 
+# Run `avr-mcus' after you changed or added devices in  avr-mcus.def
+
+.PHONY: avr-mcus
+
+avr-mcus: $(srcdir)/config/avr/t-multilib \
+         $(srcdir)/config/avr/avr-tables.opt; @true
+
+# Make sure that -mmcu= is supported for devices from avr-mcus.def and
+# all -mmcu= values are displayed on the help screen
 $(srcdir)/config/avr/avr-tables.opt: $(srcdir)/config/avr/genopt.sh $(AVR_MCUS)
        $(SHELL) $< $(AVR_MCUS) > $@
 
+# Map -mmcu= to the right multilib variant
+
 # MULTILIB_OPTIONS
 # MULTILIB_DIRNAMES
 # MULTILIB_EXCEPTIONS
 # MULTILIB_MATCHES
-$(srcdir)/config/avr/t-multilib: s-avr-mlib; @true
 
 s-mlib: $(srcdir)/config/avr/t-multilib
 
-s-avr-mlib: $(srcdir)/config/avr/genmultilib.awk $(AVR_MCUS)
-       $(AWK) -f $< -v FORMAT=Makefile   $< $(AVR_MCUS) > tmp-avr-mlib
-       $(SHELL) $(srcdir)/../move-if-change \
-               tmp-avr-mlib    $(srcdir)/config/avr/t-multilib
-       $(STAMP) $@
+$(srcdir)/config/avr/t-multilib: $(srcdir)/config/avr/genmultilib.awk \
+                                $(AVR_MCUS)
+       $(AWK) -f $< -v FORMAT=Makefile   $< $(AVR_MCUS) > $@