re PR target/54641 (Wrong warning flags for building avr-c.o, fails to build)
[gcc.git] / gcc / config / avr / t-avr
1 # Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,
2 # 2009, 2010, 2011 Free Software Foundation, Inc.
3 #
4 # This file is part of GCC.
5 #
6 # GCC is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 3, or (at your option)
9 # any later version.
10 #
11 # GCC is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
15 #
16 # You should have received a copy of the GNU General Public License
17 # along with GCC; see the file COPYING3. If not see
18 # <http://www.gnu.org/licenses/>.
19
20 driver-avr.o: $(srcdir)/config/avr/driver-avr.c \
21 $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H)
22 $(COMPILER) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $<
23
24 avr-devices.o: $(srcdir)/config/avr/avr-devices.c \
25 $(srcdir)/config/avr/avr-mcus.def \
26 $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H)
27 $(COMPILER) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $<
28
29 avr-c.o: $(srcdir)/config/avr/avr-c.c \
30 $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) $(C_COMMON_H)
31 $(COMPILER) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $<
32
33 avr-log.o: $(srcdir)/config/avr/avr-log.c \
34 $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) $(INPUT_H) dumpfile.h
35 $(COMPILER) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $<
36
37 avr.o avr-c.o: $(srcdir)/config/avr/builtins.def
38
39 # Files and Variables auto-generated from avr-mcus.def
40
41 AVR_MCUS = $(srcdir)/config/avr/avr-mcus.def
42
43 $(srcdir)/config/avr/avr-tables.opt: $(srcdir)/config/avr/genopt.sh $(AVR_MCUS)
44 $(SHELL) $< $(AVR_MCUS) > $@
45
46 gen-avr-mmcu-texi$(build_exeext): $(srcdir)/config/avr/gen-avr-mmcu-texi.c \
47 $(AVR_MCUS) $(srcdir)/config/avr/avr-devices.c \
48 $(srcdir)/config/avr/avr-arch.h
49 $(CC_FOR_BUILD) $(CFLAGS_FOR_BUILD) $< -o $@
50
51 # Make sure that the -mmcu= documentation is in sync with the compiler.
52 $(srcdir)/doc/avr-mmcu.texi: s-avr-mmcu-texi; @true
53
54 # invoke.texi @includes avr-mmcu.texi. Put this dependency here instead
55 # of in the global Makefile so that developers of other backends are not
56 # bothered with AVR stuff.
57 $(srcdir)/doc/invoke.texi: $(srcdir)/doc/avr-mmcu.texi
58
59 # Ensure that device support is in sync with -mmcu= documentation.
60 s-avr-mmcu-texi: gen-avr-mmcu-texi$(build_exeext)
61 $(RUN_GEN) ./$< > tmp-avr-mmcu.texi
62 $(SHELL) $(srcdir)/../move-if-change tmp-avr-mmcu.texi avr-mmcu.texi
63 @if cmp -s $(srcdir)/doc/avr-mmcu.texi avr-mmcu.texi; then \
64 $(STAMP) $@; \
65 else \
66 echo >&2 ; \
67 echo "***" >&2 ; \
68 echo "*** Verify that you have permission to grant a" >&2 ; \
69 echo "*** GFDL license for all new text in" >&2 ; \
70 echo "*** avr-mmcu.texi, then copy it to $(srcdir)/doc/avr-mmcu.texi" >&2 ; \
71 echo "***" >&2 ; \
72 false; \
73 fi
74
75 # MULTILIB_OPTIONS
76 # MULTILIB_DIRNAMES
77 # MULTILIB_EXCEPTIONS
78 # MULTILIB_MATCHES
79 $(srcdir)/config/avr/t-multilib: s-avr-mlib; @true
80
81 s-mlib: $(srcdir)/config/avr/t-multilib
82
83 s-avr-mlib: $(srcdir)/config/avr/genmultilib.awk $(AVR_MCUS)
84 $(AWK) -f $< -v FORMAT=Makefile $< $(AVR_MCUS) > tmp-avr-mlib
85 $(SHELL) $(srcdir)/../move-if-change \
86 tmp-avr-mlib $(srcdir)/config/avr/t-multilib
87 $(STAMP) $@