6 |
7u83 |
1 |
# TenDRA make compiler infrastructure
|
|
|
2 |
#
|
|
|
3 |
# $Id$
|
|
|
4 |
|
|
|
5 |
.if !defined(_TENDRA_COMPILER_MK_)
|
|
|
6 |
_TENDRA_COMPILER_MK_=1
|
|
|
7 |
|
|
|
8 |
# COMPILER INFORMATION
|
|
|
9 |
#
|
|
|
10 |
# These variables give information on the compiler to be used to install
|
|
|
11 |
# the release. CC gives the compiler. CCOPTS and LIBOPTS give any target
|
|
|
12 |
# specific options required by the build, and are set by this script. It
|
|
|
13 |
# is recommended that any extra flags which the user requires are made
|
|
|
14 |
# part of the definition of CC, so CC="gcc -O" would install using gcc
|
|
|
15 |
# in optimising mode. TCCOPTS controls the extra configuration options
|
|
|
16 |
# required when bootstrapping the system using tcc.
|
|
|
17 |
#
|
|
|
18 |
# To install the bootstrapped compiler, install first using cc or gcc.
|
|
|
19 |
# Then remove the work directory (OBJ_DIR), change the compiler to tcc,
|
|
|
20 |
# and install again. Bootstrapping is recommended (all our testing is
|
|
|
21 |
# on the bootstrapped compiler).
|
|
|
22 |
#
|
|
|
23 |
# SYS_INCLUDES gives a list of include file directories to be searched
|
|
|
24 |
# when building the TDF API libraries.
|
|
|
25 |
#
|
|
|
26 |
# STRIP may be set to "strip" in order to ensure that the installed
|
|
|
27 |
# executables are stripped.
|
|
|
28 |
#
|
|
|
29 |
# RANLIB is used on those platforms on which system libraries need to be
|
|
|
30 |
# ranlib-ed.
|
|
|
31 |
#
|
|
|
32 |
# EXEC_SUFFIX is used on those platforms where executable names need to
|
|
|
33 |
# have a particular suffix, for example it may be set to ".exe".
|
|
|
34 |
|
|
|
35 |
.if defined(BOOTSTRAP)
|
|
|
36 |
# Assume that the cc on this system is the GNU C Compiler.
|
|
|
37 |
.if ${CC} == "cc" || ${CC} == "gcc"
|
|
|
38 |
|
|
|
39 |
CWARNFLAGS=-w
|
|
|
40 |
|
|
|
41 |
.if defined(WARNS)
|
|
|
42 |
. if ${WARNS} >= 1
|
|
|
43 |
. if (${CCVER_MAJOR} == 2 && ${CCVER_MINOR} >= 95) || ${CCVER_MAJOR} >= 3
|
|
|
44 |
CWARNFLAGS=-ansi -std=c89 -Wno-traditional
|
|
|
45 |
. else
|
|
|
46 |
CWARNFLAGS=-ansi -Wno-traditional
|
|
|
47 |
. endif
|
|
|
48 |
. endif
|
|
|
49 |
. if ${WARNS} >= 2
|
|
|
50 |
CWARNFLAGS+=-pedantic -fno-builtin
|
|
|
51 |
. endif
|
|
|
52 |
. if ${WARNS} >= 3
|
|
|
53 |
CWARNFLAGS+=-W -Wall -Wmissing-prototypes -Wpointer-arith -Wstrict-prototypes
|
|
|
54 |
. endif
|
|
|
55 |
.endif
|
|
|
56 |
|
|
|
57 |
TCCOPTS=
|
|
|
58 |
CCOPTS+= ${CWARNFLAGS} ${CFLAGS}
|
|
|
59 |
# The Intel C Compiler.
|
|
|
60 |
.elif ${CC} == "icc"
|
|
|
61 |
|
|
|
62 |
CWARNFLAGS=-no-gcc -w
|
|
|
63 |
|
|
|
64 |
.if defined(WARNS)
|
|
|
65 |
. if ${WARNS} >= 1
|
|
|
66 |
CWARNFLAGS=-no-gcc -ansi -std=c89
|
|
|
67 |
. endif
|
|
|
68 |
. if ${WARNS} >= 2
|
|
|
69 |
CWARNFLAGS+=
|
|
|
70 |
. endif
|
|
|
71 |
. if ${WARNS} >= 3
|
|
|
72 |
CWARNFLAGS+=-Wall
|
|
|
73 |
. endif
|
|
|
74 |
.endif
|
|
|
75 |
|
|
|
76 |
TCCOPTS=
|
|
|
77 |
CCOPTS+= ${CWARNFLAGS} ${CFLAGS}
|
|
|
78 |
# The TenDRA C Compiler.
|
|
|
79 |
# XXX: How to differentiate between TenDRA and tinycc?
|
|
|
80 |
.elif ${CC} == "tcc"
|
|
|
81 |
TCCOPTS= -Ysystem
|
|
|
82 |
CCOPTS+=
|
|
|
83 |
.endif
|
|
|
84 |
|
|
|
85 |
.if exists(${OBJ_DIR}/src/utilities/sid/sid)
|
|
|
86 |
SID?= ${OBJ_DIR}/src/utilities/sid/sid
|
|
|
87 |
.else
|
|
|
88 |
SID?= sid
|
|
|
89 |
.endif
|
|
|
90 |
|
|
|
91 |
.if exists(${OBJ_DIR}/src/tools/tcc/tcc)
|
|
|
92 |
TCC?= ${OBJ_DIR}/src/tools/tcc/tcc
|
|
|
93 |
.else
|
|
|
94 |
TCC?= tcc
|
|
|
95 |
.endif
|
|
|
96 |
|
|
|
97 |
.if exists(${OBJ_DIR}/src/tools/tld/tld)
|
|
|
98 |
TLD?= ${OBJ_DIR}/src/tools/tld/tld
|
|
|
99 |
.else
|
|
|
100 |
TLD?= tld
|
|
|
101 |
.endif
|
|
|
102 |
|
|
|
103 |
.if exists(${OBJ_DIR}/src/tools/tnc/tnc)
|
|
|
104 |
TNC?= ${OBJ_DIR}/src/tools/tnc/tnc
|
|
|
105 |
.else
|
|
|
106 |
TNC?= tnc
|
|
|
107 |
.endif
|
|
|
108 |
|
|
|
109 |
.if exists(${OBJ_DIR}/src/tools/tpl/tpl)
|
|
|
110 |
TPL?= ${OBJ_DIR}/src/tools/tpl/tpl
|
|
|
111 |
.else
|
|
|
112 |
TPL?= tpl
|
|
|
113 |
.endif
|
|
|
114 |
|
|
|
115 |
TSPEC?= ${OBJ_DIR}/src/tools/tspec/tspec
|
|
|
116 |
.else # defined(BOOTSTRAP)
|
|
|
117 |
CC= ${TCC}
|
|
|
118 |
TCC= ${BOBJ_DIR}/src/tools/tcc/tcc
|
|
|
119 |
TLD= ${BOBJ_DIR}/src/tools/tld/tld
|
|
|
120 |
TNC= ${BOBJ_DIR}/src/tools/tnc/tnc
|
|
|
121 |
TPL= ${BOBJ_DIR}/src/tools/tpl/tpl
|
|
|
122 |
TSPEC?= ${BOBJ_DIR}/src/tools/tspec/tspec
|
|
|
123 |
# The build env must be the first -Y argument, since it sets the default env
|
|
|
124 |
# search path.
|
|
|
125 |
ENVFLAGS=-Y${BOBJ_DIR}/src/lib/env/build -yTENDRA_BASEDIR=${BOBJ_DIR}/src/
|
|
|
126 |
TCCOPTS2:= ${TCCOPTS}
|
|
|
127 |
TCCOPTS=
|
|
|
128 |
CCOPTS+= ${ENVFLAGS} ${TCCOPTS2}
|
|
|
129 |
.endif
|
|
|
130 |
|
|
|
131 |
CCOPTS+= -D_${OSVER}
|
|
|
132 |
|
|
|
133 |
SYS_INCLUDES= "-I/usr/include"
|
|
|
134 |
STRIP= :
|
|
|
135 |
RANLIB= ranlib
|
|
|
136 |
EXEC_SUFFIX=
|
|
|
137 |
|
|
|
138 |
BUILD_ERRORS= ${BASE_DIR}/src/build/BUILD_ERRORS
|
|
|
139 |
|
|
|
140 |
.endif # !defined(_TENDRA_COMPILER_MK_)
|