aboutsummaryrefslogtreecommitdiff
path: root/gcc/config/loongarch/t-loongarch
blob: 3dd7c4b031e6900f1378021ed4c62a96b2284b23 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
# Copyright (C) 2021-2024 Free Software Foundation, Inc.
#
# This file is part of GCC.
#
# GCC is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your option)
# any later version.
#
# GCC is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with GCC; see the file COPYING3.  If not see
# <http://www.gnu.org/licenses/>.


GTM_H += loongarch-multilib.h
OPTIONS_H_EXTRA += $(srcdir)/config/loongarch/loongarch-def.h	\
		   $(srcdir)/config/loongarch/loongarch-tune.h	\
		   $(srcdir)/config/loongarch/loongarch-cpucfg-map.h

# Canonical target triplet from config.gcc
LA_MULTIARCH_TRIPLET = $(patsubst LA_MULTIARCH_TRIPLET=%,%,$\
$(filter LA_MULTIARCH_TRIPLET=%,$(tm_defines)))

# String definition header
LA_STR_H = $(srcdir)/config/loongarch/loongarch-str.h

# String definition header
$(LA_STR_H): s-loongarch-str ; @true
s-loongarch-str: $(srcdir)/config/loongarch/genopts/genstr.sh \
	$(srcdir)/config/loongarch/genopts/loongarch-strings  \
	$(srcdir)/config/loongarch/genopts/isa-evolution.in
	$(SHELL) $(srcdir)/config/loongarch/genopts/genstr.sh header \
    $(srcdir)/config/loongarch/genopts/loongarch-strings > \
    tmp-loongarch-str.h
	$(SHELL) $(srcdir)/../move-if-change tmp-loongarch-str.h \
		$(LA_STR_H)
	$(STAMP) s-loongarch-str

loongarch-c.o: $(srcdir)/config/loongarch/loongarch-c.cc $(CONFIG_H) $(SYSTEM_H) \
	coretypes.h $(TM_H) $(TREE_H) output.h $(C_COMMON_H) $(TARGET_H)
	$(COMPILER) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
	$(srcdir)/config/loongarch/loongarch-c.cc

loongarch-builtins.o: $(srcdir)/config/loongarch/loongarch-builtins.cc $(CONFIG_H) \
	$(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(TREE_H) $(RECOG_H) langhooks.h \
	$(DIAGNOSTIC_CORE_H) $(OPTABS_H) $(srcdir)/config/loongarch/loongarch-ftypes.def \
	$(srcdir)/config/loongarch/loongarch-modes.def
	$(COMPILER) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
	$(srcdir)/config/loongarch/loongarch-builtins.cc

loongarch-driver.o : $(srcdir)/config/loongarch/loongarch-driver.cc $(LA_STR_H) \
	$(CONFIG_H) $(SYSTEM_H)
	$(COMPILER) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $<

loongarch-opts.o: $(srcdir)/config/loongarch/loongarch-opts.cc $(LA_STR_H)
	$(COMPILER) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $<

loongarch-cpu.o: $(srcdir)/config/loongarch/loongarch-cpu.cc $(LA_STR_H) \
		 $(srcdir)/config/loongarch/loongarch-cpucfg-map.h
	$(COMPILER) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $<

loongarch-def.o: $(srcdir)/config/loongarch/loongarch-def.cc $(LA_STR_H)
	$(COMPILER) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $<

loongarch-d.o: $(srcdir)/config/loongarch/loongarch-d.cc
	$(COMPILE) $<
	$(POSTCOMPILE)

$(srcdir)/config/loongarch/loongarch.opt: s-loongarch-opt ; @true
s-loongarch-opt: $(srcdir)/config/loongarch/genopts/genstr.sh \
	$(srcdir)/config/loongarch/genopts/loongarch.opt.in \
	$(srcdir)/config/loongarch/genopts/isa-evolution.in \
	$(srcdir)/config/loongarch/genopts/loongarch-strings $(LA_STR_H)
	$(SHELL) $(srcdir)/config/loongarch/genopts/genstr.sh opt \
    $(srcdir)/config/loongarch/genopts/loongarch.opt.in \
    > tmp-loongarch.opt
	$(SHELL) $(srcdir)/../move-if-change tmp-loongarch.opt \
    $(srcdir)/config/loongarch/loongarch.opt
	$(STAMP) s-loongarch-opt

$(srcdir)/config/loongarch/loongarch-cpucfg-map.h: s-loongarch-cpucfg-map
	@true
s-loongarch-cpucfg-map: $(srcdir)/config/loongarch/genopts/genstr.sh \
	$(srcdir)/config/loongarch/genopts/isa-evolution.in
	$(SHELL) $< cpucfg-map > tmp-cpucfg.h
	$(SHELL) $(srcdir)/../move-if-change tmp-cpucfg.h \
	    $(srcdir)/config/loongarch/loongarch-cpucfg-map.h
	$(STAMP) $@