1 |
282 |
jeremybenn |
# Copyright (C) 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
|
2 |
|
|
#
|
3 |
|
|
# This file is free software; you can redistribute it and/or modify it under
|
4 |
|
|
# the terms of the GNU General Public License as published by the Free
|
5 |
|
|
# Software Foundation; either version 3 of the License, or (at your option)
|
6 |
|
|
# any later version.
|
7 |
|
|
#
|
8 |
|
|
# This file is distributed in the hope that it will be useful, but WITHOUT
|
9 |
|
|
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
10 |
|
|
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
11 |
|
|
# for more details.
|
12 |
|
|
#
|
13 |
|
|
# You should have received a copy of the GNU General Public License
|
14 |
|
|
# along with GCC; see the file COPYING3. If not see
|
15 |
|
|
# .
|
16 |
|
|
|
17 |
|
|
# Define system directory to match STANDARD_INCLUDE_DIR in spu-elf.h,
|
18 |
|
|
# allowing combined SPU/PPU sysroot builds.
|
19 |
|
|
NATIVE_SYSTEM_HEADER_DIR = /include
|
20 |
|
|
|
21 |
|
|
# Suppress building libgcc1.a
|
22 |
|
|
LIBGCC1 =
|
23 |
|
|
CROSS_LIBGCC1 =
|
24 |
|
|
|
25 |
|
|
TARGET_LIBGCC2_CFLAGS = -fPIC -mwarn-reloc -D__IN_LIBGCC2
|
26 |
|
|
|
27 |
|
|
# We exclude those because the libgcc2.c default versions do not support
|
28 |
|
|
# the SPU single-precision format (round towards zero). We provide our
|
29 |
|
|
# own versions below.
|
30 |
|
|
LIB2FUNCS_EXCLUDE = _floatdisf _floatundisf
|
31 |
|
|
|
32 |
|
|
# We provide our own version of __divdf3 that performs better and has
|
33 |
|
|
# better support for non-default rounding modes.
|
34 |
|
|
DPBIT_FUNCS := $(filter-out _div_df, $(DPBIT_FUNCS))
|
35 |
|
|
|
36 |
|
|
LIB2FUNCS_STATIC_EXTRA = $(srcdir)/config/spu/float_unssidf.c \
|
37 |
|
|
$(srcdir)/config/spu/float_unsdidf.c \
|
38 |
|
|
$(srcdir)/config/spu/float_unsdisf.c \
|
39 |
|
|
$(srcdir)/config/spu/float_disf.c \
|
40 |
|
|
$(srcdir)/config/spu/mfc_tag_table.c \
|
41 |
|
|
$(srcdir)/config/spu/mfc_tag_reserve.c \
|
42 |
|
|
$(srcdir)/config/spu/mfc_tag_release.c \
|
43 |
|
|
$(srcdir)/config/spu/mfc_multi_tag_reserve.c \
|
44 |
|
|
$(srcdir)/config/spu/mfc_multi_tag_release.c \
|
45 |
|
|
$(srcdir)/config/spu/multi3.c \
|
46 |
|
|
$(srcdir)/config/spu/divmodti4.c \
|
47 |
|
|
$(srcdir)/config/spu/divv2df3.c
|
48 |
|
|
|
49 |
|
|
LIB2ADDEH = $(srcdir)/unwind-dw2.c $(srcdir)/unwind-dw2-fde.c \
|
50 |
|
|
$(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c
|
51 |
|
|
|
52 |
|
|
# We want fine grained libraries, so use the new code to build the
|
53 |
|
|
# floating point emulation libraries.
|
54 |
|
|
FPBIT = fp-bit.c
|
55 |
|
|
DPBIT = dp-bit.c
|
56 |
|
|
|
57 |
|
|
dp-bit.c: $(srcdir)/config/fp-bit.c $(srcdir)/config/spu/t-spu-elf
|
58 |
|
|
echo '#undef US_SOFTWARE_GOFAST' > dp-bit.c
|
59 |
|
|
cat $(srcdir)/config/fp-bit.c >> dp-bit.c
|
60 |
|
|
|
61 |
|
|
fp-bit.c: $(srcdir)/config/fp-bit.c $(srcdir)/config/spu/t-spu-elf
|
62 |
|
|
echo '#define FLOAT' > fp-bit.c
|
63 |
|
|
echo '#undef US_SOFTWARE_GOFAST' >> fp-bit.c
|
64 |
|
|
cat $(srcdir)/config/fp-bit.c >> fp-bit.c
|
65 |
|
|
|
66 |
|
|
# Don't let CTOR_LIST end up in sdata section.
|
67 |
|
|
CRTSTUFF_T_CFLAGS =
|
68 |
|
|
|
69 |
|
|
# Multi-lib support.
|
70 |
|
|
MULTILIB_OPTIONS=mea64
|
71 |
|
|
|
72 |
|
|
# Neither gcc or newlib seem to have a standard way to generate multiple
|
73 |
|
|
# crt*.o files. So we don't use the standard crt0.o name anymore.
|
74 |
|
|
|
75 |
|
|
EXTRA_MULTILIB_PARTS = crtbegin.o crtend.o libgcc_cachemgr.a libgcc_cachemgr_nonatomic.a \
|
76 |
|
|
libgcc_cache8k.a libgcc_cache16k.a libgcc_cache32k.a libgcc_cache64k.a libgcc_cache128k.a
|
77 |
|
|
|
78 |
|
|
$(T)cachemgr.o: $(srcdir)/config/spu/cachemgr.c
|
79 |
|
|
$(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) $(MULTILIB_CFLAGS) -c $< -o $@
|
80 |
|
|
|
81 |
|
|
# Specialised rule to add a -D flag.
|
82 |
|
|
$(T)cachemgr_nonatomic.o: $(srcdir)/config/spu/cachemgr.c
|
83 |
|
|
$(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) $(MULTILIB_CFLAGS) -DNONATOMIC -c $< -o $@
|
84 |
|
|
|
85 |
|
|
$(T)libgcc_%.a: $(T)%.o
|
86 |
|
|
$(AR_FOR_TARGET) -rcs $@ $<
|
87 |
|
|
|
88 |
|
|
$(T)cache8k.o: $(srcdir)/config/spu/cache.S
|
89 |
|
|
$(GCC_FOR_TARGET) $(MULTILIB_CFLAGS) -D__CACHE_SIZE__=8 -o $@ -c $<
|
90 |
|
|
|
91 |
|
|
$(T)cache16k.o: $(srcdir)/config/spu/cache.S
|
92 |
|
|
$(GCC_FOR_TARGET) $(MULTILIB_CFLAGS) -D__CACHE_SIZE__=16 -o $@ -c $<
|
93 |
|
|
|
94 |
|
|
$(T)cache32k.o: $(srcdir)/config/spu/cache.S
|
95 |
|
|
$(GCC_FOR_TARGET) $(MULTILIB_CFLAGS) -D__CACHE_SIZE__=32 -o $@ -c $<
|
96 |
|
|
|
97 |
|
|
$(T)cache64k.o: $(srcdir)/config/spu/cache.S
|
98 |
|
|
$(GCC_FOR_TARGET) $(MULTILIB_CFLAGS) -D__CACHE_SIZE__=64 -o $@ -c $<
|
99 |
|
|
|
100 |
|
|
$(T)cache128k.o: $(srcdir)/config/spu/cache.S
|
101 |
|
|
$(GCC_FOR_TARGET) $(MULTILIB_CFLAGS) -D__CACHE_SIZE__=128 -o $@ -c $<
|
102 |
|
|
|
103 |
|
|
LIBGCC = stmp-multilib
|
104 |
|
|
INSTALL_LIBGCC = install-multilib
|
105 |
|
|
|
106 |
|
|
spu.o: $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
|
107 |
|
|
$(RTL_H) $(REGS_H) hard-reg-set.h \
|
108 |
|
|
real.h insn-config.h conditions.h insn-attr.h flags.h $(RECOG_H) \
|
109 |
|
|
$(OBSTACK_H) $(TREE_H) $(EXPR_H) $(OPTABS_H) except.h function.h \
|
110 |
|
|
output.h $(BASIC_BLOCK_H) $(INTEGRATE_H) toplev.h $(GGC_H) $(HASHTAB_H) \
|
111 |
|
|
$(TM_P_H) $(TARGET_H) $(TARGET_DEF_H) langhooks.h reload.h cfglayout.h \
|
112 |
|
|
$(srcdir)/config/spu/spu-protos.h \
|
113 |
|
|
$(srcdir)/config/spu/spu-builtins.def
|
114 |
|
|
|
115 |
|
|
spu-c.o: $(srcdir)/config/spu/spu-c.c \
|
116 |
|
|
$(srcdir)/config/spu/spu-protos.h \
|
117 |
|
|
$(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(CPPLIB_H) \
|
118 |
|
|
$(TM_P_H) c-pragma.h coretypes.h $(TM_H) insn-codes.h
|
119 |
|
|
$(COMPILER) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
|
120 |
|
|
$(srcdir)/config/spu/spu-c.c
|