]> git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/config/avr/t-avr
3e1a1ba68f9c888c72c77cf09b3a0fcabfc93387
[thirdparty/gcc.git] / gcc / config / avr / t-avr
1 # Copyright (C) 2000-2020 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
19 HAVE_DOUBLE32 = $(findstring HAVE_DOUBLE32, $(tm_defines))
20 HAVE_DOUBLE64 = $(findstring HAVE_DOUBLE64, $(tm_defines))
21 HAVE_LONG_DOUBLE32 = $(findstring HAVE_LONG_DOUBLE32, $(tm_defines))
22 HAVE_LONG_DOUBLE64 = $(findstring HAVE_LONG_DOUBLE64, $(tm_defines))
23 HAVE_LONG_DOUBLE_IS_DOUBLE = $(findstring HAVE_LONG_DOUBLE_IS_DOUBLE, $(tm_defines))
24
25 ifeq (WITH_DOUBLE32, $(findstring WITH_DOUBLE32, $(tm_defines)))
26 WITH_DOUBLE=32
27 endif
28
29 ifeq (WITH_DOUBLE64, $(findstring WITH_DOUBLE64, $(tm_defines)))
30 WITH_DOUBLE=64
31 endif
32
33 ifeq (WITH_LONG_DOUBLE32, $(findstring WITH_LONG_DOUBLE32, $(tm_defines)))
34 WITH_LONG_DOUBLE=32
35 endif
36
37 ifeq (WITH_LONG_DOUBLE64, $(findstring WITH_LONG_DOUBLE64, $(tm_defines)))
38 WITH_LONG_DOUBLE=64
39 endif
40
41 PASSES_EXTRA += $(srcdir)/config/avr/avr-passes.def
42
43 driver-avr.o: $(srcdir)/config/avr/driver-avr.c \
44 $(CONFIG_H) $(SYSTEM_H) coretypes.h \
45 $(srcdir)/config/avr/avr-arch.h $(TM_H)
46 $(COMPILER) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $<
47
48 avr-devices.o: $(srcdir)/config/avr/avr-devices.c \
49 $(srcdir)/config/avr/avr-mcus.def \
50 $(srcdir)/config/avr/avr-arch.h \
51 $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H)
52 $(COMPILER) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $<
53
54 avr-c.o: $(srcdir)/config/avr/avr-c.c \
55 $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) $(C_COMMON_H)
56 $(COMPILER) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $<
57
58 avr-log.o: $(srcdir)/config/avr/avr-log.c \
59 $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) $(INPUT_H) dumpfile.h
60 $(COMPILER) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $<
61
62 avr.o avr-c.o: $(srcdir)/config/avr/builtins.def
63
64 # This overrides stdfix.h from USER_H which we supply and include
65 # in our own stdfix.h as stdfix-gcc.h.
66
67 EXTRA_HEADERS = $(srcdir)/config/avr/stdfix.h \
68 stdfix-gcc.h
69
70 stdfix-gcc.h: $(srcdir)/ginclude/stdfix.h
71 -cp $< $@
72
73 # Files and Variables auto-generated from avr-mcus.def
74
75 AVR_MCUS = $(srcdir)/config/avr/avr-mcus.def
76
77 # Run `avr-mcus' after you changed or added devices in avr-mcus.def
78
79 .PHONY: avr-mcus
80
81 avr-mcus: $(srcdir)/doc/avr-mmcu.texi ; @true
82
83 # Make sure that native -mmcu= support is in sync with -mmcu= documentation.
84 gen-avr-mmcu-texi$(build_exeext): $(srcdir)/config/avr/gen-avr-mmcu-texi.c \
85 $(AVR_MCUS) $(srcdir)/config/avr/avr-devices.c \
86 $(srcdir)/config/avr/avr-arch.h
87 $(CC_FOR_BUILD) $(CFLAGS_FOR_BUILD) $< -o $@
88
89 gen-avr-mmcu-specs$(build_exeext): $(srcdir)/config/avr/gen-avr-mmcu-specs.c \
90 $(AVR_MCUS) $(srcdir)/config/avr/avr-devices.c \
91 $(srcdir)/config/avr/avr-arch.h $(TM_H)
92 $(CXX_FOR_BUILD) $(CXXFLAGS_FOR_BUILD) $< -o $@ $(INCLUDES)
93
94 $(srcdir)/doc/avr-mmcu.texi: gen-avr-mmcu-texi$(build_exeext)
95 $(RUN_GEN) ./$< > $@
96
97 s-device-specs: gen-avr-mmcu-specs$(build_exeext)
98 rm -rf device-specs
99 mkdir device-specs && cd device-specs && $(RUN_GEN) ../$<
100 $(STAMP) s-device-specs
101
102 GCC_PASSES+=s-device-specs
103
104 install-driver: install-device-specs
105
106 install-device-specs: s-device-specs installdirs
107 -rm -rf $(DESTDIR)$(libsubdir)/device-specs
108 mkdir $(DESTDIR)$(libsubdir)/device-specs
109 -for file in device-specs/*; do \
110 $(INSTALL_DATA) $${file} $(DESTDIR)$(libsubdir)/$${file}; \
111 done
112
113 # Get multilib layout
114 # MULTILIB_OPTIONS
115 # MULTILIB_DIRNAMES
116 # MULTILIB_REQUIRED
117 # MULTILIB_REUSE
118
119 multilib.h Makefile s-mlib: t-multilib-avr
120
121 t-multilib-avr: $(srcdir)/config/avr/genmultilib.awk \
122 $(AVR_MCUS)
123 $(AWK) -v HAVE_LONG_DOUBLE_IS_DOUBLE=$(HAVE_LONG_DOUBLE_IS_DOUBLE) \
124 -v HAVE_DOUBLE32=$(HAVE_DOUBLE32) \
125 -v HAVE_DOUBLE64=$(HAVE_DOUBLE64) \
126 -v HAVE_LONG_DOUBLE32=$(HAVE_LONG_DOUBLE32) \
127 -v HAVE_LONG_DOUBLE64=$(HAVE_LONG_DOUBLE64) \
128 -v with_double=$(WITH_DOUBLE) \
129 -v with_long_double=$(WITH_LONG_DOUBLE) \
130 -f $< $< $(AVR_MCUS) > $@
131
132 include t-multilib-avr