1 # Copyright (C) 2000-2022 Free Software Foundation, Inc.
3 # This file is part of GCC.
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)
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.
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/>.
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))
25 ifeq (WITH_DOUBLE32, $(findstring WITH_DOUBLE32, $(tm_defines)))
29 ifeq (WITH_DOUBLE64, $(findstring WITH_DOUBLE64, $(tm_defines)))
33 ifeq (WITH_LONG_DOUBLE32, $(findstring WITH_LONG_DOUBLE32, $(tm_defines)))
37 ifeq (WITH_LONG_DOUBLE64, $(findstring WITH_LONG_DOUBLE64, $(tm_defines)))
41 PASSES_EXTRA += $(srcdir)/config/avr/avr-passes.def
43 driver-avr.o: $(srcdir)/config/avr/driver-avr.cc \
44 $(CONFIG_H) $(SYSTEM_H) coretypes.h \
45 $(srcdir)/config/avr/avr-arch.h $(TM_H)
46 $(COMPILER) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $<
48 avr-devices.o: $(srcdir)/config/avr/avr-devices.cc \
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) $<
54 avr-c.o: $(srcdir)/config/avr/avr-c.cc \
55 $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) $(C_COMMON_H)
56 $(COMPILER) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $<
58 avr-log.o: $(srcdir)/config/avr/avr-log.cc \
59 $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) $(INPUT_H) dumpfile.h
60 $(COMPILER) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $<
62 avr.o avr-c.o: $(srcdir)/config/avr/builtins.def
64 # This overrides stdfix.h from USER_H which we supply and include
65 # in our own stdfix.h as stdfix-gcc.h.
67 EXTRA_HEADERS = $(srcdir)/config/avr/stdfix.h \
70 stdfix-gcc.h: $(srcdir)/ginclude/stdfix.h
73 # Files and Variables auto-generated from avr-mcus.def
75 AVR_MCUS = $(srcdir)/config/avr/avr-mcus.def
77 # Run `avr-mcus' after you changed or added devices in avr-mcus.def
81 avr-mcus: $(srcdir)/doc/avr-mmcu.texi ; @true
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.cc \
85 $(AVR_MCUS) $(srcdir)/config/avr/avr-devices.cc \
86 $(srcdir)/config/avr/avr-arch.h
87 $(CXX_FOR_BUILD) $(CXXFLAGS_FOR_BUILD) $< -o $@
89 gen-avr-mmcu-specs$(build_exeext): $(srcdir)/config/avr/gen-avr-mmcu-specs.cc \
90 $(AVR_MCUS) $(srcdir)/config/avr/avr-devices.cc \
91 $(srcdir)/config/avr/avr-arch.h $(TM_H)
92 $(CXX_FOR_BUILD) $(CXXFLAGS_FOR_BUILD) $< -o $@ $(INCLUDES)
94 $(srcdir)/doc/avr-mmcu.texi: gen-avr-mmcu-texi$(build_exeext)
97 s-device-specs: gen-avr-mmcu-specs$(build_exeext)
99 mkdir device-specs && cd device-specs && $(RUN_GEN) ../$<
100 $(STAMP) s-device-specs
102 GCC_PASSES+=s-device-specs
104 install-driver: install-device-specs
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}; \
113 # Get multilib layout
119 multilib.h Makefile s-mlib: t-multilib-avr
121 t-multilib-avr: $(srcdir)/config/avr/genmultilib.awk \
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 -v with_multilib_list=$(TM_MULTILIB_CONFIG) \
131 -f $< $< $(AVR_MCUS) > $@
133 include t-multilib-avr