-
Notifications
You must be signed in to change notification settings - Fork 4
/
make_qnx.inc
346 lines (335 loc) · 12.2 KB
/
make_qnx.inc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
##############################################################################
# MAKE_QNX.INC - this file is part of Binary vIEW project (BIEW) #
##############################################################################
# Copyrights: 1998, 2000 Nickols_K #
# License: See below #
# Author and developer: Andrew Golovnia #
# Requirement: GNU make #
# Original file name: makefile #
####################### [ D e s c r i p t i o n ] ############################
# This include file is script for make utility of GNU development system. #
########################### [ L i c e n c e ] ################################
# The Binary vIEW (BIEW) is copyright (C) 1995 Nickols_K. #
# All rights reserved. This software is redistributable under the licence #
# given in the file "Licence.en" ("Licence.ru" in russian translation) #
# distributed in the BIEW archive. #
##############################################################################
##############################################################################
# ATTENTION!!! I use manual method configuring of BIEW project rather than #
# 'configure' script technology, because 'configure' script does not work #
# propertly on non *NIX systems (like Cygwin, EMX,...). #
##############################################################################
# Select QNX4 compiler. Valid values are:
# watcomc, gcc(developing in progress)
#-----------------------------------------------------------------------------
COMPILER=gcc
# Select Watcom C 10.6 patch. Valid values are:
# none, a, b
#-----------------------------------------------------------------------------
WATCOM_PATCH=none
# Happy hacking :)
##########################################################################
bad_os = no
bad_machine = no
ifeq ($(TARGET_OS),qnx4)
HOST=qnx
CDEFOS=-D__QNX4__ -D__OS_NAME__='"QNX4"' -D__OS__="qnx" -U__QNX__
CDEFOS += -DHAVE_TERMINAL_OUT=1
ifeq ($(WATCOM_PATCH),a)
CDEFOS+=-D__WATCOMC_A__
endif
ifeq ($(WATCOM_PATCH),b)
CDEFOS+=-D__WATCOMC_A__
CDEFOS+=-D__WATCOMC_B__
endif
OSLDEF=
OS_LIBS= -ltermlib -lunix -lphoton3r.lib
ifeq ($(USE_MOUSE),n)
else
CDEFOS += -DHAVE_MOUSE
OS_LIBS +=
endif
endif
ifeq ($(TARGET_OS),qnx6)
HOST=qnxnto
CDEFOS=-D__QNX6__ -D_CURSES_ -D__OS_NAME__='"QNX6"' -D__OS__="qnxnto"\
-U__NTO__ -U__QNX__
OSLDEF=
OS_LIBS= -lncurses
endif
ifndef HOST
bad_os = yes
endif
##############################################################################
# MACHINE determines hardware platform #
##############################################################################
# WARNING!!! #
# BIEW is designed for ia-16/ia-32 platforms and was not tested on non #
# LITTLE ENDIAN platforms. Project also was not tested on non 16/32 bits #
# systems. If you want you may port project by hand and please bring to #
# author your version (with changes list) #
##############################################################################
ifeq ($(TARGET_OS),qnx4)
ifeq ($(COMPILER),watcomc)
ifeq ($(TARGET_PLATFORM),i386)
MACHINE=ia32
CDEFSYS=-D__MACHINE__=ia32 -D__CPU_NAME__='"i386"' -D__CPU__=386\
-D__DEFAULT_DISASM=0 -3 -fp3 -zp4
OSLDEF=-mh
endif
ifeq ($(TARGET_PLATFORM),i486)
MACHINE=ia32
CDEFSYS=-D__MACHINE__=ia32 -D__CPU_NAME__='"i486"' -D__CPU__=486\
-D__DEFAULT_DISASM=0 -4 -fp3 -zp4
endif
ifeq ($(TARGET_PLATFORM),i586)
MACHINE=ia32
CDEFSYS=-D__MACHINE__=ia32 -D__CPU_NAME__='"i586"' -D__CPU__=586\
-D__DEFAULT_DISASM=0 -5 -fp5 -zp4
endif
ifeq ($(TARGET_PLATFORM),generic)
MACHINE=generic
CDEFSYS=-D__MACHINE__=generic -D__CPU_NAME__='"generic"'\
-D__DEFAULT_DISASM=1 -3 -fp3 -zp4
endif
ifndef MACHINE
bad_machine = yes
endif
ifeq ($(MACHINE),ia32)
CDEFSYS += -Osax
ifeq ($(compilation),advance)
CDEFSYS +=
endif
endif
RM=rm -f
CC=cc
LD=cc
AR=ar -rcu
RANLIB=touch
LIBEXT=lib
LIBPREFIX=
endif
ifeq ($(COMPILER),gcc)
ifeq ($(TARGET_PLATFORM),i386)
MACHINE=ia32
CDEFSYS=-D__MACHINE__=ia32 -D__CPU_NAME__='"i386"' -D__CPU__=386\
-D__DEFAULT_DISASM=0 -DCAN_COMPILE_X86_GAS=1 -m386 -fno-builtin
endif
ifeq ($(TARGET_PLATFORM),i486)
MACHINE=ia32
CDEFSYS=-D__MACHINE__=ia32 -D__CPU_NAME__='"i486"' -D__CPU__=486\
-D__DEFAULT_DISASM=0 -DCAN_COMPILE_X86_GAS=1 -m486
endif
ifeq ($(TARGET_PLATFORM),i586)
MACHINE=ia32
CDEFSYS=-D__MACHINE__=ia32 -D__CPU_NAME__='"i586"' -D__CPU__=586\
-D__DEFAULT_DISASM=0 -DCAN_COMPILE_X86_GAS=1 -march=pentium -mcpu=pentium -fschedule-insns2
endif
ifeq ($(TARGET_PLATFORM),i586mmx)
MACHINE=ia32
CDEFSYS=-D__MACHINE__=ia32 -D__CPU_NAME__='"i586mmx"' -D__CPU__=586\
-D__DEFAULT_DISASM=0 -DCAN_COMPILE_X86_GAS=1 -march=pentium -mcpu=pentium -mmmx\
-fschedule-insns2
endif
ifeq ($(TARGET_PLATFORM),i686)
MACHINE=ia32
CDEFSYS=-D__MACHINE__=ia32 -D__CPU_NAME__='"i686"' -D__CPU__=686\
-D__DEFAULT_DISASM=0 -DCAN_COMPILE_X86_GAS=1 -march=pentiumpro -mcpu=pentiumpro\
-fschedule-insns2
endif
ifeq ($(TARGET_PLATFORM),i686mmx)
MACHINE=ia32
CDEFSYS=-D__MACHINE__=ia32 -D__CPU_NAME__='"i686mmx"' -D__CPU__=686\
-D__DEFAULT_DISASM=0 -DCAN_COMPILE_X86_GAS=1 -march=pentiumpro -mcpu=pentiumpro -mmmx\
-fschedule-insns2
endif
ifeq ($(TARGET_PLATFORM),k5)
MACHINE=ia32
CDEFSYS=-D__MACHINE__=ia32 -D__CPU_NAME__='"amdk5"' -D__CPU__=586\
-D__DEFAULT_DISASM=0 -DCAN_COMPILE_X86_GAS=1 -march=k5 -mcpu=k5 -fschedule-insns2
endif
ifeq ($(TARGET_PLATFORM),k6)
MACHINE=ia32
CDEFSYS=-D__MACHINE__=ia32 -D__CPU_NAME__='"amdk6"' -D__CPU__=586\
-D__DEFAULT_DISASM=0 -DCAN_COMPILE_X86_GAS=1 -march=k6 -mcpu=k6 -fschedule-insns2
endif
ifeq ($(TARGET_PLATFORM),athlon)
MACHINE=ia32
CDEFSYS=-D__MACHINE__=ia32 -D__CPU_NAME__='"athlon"' -D__CPU__=686\
-D__DEFAULT_DISASM=0 -DCAN_COMPILE_X86_GAS=1 -march=athlon -mcpu=athlon\
-fschedule-insns2
endif
ifeq ($(TARGET_PLATFORM),athlon_mmx)
MACHINE=ia32
CDEFSYS=-D__MACHINE__=ia32 -D__CPU_NAME__='"athlon"' -D__CPU__=686\
-D__DEFAULT_DISASM=0 -DCAN_COMPILE_X86_GAS=1 -march=athlon -mcpu=athlon -mmmx\
-fschedule-insns2
endif
ifeq ($(TARGET_PLATFORM),k6mmx)
MACHINE=ia32
CDEFSYS=-D__MACHINE__=ia32 -D__CPU_NAME__='"k6mmx"' -D__CPU__=586\
-D__DEFAULT_DISASM=0 -DCAN_COMPILE_X86_GAS=1 -march=k6 -mcpu=k6 -mmmx -fschedule-insns2
endif
ifeq ($(TARGET_PLATFORM),6x86)
MACHINE=ia32
CDEFSYS=-D__MACHINE__=ia32 -D__CPU_NAME__='"cyrix6x86"' -D_CPU__=586\
-D__DEFAULT_DISASM=0 -DCAN_COMPILE_X86_GAS=1 -march=6x86 -mcpu=6x86 -mmmx -fschedule-insns2
endif
ifeq ($(TARGET_PLATFORM),6x86mx)
MACHINE=ia32
CDEFSYS=-D__MACHINE__=ia32 -D__CPU_NAME__='"cyrix6x86mx"' -D__CPU__=586\
-D__DEFAULT_DISASM=0 -DCAN_COMPILE_X86_GAS=1 -march=6x86mx -mcpu=6x86mx -mmmx\
-fschedule-insns2
endif
ifeq ($(TARGET_PLATFORM),i86)
MACHINE=ia16
CDEFSYS=-D__MACHINE__=ia16 -D__CPU_NAME__='"i86"' -D__CPU__=86\
-D__DEFAULT_DISASM=0 -DCAN_COMPILE_X86_GAS=1
endif
ifeq ($(TARGET_PLATFORM),generic)
MACHINE=generic
CDEFSYS=-D__MACHINE__=generic -D__CPU_NAME__='"generic"'\
-D__DEFAULT_DISASM=1 -fno-builtin
endif
ifndef MACHINE
bad_machine = yes
endif
ifeq ($(MACHINE),ia32)
CDEFSYS += -fshort-enums -O2
ifeq ($(compilation),advance)
CDEFSYS += -mschedule-prologue -momit-leaf-frame-pointer -mmove
endif
endif
RM=rm -f
CC=gcc
LD=gcc
AR=ar -rcu
RANLIB=touch
LIBEXT=a
LIBPREFIX=lib
endif
endif
ifeq ($(TARGET_OS),qnx6)
ifeq ($(TARGET_PLATFORM),i386)
MACHINE=ia32
CDEFSYS=-D__MACHINE__=ia32 -D__CPU_NAME__='"i386"' -D__CPU__=386\
-D__DEFAULT_DISASM=0 -DCAN_COMPILE_X86_GAS=1 -Wc,-m386,-fno-builtin
endif
ifeq ($(TARGET_PLATFORM),i486)
MACHINE=ia32
CDEFSYS=-D__MACHINE__=ia32 -D__CPU_NAME__='"i486"' -D__CPU__=486\
-D__DEFAULT_DISASM=0 -DCAN_COMPILE_X86_GAS=1 -Wc,-m486
endif
ifeq ($(TARGET_PLATFORM),i586)
MACHINE=ia32
CDEFSYS=-D__MACHINE__=ia32 -D__CPU_NAME__='"i586"' -D__CPU__=586\
-D__DEFAULT_DISASM=0 -DCAN_COMPILE_X86_GAS=1 -Wc,-march=pentium,-mcpu=pentium,-fschedule-insns2
endif
ifeq ($(TARGET_PLATFORM),i586mmx)
MACHINE=ia32
CDEFSYS=-D__MACHINE__=ia32 -D__CPU_NAME__='"i586mmx"' -D__CPU__=586\
-D__DEFAULT_DISASM=0 -DCAN_COMPILE_X86_GAS=1 -Wc,-march=pentium,-mcpu=pentium,-mmmx,-fschedule-insns2
endif
ifeq ($(TARGET_PLATFORM),i686)
MACHINE=ia32
CDEFSYS=-D__MACHINE__=ia32 -D__CPU_NAME__='"i686"' -D__CPU__=686\
-D__DEFAULT_DISASM=0 -DCAN_COMPILE_X86_GAS=1 -Wc,-march=pentiumpro,-mcpu=pentiumpro,-fschedule-insns2
endif
ifeq ($(TARGET_PLATFORM),i686mmx)
MACHINE=ia32
CDEFSYS=-D__MACHINE__=ia32 -D__CPU_NAME__='"i686mmx"' -D__CPU__=686\
-D__DEFAULT_DISASM=0 -DCAN_COMPILE_X86_GAS=1 -Wc,-march=pentiumpro,-mcpu=pentiumpro,-mmmx,-fschedule-insns2
endif
ifeq ($(TARGET_PLATFORM),k5)
MACHINE=ia32
CDEFSYS=-D__MACHINE__=ia32 -D__CPU_NAME__='"amdk5"' -D__CPU__=586\
-D__DEFAULT_DISASM=0 -DCAN_COMPILE_X86_GAS=1 -Wc,-march=k5,-mcpu=k5,-fschedule-insns2
endif
ifeq ($(TARGET_PLATFORM),k6)
MACHINE=ia32
CDEFSYS=-D__MACHINE__=ia32 -D__CPU_NAME__='"amdk6"' -D__CPU__=586\
-D__DEFAULT_DISASM=0 -DCAN_COMPILE_X86_GAS=1 -Wc,-march=k6,-mcpu=k6,-fschedule-insns2
endif
ifeq ($(TARGET_PLATFORM),athlon)
MACHINE=ia32
CDEFSYS=-D__MACHINE__=ia32 -D__CPU_NAME__='"athlon"' -D__CPU__=686\
-D__DEFAULT_DISASM=0 -DCAN_COMPILE_X86_GAS=1 -Wc,-march=athlon,-mcpu=athlon,-fschedule-insns2
endif
ifeq ($(TARGET_PLATFORM),athlon_mmx)
MACHINE=ia32
CDEFSYS=-D__MACHINE__=ia32 -D__CPU_NAME__='"athlon"' -D__CPU__=686\
-D__DEFAULT_DISASM=0 -DCAN_COMPILE_X86_GAS=1 -Wc,-march=athlon,-mcpu=athlon,-mmmx,-fschedule-insns2
endif
ifeq ($(TARGET_PLATFORM),k6mmx)
MACHINE=ia32
CDEFSYS=-D__MACHINE__=ia32 -D__CPU_NAME__='"k6mmx"' -D__CPU__=586\
-D__DEFAULT_DISASM=0 -DCAN_COMPILE_X86_GAS=1 -Wc,-march=k6,-mcpu=k6,-mmmx,-fschedule-insns2
endif
ifeq ($(TARGET_PLATFORM),6x86)
MACHINE=ia32
CDEFSYS=-D__MACHINE__=ia32 -D__CPU_NAME__='"cyrix6x86"' -D_CPU__=586\
-D__DEFAULT_DISASM=0 -DCAN_COMPILE_X86_GAS=1 -Wc,-march=6x86,-mcpu=6x86,-mmmx,-fschedule-insns2
endif
ifeq ($(TARGET_PLATFORM),6x86mx)
MACHINE=ia32
CDEFSYS=-D__MACHINE__=ia32 -D__CPU_NAME__='"cyrix6x86mx"' -D__CPU__=586\
-D__DEFAULT_DISASM=0 -DCAN_COMPILE_X86_GAS=1 -Wc,-march=6x86mx,-mcpu=6x86mx,-mmmx,-fschedule-insns2
endif
ifeq ($(TARGET_PLATFORM),i86)
MACHINE=ia16
CDEFSYS=-D__MACHINE__=ia16 -D__CPU_NAME__='"i86"' -D__CPU__=86\
-D__DEFAULT_DISASM=0
endif
ifeq ($(TARGET_PLATFORM),generic)
MACHINE=generic
CDEFSYS=-D__MACHINE__=generic -D__CPU_NAME__='"generic"'\
-D__DEFAULT_DISASM=1 -Wc,-fno-builtin
endif
ifndef MACHINE
bad_machine = yes
endif
ifeq ($(MACHINE),ia32)
CDEFSYS += -O
ifeq ($(compilation),advance)
CDEFSYS +=
endif
endif
RM=rm -f
CC=qcc
LD=qcc
AR=ar -rcou
RANLIB=ranlib
LIBEXT=a
LIBPREFIX=lib
endif
###########################################################################
# CFLAGS set it for optimization #
# LDFLAGS set it for link method #
###########################################################################
CFLAGS = -D__HAVE_PRAGMA_PACK__=1 $(CDEFOS) $(CDEFSYS) $(HOST_CFLAGS)
ifeq ($(findstring debug,$(compilation)),debug)
CFLAGS += -g
ifeq ($(compilation),max_debug)
CFLAGS +=
endif
else
CFLAGS += -DNDEBUG=1
endif
adv_warn =
adv_keys =
ifeq ($(compilation),advance)
CFLAGS += $(adv_keys) $(adv_warn)
endif
ifeq ($(compilation),master)
CFLAGS += $(adv_keys) $(adv_warn)
#-ansi
endif
LDFLAGS = $(OSLDEF) $(HOST_LDFLAGS)
ifeq ($(findstring debug,$(compilation)),debug)
LDFLAGS += -g
else
LDFLAGS +=
endif
ifeq ($(compilation),advance)
LDFLAGS +=
endif