Mercurial > hg > CbC > CbC_gcc
comparison gcc/config/m68k/t-mlibs @ 0:a06113de4d67
first commit
author | kent <kent@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Fri, 17 Jul 2009 14:47:48 +0900 |
parents | |
children | 77e2b8dfacca |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:a06113de4d67 |
---|---|
1 # multilibs -*- mode:Makefile -*- | |
2 | |
3 # An awk command to extract lines from the m68k-devices.def file that | |
4 # match $1 and then print the string defined by $2. Leading and | |
5 # trailing whitespace is removed. $1 & $2 can make use of | |
6 # CPU -- the cpu identifier (has leading 'm'/'mcf') | |
7 # FLAGS -- the cpu capability flags | |
8 # CPU_NAME -- the cpu name (has no leading m/mcf) | |
9 # MLIB -- the multilib cpu name (no leading m/mcf) | |
10 # This is intended to be used as $(call M68K_AWK,predicate,string) | |
11 M68K_AWK = $(strip $(shell $(AWK) 'BEGIN { FS="[ \t]*[,()][ \t]*"; ORS=" " }; \ | |
12 /^M68K_DEVICE/ { CPU=$$3; FLAGS=$$8; \ | |
13 CPU_NAME=substr($$2,2,length($$2)-2); \ | |
14 MLIB=substr($$5,2,length($$5)-2); \ | |
15 if ($1) print $2 }' $(srcdir)/config/m68k/m68k-devices.def)) | |
16 | |
17 # Add a multilib for each distinct architecture. M68K_MLIB_CPU, if defined, | |
18 # adds additional restrictions. | |
19 M68K_MLIB_CPUS := $(call M68K_AWK,\ | |
20 (CPU_NAME == MLIB) $(M68K_MLIB_CPU), \ | |
21 "m"MLIB) | |
22 | |
23 # Make the default cpu the default multilib. | |
24 M68K_MLIB_DEFAULT := $(call M68K_AWK, CPU == "$(target_cpu_default)", MLIB) | |
25 | |
26 ifeq ($(filter m$(M68K_MLIB_DEFAULT),$(M68K_MLIB_CPUS)),) | |
27 $(error Error default cpu '$(target_cpu_default)' is not in multilib set '$(M68K_MLIB_CPUS)') | |
28 endif | |
29 | |
30 # Sed arguments that convert mcpu=* arguments into canonical forms. | |
31 # We want to use the legacy m68* options instead of the new -mcpu=68* | |
32 # options when compiling multilibs because the former are recognised | |
33 # by older binutils. | |
34 CANONICALIZE_OPTIONS = -e 's|mcpu=68|m68|g' -e 's|mcpu=cpu32|mcpu32|g' | |
35 | |
36 MULTILIB_DIRNAMES := $(filter-out m$(M68K_MLIB_DEFAULT),$(M68K_MLIB_CPUS)) | |
37 MULTILIB_OPTIONS := $(shell echo $(MULTILIB_DIRNAMES:m%=mcpu=%) \ | |
38 | sed -e 's| |/|g' $(CANONICALIZE_OPTIONS)) | |
39 | |
40 # Add subtarget specific options & dirs. | |
41 MULTILIB_DIRNAMES += $(M68K_MLIB_DIRNAMES) | |
42 MULTILIB_OPTIONS += $(M68K_MLIB_OPTIONS) | |
43 | |
44 MULTILIB_MATCHES := | |
45 | |
46 ifneq ($(M68K_ARCH),cf) | |
47 # Map the new-style options to the legacy m68k ones. | |
48 MULTILIB_MATCHES += m68000=mcpu?68000 m68000=march?68000 m68000=mc68000 \ | |
49 m68000=m68302 \ | |
50 m68020=mcpu?68020 m68020=march?68020 m68020=mc68020 \ | |
51 m68030=mcpu?68030 m68030=march?68030 \ | |
52 m68040=mcpu?68040 m68040=march?68040 \ | |
53 m68060=mcpu?68060 m68060=march?68060 \ | |
54 mcpu32=mcpu?cpu32 mcpu32=march?cpu32 mcpu32=m68332 | |
55 endif | |
56 | |
57 ifneq ($(M68K_ARCH),m68k) | |
58 # Map the legacy ColdFire options to the new ones. | |
59 MULTILIB_MATCHES += mcpu?5206=m5200 mcpu?5206e=m5206e mcpu?5208=m528x \ | |
60 mcpu?5307=m5300 mcpu?5307=m5307 \ | |
61 mcpu?5407=m5400 mcpu?5407=m5407 \ | |
62 mcpu?5475=mcfv4e | |
63 # Map -march=* options to the representative -mcpu=* option. | |
64 MULTILIB_MATCHES += mcpu?5206e=march?isaa mcpu?5208=march?isaaplus \ | |
65 mcpu?5407=march?isab | |
66 endif | |
67 | |
68 # Match non-representative -mcpu options to their representative option. | |
69 MULTILIB_MATCHES += \ | |
70 $(call M68K_AWK, \ | |
71 (CPU_NAME != MLIB) $(M68K_MLIB_CPU), \ | |
72 (match(MLIB, "^68") || MLIB == "cpu32" \ | |
73 ? "m"MLIB"=mcpu?"CPU_NAME \ | |
74 : "mcpu?"MLIB"=mcpu?"CPU_NAME)) | |
75 | |
76 MULTILIB_EXCEPTIONS := | |
77 | |
78 ifeq ($(firstword $(M68K_MLIB_OPTIONS)),msoft-float) | |
79 # Exclude soft-float multilibs for targets that default to soft-float anyway. | |
80 MULTILIB_EXCEPTIONS += $(call M68K_AWK,\ | |
81 (CPU_NAME == MLIB) $(M68K_MLIB_CPU) \ | |
82 && (((CPU ~ "^mcf") && !match(FLAGS, "FL_CF_FPU")) \ | |
83 || CPU == "cpu32" \ | |
84 || CPU == "m68000"), \ | |
85 "mcpu="MLIB"/msoft-float*") | |
86 endif | |
87 | |
88 # Remove the default CPU from the explicit exceptions. | |
89 MULTILIB_EXCEPTIONS := \ | |
90 $(patsubst mcpu=$(M68K_MLIB_DEFAULT)/%,%,$(MULTILIB_EXCEPTIONS)) | |
91 | |
92 # Convert all options to canonical form. | |
93 MULTILIB_EXCEPTIONS := $(shell echo $(MULTILIB_EXCEPTIONS) | \ | |
94 sed $(CANONICALIZE_OPTIONS)) | |
95 | |
96 LIBGCC = stmp-multilib | |
97 INSTALL_LIBGCC = install-multilib |