1 # Copyright (C) 2021-2023 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 TM_H += $(srcdir)/config/loongarch/loongarch-driver.h
20 OPTIONS_H_EXTRA += $(srcdir)/config/loongarch/loongarch-def.h \
21 $(srcdir)/config/loongarch/loongarch-tune.h
23 # Canonical target triplet from config.gcc
24 LA_MULTIARCH_TRIPLET = $(patsubst LA_MULTIARCH_TRIPLET=%,%,$\
25 $(filter LA_MULTIARCH_TRIPLET=%,$(tm_defines)))
27 # String definition header
28 LA_STR_H = $(srcdir)/config/loongarch/loongarch-str.h
30 # String definition header
31 $(LA_STR_H): s-loongarch-str ; @true
32 s-loongarch-str: $(srcdir)/config/loongarch/genopts/genstr.sh \
33 $(srcdir)/config/loongarch/genopts/loongarch-strings
34 $(SHELL) $(srcdir)/config/loongarch/genopts/genstr.sh header \
35 $(srcdir)/config/loongarch/genopts/loongarch-strings > \
37 $(SHELL) $(srcdir)/../move-if-change tmp-loongarch-str.h \
39 $(STAMP) s-loongarch-str
41 loongarch-c.o: $(srcdir)/config/loongarch/loongarch-c.cc $(CONFIG_H) $(SYSTEM_H) \
42 coretypes.h $(TM_H) $(TREE_H) output.h $(C_COMMON_H) $(TARGET_H)
43 $(COMPILER) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
44 $(srcdir)/config/loongarch/loongarch-c.cc
46 loongarch-builtins.o: $(srcdir)/config/loongarch/loongarch-builtins.cc $(CONFIG_H) \
47 $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(TREE_H) $(RECOG_H) langhooks.h \
48 $(DIAGNOSTIC_CORE_H) $(OPTABS_H) $(srcdir)/config/loongarch/loongarch-ftypes.def \
49 $(srcdir)/config/loongarch/loongarch-modes.def
50 $(COMPILER) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
51 $(srcdir)/config/loongarch/loongarch-builtins.cc
53 loongarch-driver.o : $(srcdir)/config/loongarch/loongarch-driver.cc $(LA_STR_H) \
54 $(CONFIG_H) $(SYSTEM_H)
55 $(COMPILER) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $<
57 loongarch-opts.o: $(srcdir)/config/loongarch/loongarch-opts.cc $(LA_STR_H)
58 $(COMPILER) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $<
60 loongarch-cpu.o: $(srcdir)/config/loongarch/loongarch-cpu.cc $(LA_STR_H)
61 $(COMPILER) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $<
63 loongarch-def.o: $(srcdir)/config/loongarch/loongarch-def.c $(LA_STR_H)
64 $(CC) -c $(ALL_CFLAGS) $(INCLUDES) $<
66 $(srcdir)/config/loongarch/loongarch.opt: s-loongarch-opt ; @true
67 s-loongarch-opt: $(srcdir)/config/loongarch/genopts/genstr.sh \
68 $(srcdir)/config/loongarch/genopts/loongarch.opt.in \
69 $(srcdir)/config/loongarch/genopts/loongarch-strings $(LA_STR_H)
70 $(SHELL) $(srcdir)/config/loongarch/genopts/genstr.sh opt \
71 $(srcdir)/config/loongarch/genopts/loongarch.opt.in \
73 $(SHELL) $(srcdir)/../move-if-change tmp-loongarch.opt \
74 $(srcdir)/config/loongarch/loongarch.opt
75 $(STAMP) s-loongarch-opt