]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - share/mk/bsd.cpu.mk
This commit was generated by cvs2svn to compensate for changes in r99679,
[FreeBSD/FreeBSD.git] / share / mk / bsd.cpu.mk
1 # $FreeBSD$
2
3 # Set default baseline values of CPUTYPE based on MACHINE_ARCH -- this is
4 # the minimum CPU type we support for each architecture
5
6 .if ${MACHINE_ARCH} == "i386"
7 CPUTYPE ?= i386
8 .elif ${MACHINE_ARCH} == "alpha"
9 CPUTYPE ?= ev5
10 .elif ${MACHINE_ARCH} == "ia64"
11 CPUTYPE ?= itanium
12 .elif ${MACHINE_ARCH} == "sparc64"
13 CPUTYPE ?= ultrasparc
14 .endif
15
16 # Handle aliases (not documented in make.conf to avoid user confusion
17 # between e.g. i586 and pentium)
18
19 .if ${MACHINE_ARCH} == "i386"
20 . if ${CPUTYPE} == "pentiumpro"
21 CPUTYPE = i686
22 . elif ${CPUTYPE} == "pentium"
23 CPUTYPE = i586
24 . elif ${CPUTYPE} == "athlon"
25 CPUTYPE = k7
26 . endif
27 .endif
28
29 # Logic to set up correct gcc optimization flag.  This must be included
30 # after /etc/make.conf so it can react to the local value of CPUTYPE
31 # defined therein.  Consult:
32 #       http://gcc.gnu.org/onlinedocs/gcc/i386-and-x86-64-Options.html
33 #       http://gcc.gnu.org/onlinedocs/gcc/DEC-Alpha-Options.html
34 #       http://gcc.gnu.org/onlinedocs/gcc/SPARC-Options.html
35 #       http://gcc.gnu.org/onlinedocs/gcc/RS-6000-and-PowerPC-Options.html
36
37 .if !defined(NO_CPU_CFLAGS) || !defined(NO_CPU_COPTFLAGS)
38 . if ${MACHINE_ARCH} == "i386"
39 .  if ${CPUTYPE} == "k7"
40 .   if defined(BOOTSTRAPPING)
41 _CPUCFLAGS = -march=k6          # gcc 2.95.x didn't support athlon
42 .   else
43 _CPUCFLAGS = -march=athlon
44 .   endif
45 .  elif ${CPUTYPE} == "k6-2"
46 _CPUCFLAGS = -march=k6
47 .  elif ${CPUTYPE} == "k6"
48 _CPUCFLAGS = -march=k6
49 .  elif ${CPUTYPE} == "k5"
50 _CPUCFLAGS = -march=pentium
51 .  elif ${CPUTYPE} == "p4"
52 _CPUCFLAGS = -march=pentiumpro
53 .  elif ${CPUTYPE} == "p3"
54 _CPUCFLAGS = -march=pentiumpro
55 .  elif ${CPUTYPE} == "p2"
56 _CPUCFLAGS = -march=pentiumpro
57 .  elif ${CPUTYPE} == "i686"
58 _CPUCFLAGS = -march=pentiumpro
59 .  elif ${CPUTYPE} == "i586/mmx"
60 _CPUCFLAGS = -march=pentium-mmx
61 .  elif ${CPUTYPE} == "i586"
62 _CPUCFLAGS = -march=pentium
63 .  elif ${CPUTYPE} == "i486"
64 _CPUCFLAGS = -march=i486
65 .  endif
66 . elif ${MACHINE_ARCH} == "alpha"
67 .  if ${CPUTYPE} == "ev6"
68 _CPUCFLAGS = -mcpu=ev6
69 .  elif ${CPUTYPE} == "pca56"
70 _CPUCFLAGS = -mcpu=pca56
71 .  elif ${CPUTYPE} == "ev56"
72 _CPUCFLAGS = -mcpu=ev56
73 .  elif ${CPUTYPE} == "ev5"
74 _CPUCFLAGS = -mcpu=ev5
75 .  elif ${CPUTYPE} == "ev45"
76 _CPUCFLAGS = -mcpu=ev4          # No -mcpu=ev45 for gcc
77 .  elif ${CPUTYPE} == "ev4"
78 _CPUCFLAGS = -mcpu=ev4
79 .  endif
80 . endif
81 .endif
82
83 # NB: COPTFLAGS is handled in /usr/src/sys/conf/Makefile.<arch>
84
85 .if !defined(NO_CPU_CFLAGS)
86 CFLAGS += ${_CPUCFLAGS}
87 .endif
88
89 # Set up the list of CPU features based on the CPU type.  This is an
90 # unordered list to make it easy for client makefiles to test for the
91 # presence of a CPU feature.
92
93 .if ${MACHINE_ARCH} == "i386"
94 . if ${CPUTYPE} == "k7"
95 MACHINE_CPU = k7 3dnow mmx k6 k5 i586 i486 i386
96 . elif ${CPUTYPE} == "k6-2"
97 MACHINE_CPU = 3dnow mmx k6 k5 i586 i486 i386
98 . elif ${CPUTYPE} == "k6"
99 MACHINE_CPU = mmx k6 k5 i586 i486 i386
100 . elif ${CPUTYPE} == "k5"
101 MACHINE_CPU = k5 i586 i486 i386
102 . elif ${CPUTYPE} == "p4"
103 MACHINE_CPU = sse i686 mmx i586 i486 i386
104 . elif ${CPUTYPE} == "p3"
105 MACHINE_CPU = sse i686 mmx i586 i486 i386
106 . elif ${CPUTYPE} == "p2"
107 MACHINE_CPU = i686 mmx i586 i486 i386
108 . elif ${CPUTYPE} == "i686"
109 MACHINE_CPU = i686 i586 i486 i386
110 . elif ${CPUTYPE} == "i586/mmx"
111 MACHINE_CPU = mmx i586 i486 i386
112 . elif ${CPUTYPE} == "i586"
113 MACHINE_CPU = i586 i486 i386
114 . elif ${CPUTYPE} == "i486"
115 MACHINE_CPU = i486 i386
116 . elif ${CPUTYPE} == "i386"
117 MACHINE_CPU = i386
118 . endif
119 .elif ${MACHINE_ARCH} == "alpha"
120 . if ${CPUTYPE} == "ev6"
121 MACHINE_CPU = ev6 ev56 pca56 ev5 ev45 ev4
122 . elif ${CPUTYPE} == "pca56"
123 MACHINE_CPU = pca56 ev56 ev5 ev45 ev4
124 . elif ${CPUTYPE} == "ev56"
125 MACHINE_CPU = ev56 ev5 ev45 ev4
126 . elif ${CPUTYPE} == "ev5"
127 MACHINE_CPU = ev5 ev45 ev4
128 . elif ${CPUTYPE} == "ev45"
129 MACHINE_CPU = ev45 ev4
130 . elif ${CPUTYPE} == "ev4"
131 MACHINE_CPU = ev4
132 . endif
133 .elif ${MACHINE_ARCH} == "ia64"
134 . if ${CPUTYPE} == "itanium"
135 MACHINE_CPU = itanium
136 . endif
137 .endif