t-avr revision 1.3
1# Copyright (C) 2000-2013 Free Software Foundation, Inc.
2#
3# This file is part of GCC.
4#
5# GCC is free software; you can redistribute it and/or modify
6# it under the terms of the GNU General Public License as published by
7# the Free Software Foundation; either version 3, or (at your option)
8# any later version.
9#
10# GCC is distributed in the hope that it will be useful,
11# but WITHOUT ANY WARRANTY; without even the implied warranty of
12# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13# GNU General Public License for more details.
14#
15# You should have received a copy of the GNU General Public License
16# along with GCC; see the file COPYING3.  If not see
17# <http://www.gnu.org/licenses/>.
18
19driver-avr.o: $(srcdir)/config/avr/driver-avr.c \
20  $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H)
21	$(COMPILER) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $<
22
23avr-devices.o: $(srcdir)/config/avr/avr-devices.c \
24  $(srcdir)/config/avr/avr-mcus.def \
25  $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H)
26	$(COMPILER) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $<
27
28avr-c.o: $(srcdir)/config/avr/avr-c.c \
29  $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) $(C_COMMON_H)
30	$(COMPILER) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $<
31
32avr-log.o: $(srcdir)/config/avr/avr-log.c \
33  $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) $(INPUT_H) dumpfile.h
34	$(COMPILER) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $<
35
36avr.o avr-c.o: $(srcdir)/config/avr/builtins.def
37
38# This overrides stdfix.h from USER_H which we supply and include
39# in our own stdint.h as stdint-gcc.h.
40
41EXTRA_HEADERS = $(srcdir)/config/avr/stdfix.h \
42	      	stdfix-gcc.h
43
44stdfix-gcc.h: $(srcdir)/ginclude/stdfix.h
45	-cp $< $@
46
47# Files and Variables auto-generated from avr-mcus.def
48
49AVR_MCUS = $(srcdir)/config/avr/avr-mcus.def
50
51# Run `avr-mcus' after you changed or added devices in  avr-mcus.def
52
53.PHONY: avr-mcus
54
55avr-mcus: $(srcdir)/config/avr/t-multilib \
56	  $(srcdir)/config/avr/avr-tables.opt \
57	  $(srcdir)/doc/avr-mmcu.texi ; @true
58
59# Make sure that -mmcu= is supported for devices from avr-mcus.def and
60# all -mmcu= values are displayed on the help screen
61$(srcdir)/config/avr/avr-tables.opt: $(srcdir)/config/avr/genopt.sh $(AVR_MCUS)
62	$(SHELL) $< $(AVR_MCUS) > $@
63
64# Make sure that -mmcu= support is in sync with -mmcu= documentation.
65gen-avr-mmcu-texi$(build_exeext): $(srcdir)/config/avr/gen-avr-mmcu-texi.c \
66  $(AVR_MCUS) $(srcdir)/config/avr/avr-devices.c \
67  $(srcdir)/config/avr/avr-arch.h
68	$(CC_FOR_BUILD) $(CFLAGS_FOR_BUILD) $< -o $@
69
70$(srcdir)/doc/avr-mmcu.texi: gen-avr-mmcu-texi$(build_exeext)
71	$(RUN_GEN) ./$< > $@
72
73# Map -mmcu= to the right multilib variant
74# MULTILIB_OPTIONS
75# MULTILIB_DIRNAMES
76# MULTILIB_EXCEPTIONS
77# MULTILIB_MATCHES
78
79s-mlib: $(srcdir)/config/avr/t-multilib
80
81$(srcdir)/config/avr/t-multilib: $(srcdir)/config/avr/genmultilib.awk \
82				 $(AVR_MCUS)
83	$(AWK) -f $< -v FORMAT=Makefile   $< $(AVR_MCUS) > $@
84