1 |
282 |
jeremybenn |
# Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
|
2 |
|
|
# 2003, 2004, 2006, 2008, 2009 Free Software Foundation, Inc.
|
3 |
|
|
#
|
4 |
|
|
# This file is part of GCC.
|
5 |
|
|
#
|
6 |
|
|
# GCC is free software; you can redistribute it and/or modify
|
7 |
|
|
# it under the terms of the GNU General Public License as published by
|
8 |
|
|
# the Free Software Foundation; either version 3, or (at your option)
|
9 |
|
|
# any later version.
|
10 |
|
|
#
|
11 |
|
|
# GCC is distributed in the hope that it will be useful,
|
12 |
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
13 |
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
14 |
|
|
# GNU General Public License for more details.
|
15 |
|
|
#
|
16 |
|
|
# You should have received a copy of the GNU General Public License
|
17 |
|
|
# along with GCC; see the file COPYING3. If not see
|
18 |
|
|
# .
|
19 |
|
|
|
20 |
|
|
sh-c.o: $(srcdir)/config/sh/sh-c.c \
|
21 |
|
|
$(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(TM_H) $(TM_P_H) coretypes.h
|
22 |
|
|
$(COMPILER) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
|
23 |
|
|
$(srcdir)/config/sh/sh-c.c
|
24 |
|
|
|
25 |
|
|
LIB1ASMSRC = sh/lib1funcs.asm
|
26 |
|
|
LIB1ASMFUNCS = _ashiftrt _ashiftrt_n _ashiftlt _lshiftrt _movmem \
|
27 |
|
|
_movmem_i4 _mulsi3 _sdivsi3 _sdivsi3_i4 _udivsi3 _udivsi3_i4 _set_fpscr \
|
28 |
|
|
_div_table _udiv_qrnnd_16 \
|
29 |
|
|
$(LIB1ASMFUNCS_CACHE)
|
30 |
|
|
LIB1ASMFUNCS_CACHE = _ic_invalidate _ic_invalidate_array
|
31 |
|
|
|
32 |
|
|
TARGET_LIBGCC2_CFLAGS = -mieee
|
33 |
|
|
|
34 |
|
|
# We want fine grained libraries, so use the new code to build the
|
35 |
|
|
# floating point emulation libraries.
|
36 |
|
|
FPBIT = fp-bit.c
|
37 |
|
|
DPBIT = dp-bit.c
|
38 |
|
|
|
39 |
|
|
dp-bit.c: $(srcdir)/config/fp-bit.c
|
40 |
|
|
echo '#ifdef __LITTLE_ENDIAN__' > dp-bit.c
|
41 |
|
|
echo '#define FLOAT_BIT_ORDER_MISMATCH' >>dp-bit.c
|
42 |
|
|
echo '#endif' >> dp-bit.c
|
43 |
|
|
cat $(srcdir)/config/fp-bit.c >> dp-bit.c
|
44 |
|
|
|
45 |
|
|
fp-bit.c: $(srcdir)/config/fp-bit.c
|
46 |
|
|
echo '#define FLOAT' > fp-bit.c
|
47 |
|
|
echo '#ifdef __LITTLE_ENDIAN__' >> fp-bit.c
|
48 |
|
|
echo '#define FLOAT_BIT_ORDER_MISMATCH' >>fp-bit.c
|
49 |
|
|
echo '#endif' >> fp-bit.c
|
50 |
|
|
cat $(srcdir)/config/fp-bit.c >> fp-bit.c
|
51 |
|
|
|
52 |
|
|
DEFAULT_ENDIAN = $(word 1,$(TM_ENDIAN_CONFIG))
|
53 |
|
|
OTHER_ENDIAN = $(word 2,$(TM_ENDIAN_CONFIG))
|
54 |
|
|
|
55 |
|
|
MULTILIB_OPTIONS= $(OTHER_ENDIAN) $(TM_MULTILIB_CONFIG)
|
56 |
|
|
MULTILIB_DIRNAMES=
|
57 |
|
|
|
58 |
|
|
# The separate entries for m2a-nofpu and m2a-single-only with
|
59 |
|
|
# duplicate base libraries are there to make sure we don't ever use an
|
60 |
|
|
# m4* multilib for m2a or vice-versa; they are not compatible. This
|
61 |
|
|
# is why sh2a and sh2a-single need their own multilibs.
|
62 |
|
|
MULTILIB_MATCHES = $(shell \
|
63 |
|
|
multilibs="$(MULTILIB_OPTIONS)" ; \
|
64 |
|
|
for abi in m1,m2,m3,m4-nofpu,m4-100-nofpu,m4-200-nofpu,m4-400,m4-500,m4-340,m4-300-nofpu,m4al,m4a-nofpu \
|
65 |
|
|
m1,m2,m2a-nofpu \
|
66 |
|
|
m2e,m3e,m4-single-only,m4-100-single-only,m4-200-single-only,m4-300-single-only,m4a-single-only \
|
67 |
|
|
m2e,m2a-single-only \
|
68 |
|
|
m4-single,m4-100-single,m4-200-single,m4-300-single,m4a-single \
|
69 |
|
|
m4,m4-100,m4-200,m4-300,m4a \
|
70 |
|
|
m5-32media,m5-compact,m5-32media \
|
71 |
|
|
m5-32media-nofpu,m5-compact-nofpu,m5-32media-nofpu; do \
|
72 |
|
|
subst= ; \
|
73 |
|
|
for lib in `echo $$abi|tr , ' '` ; do \
|
74 |
|
|
if test "`echo $$multilibs|sed s/$$lib//`" != "$$multilibs"; then \
|
75 |
|
|
subst=$$lib ; \
|
76 |
|
|
elif test x$$subst != x ; then \
|
77 |
|
|
echo $$subst=$$lib ; \
|
78 |
|
|
fi \
|
79 |
|
|
done \
|
80 |
|
|
done)
|
81 |
|
|
|
82 |
|
|
# SH1 only supports big endian.
|
83 |
|
|
MULTILIB_EXCEPTIONS = ml/m1 ml/m2a* $(TM_MULTILIB_EXCEPTIONS_CONFIG)
|
84 |
|
|
|
85 |
|
|
MULTILIB_OSDIRNAMES = \
|
86 |
|
|
$(OTHER_ENDIAN)=!$(OTHER_ENDIAN) \
|
87 |
|
|
m1=!m1 $(OTHER_ENDIAN)/m1=!$(OTHER_ENDIAN)/m1 \
|
88 |
|
|
m2a=!m2a $(OTHER_ENDIAN)/m2a=!$(OTHER_ENDIAN)/m2a \
|
89 |
|
|
m2a-nofpu=!m2a-nofpu $(OTHER_ENDIAN)/m2a-nofpu=!$(OTHER_ENDIAN)/m2a-nofpu \
|
90 |
|
|
m2a-single-only=!m2a-single-only $(OTHER_ENDIAN)/m2a-single-only=!$(OTHER_ENDIAN)/m2a-single-only \
|
91 |
|
|
m2a-single=!m2a-single $(OTHER_ENDIAN)/m2a-single=!$(OTHER_ENDIAN)/m2a-single \
|
92 |
|
|
m2e=!m2e $(OTHER_ENDIAN)/m2e=!$(OTHER_ENDIAN)/m2e \
|
93 |
|
|
m2=!m2 $(OTHER_ENDIAN)/m2=!$(OTHER_ENDIAN)/m2 \
|
94 |
|
|
m3e=!m3e $(OTHER_ENDIAN)/m3e=!$(OTHER_ENDIAN)/m3e \
|
95 |
|
|
m3=!m3 $(OTHER_ENDIAN)/m3=!$(OTHER_ENDIAN)/m3 \
|
96 |
|
|
m4-nofpu=!m4-nofpu $(OTHER_ENDIAN)/m4-nofpu=!$(OTHER_ENDIAN)/m4-nofpu \
|
97 |
|
|
m4-single-only=!m4-single-only $(OTHER_ENDIAN)/m4-single-only=!$(OTHER_ENDIAN)/m4-single-only \
|
98 |
|
|
m4-single=!m4-single $(OTHER_ENDIAN)/m4-single=!$(OTHER_ENDIAN)/m4-single \
|
99 |
|
|
m4=!m4 $(OTHER_ENDIAN)/m4=!$(OTHER_ENDIAN)/m4 \
|
100 |
|
|
m4a-nofpu=!m4a-nofpu $(OTHER_ENDIAN)/m4a-nofpu=!$(OTHER_ENDIAN)/m4a-nofpu \
|
101 |
|
|
m4a-single-only=!m4a-single-only $(OTHER_ENDIAN)/m4a-single-only=!$(OTHER_ENDIAN)/m4a-single-only \
|
102 |
|
|
m4a-single=!m4a-single $(OTHER_ENDIAN)/m4a-single=!$(OTHER_ENDIAN)/m4a-single \
|
103 |
|
|
m4a=!m4a $(OTHER_ENDIAN)/m4a=!$(OTHER_ENDIAN)/m4a \
|
104 |
|
|
m4al=!m4al $(OTHER_ENDIAN)/m4al=!$(OTHER_ENDIAN)/m4al \
|
105 |
|
|
m5-32media=!m5-32media $(OTHER_ENDIAN)/m5-32media=!$(OTHER_ENDIAN)/m5-32media \
|
106 |
|
|
m5-32media-nofpu=!m5-32media-nofpu $(OTHER_ENDIAN)/m5-32media-nofpu=!$(OTHER_ENDIAN)/m5-32media-nofpu \
|
107 |
|
|
m5-compact=!m5-compact $(OTHER_ENDIAN)/m5-compact=!$(OTHER_ENDIAN)/m5-compact \
|
108 |
|
|
m5-compact-nofpu=!m5-compact-nofpu $(OTHER_ENDIAN)/m5-compact-nofpu=!$(OTHER_ENDIAN)/m5-compact-nofpu \
|
109 |
|
|
m5-64media=!m5-64media $(OTHER_ENDIAN)/m5-64media=!$(OTHER_ENDIAN)/m5-64media \
|
110 |
|
|
m5-64media-nofpu=!m5-64media-nofpu $(OTHER_ENDIAN)/m5-64media-nofpu=!$(OTHER_ENDIAN)/m5-64media-nofpu
|
111 |
|
|
|
112 |
|
|
LIBGCC = stmp-multilib
|
113 |
|
|
INSTALL_LIBGCC = install-multilib
|
114 |
|
|
|
115 |
|
|
$(T)crt1.o: $(srcdir)/config/sh/crt1.asm $(GCC_PASSES)
|
116 |
|
|
$(GCC_FOR_TARGET) $(MULTILIB_CFLAGS) -c -o $(T)crt1.o -x assembler-with-cpp $(srcdir)/config/sh/crt1.asm
|
117 |
|
|
$(T)crti.o: $(srcdir)/config/sh/crti.asm $(GCC_PASSES)
|
118 |
|
|
$(GCC_FOR_TARGET) $(MULTILIB_CFLAGS) -c -o $(T)crti.o -x assembler-with-cpp $(srcdir)/config/sh/crti.asm
|
119 |
|
|
$(T)crtn.o: $(srcdir)/config/sh/crtn.asm $(GCC_PASSES)
|
120 |
|
|
$(GCC_FOR_TARGET) $(MULTILIB_CFLAGS) -c -o $(T)crtn.o -x assembler-with-cpp $(srcdir)/config/sh/crtn.asm
|
121 |
|
|
|
122 |
|
|
$(out_object_file): gt-sh.h
|
123 |
|
|
gt-sh.h : s-gtype ; @true
|
124 |
|
|
|
125 |
|
|
# These are not suitable for COFF.
|
126 |
|
|
# EXTRA_MULTILIB_PARTS= crt1.o crti.o crtn.o crtbegin.o crtend.o
|
127 |
|
|
|
128 |
|
|
IC_EXTRA_PARTS= libic_invalidate_array_4-100.a libic_invalidate_array_4-200.a \
|
129 |
|
|
libic_invalidate_array_4a.a
|
130 |
|
|
OPT_EXTRA_PARTS= libgcc-Os-4-200.a libgcc-4-300.a
|
131 |
|
|
EXTRA_MULTILIB_PARTS= $(IC_EXTRA_PARTS) $(OPT_EXTRA_PARTS)
|
132 |
|
|
|
133 |
|
|
$(T)ic_invalidate_array_4-100.o: $(srcdir)/config/sh/lib1funcs.asm $(GCC_PASSES)
|
134 |
|
|
$(GCC_FOR_TARGET) $(MULTILIB_CFLAGS) -c -o $(T)ic_invalidate_array_4-100.o -DL_ic_invalidate_array -DWAYS=1 -DWAY_SIZE=0x2000 -x assembler-with-cpp $(srcdir)/config/sh/lib1funcs.asm
|
135 |
|
|
$(T)libic_invalidate_array_4-100.a: $(T)ic_invalidate_array_4-100.o $(GCC_PASSES)
|
136 |
|
|
$(AR_CREATE_FOR_TARGET) $(T)libic_invalidate_array_4-100.a $(T)ic_invalidate_array_4-100.o
|
137 |
|
|
|
138 |
|
|
$(T)ic_invalidate_array_4-200.o: $(srcdir)/config/sh/lib1funcs.asm $(GCC_PASSES)
|
139 |
|
|
$(GCC_FOR_TARGET) $(MULTILIB_CFLAGS) -c -o $(T)ic_invalidate_array_4-200.o -DL_ic_invalidate_array -DWAYS=2 -DWAY_SIZE=0x2000 -x assembler-with-cpp $(srcdir)/config/sh/lib1funcs.asm
|
140 |
|
|
$(T)libic_invalidate_array_4-200.a: $(T)ic_invalidate_array_4-200.o $(GCC_PASSES)
|
141 |
|
|
$(AR_CREATE_FOR_TARGET) $(T)libic_invalidate_array_4-200.a $(T)ic_invalidate_array_4-200.o
|
142 |
|
|
|
143 |
|
|
$(T)ic_invalidate_array_4a.o: $(srcdir)/config/sh/lib1funcs.asm $(GCC_PASSES)
|
144 |
|
|
$(GCC_FOR_TARGET) $(MULTILIB_CFLAGS) -c -o $(T)ic_invalidate_array_4a.o -DL_ic_invalidate_array -D__FORCE_SH4A__ -x assembler-with-cpp $(srcdir)/config/sh/lib1funcs.asm
|
145 |
|
|
$(T)libic_invalidate_array_4a.a: $(T)ic_invalidate_array_4a.o $(GCC_PASSES)
|
146 |
|
|
$(AR_CREATE_FOR_TARGET) $(T)libic_invalidate_array_4a.a $(T)ic_invalidate_array_4a.o
|
147 |
|
|
|
148 |
|
|
$(T)sdivsi3_i4i-Os-4-200.o: $(srcdir)/config/sh/lib1funcs-Os-4-200.asm $(GCC_PASSES)
|
149 |
|
|
$(GCC_FOR_TARGET) $(MULTILIB_CFLAGS) -c -o $@ -DL_sdivsi3_i4i -x assembler-with-cpp $<
|
150 |
|
|
$(T)udivsi3_i4i-Os-4-200.o: $(srcdir)/config/sh/lib1funcs-Os-4-200.asm $(GCC_PASSES)
|
151 |
|
|
$(GCC_FOR_TARGET) $(MULTILIB_CFLAGS) -c -o $@ -DL_udivsi3_i4i -x assembler-with-cpp $<
|
152 |
|
|
$(T)unwind-dw2-Os-4-200.o: $(srcdir)/unwind-dw2.c $(srcdir)/unwind-generic.h unwind-pe.h unwind.inc unwind-dw2-fde.h unwind-dw2.h $(CONFIG_H) coretypes.h $(TM_H) $(MACHMODE_H) longlong.h config.status stmp-int-hdrs tsystem.h $(GCC_PASSES)
|
153 |
|
|
$(GCC_FOR_TARGET) $(MULTILIB_CFLAGS) $(LIBGCC2_CFLAGS) $(INCLUDES) $(vis_hide) -fexceptions -Os -c -o $@ $<
|
154 |
|
|
OBJS_Os_4_200=$(T)sdivsi3_i4i-Os-4-200.o $(T)udivsi3_i4i-Os-4-200.o $(T)unwind-dw2-Os-4-200.o
|
155 |
|
|
$(T)libgcc-Os-4-200.a: $(OBJS_Os_4_200) $(GCC_PASSES)
|
156 |
|
|
$(AR_CREATE_FOR_TARGET) $@ $(OBJS_Os_4_200)
|
157 |
|
|
|
158 |
|
|
$(T)div_table-4-300.o: $(srcdir)/config/sh/lib1funcs-4-300.asm $(GCC_PASSES)
|
159 |
|
|
$(GCC_FOR_TARGET) $(MULTILIB_CFLAGS) -c -o $@ -DL_div_table -x assembler-with-cpp $<
|
160 |
|
|
|
161 |
|
|
$(T)libgcc-4-300.a: $(T)div_table-4-300.o $(GCC_PASSES)
|
162 |
|
|
$(AR_CREATE_FOR_TARGET) $@ $(T)div_table-4-300.o
|
163 |
|
|
|
164 |
|
|
# Local Variables:
|
165 |
|
|
# mode: Makefile
|
166 |
|
|
# End:
|