-
Notifications
You must be signed in to change notification settings - Fork 22
/
Copy pathmake.cnf
328 lines (286 loc) · 8.7 KB
/
make.cnf
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
# Top-level makefile for BREXX V2
# BREXX interpreter
# Version: 2.1
# Copyright (C) 1991-2011 Vasilis Vlachoudis ([email protected])
#
# This interpreter is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
#
# The following variables are passed to each Makefile:
#
# REXX_EXE interpreter executable name usually (rexx)
# LSTR_LIB the name of the lstring "lstr" library file (usually liblstr.a)
# CC the C compiler (usually cc or gcc)
# CFLAGS flags to C compiler (usually -O)
# MAKELIB the command and flags to make a library file (usually "ar rcv")
# ALIGN Normally this option should be set for faster results.
#
# HAVE_SETENV if the compiler has the setenv() function.
# HAVE_READLINE use the readline package for input
# HAVE_READLINE_HISTORY
#
# To add a new system configuration just follow the examples below and update
# the top-level Makefile.
#
# The allowable defines can be found in the inc/os.h file
#
############## Some COMMON macros ##################
INCDIR = ../inc
LIBDIR = ../lstring
###############
# Android
#
# Create first a standalone toolchain, since with the new ndk
# the sysroot is no longer working from the default directory
# https://developer.android.com/ndk/guides/standalone_toolchain
# http://zwyuan.github.io/2015/12/22/three-ways-to-use-android-ndk-cross-compiler/
###############
ANDNDK = /opt/android-ndk
ANDOS = 24
#ANDARCH = arm
ANDARCH = aarch64
#ANDBIT = linux-x86
#ANDBIT = linux-x86_64
ANDBIT := linux-${shell uname -p}
#ANDBIN := $(ANDNDK)/toolchains/${ANDARCH}-linux-androideabi-${ANDVER}/prebuilt/$(ANDBIT)/bin
#ANDROOT := $(ANDNDK)/platforms/android-${ANDOS}/arch-$(ANDARCH)
#ANDARM := $(ANDBIN)/${ANDARCH}-linux-androideabi
#ANDARM := $(ANDNDK)/android-$(ANDOS)/bin/${ANDARCH}-linux-androideabi
ANDARM := $(ANDNDK)/android-$(ANDOS)/bin/${ANDARCH}-linux-android
ANDLINKER = /system/bin/linker
# Support of Greek character set
#GREEK=-DGREEK
# Remove the last new-line character of the output of a system command
# like say 'date'()
RMLAST = -DRMLAST
MAIN = main.c
# For DOS32 it is overiden below
RM = rm -f
EXTRA =
# Static or dynamic linking
STATIC = yes
CC = cc
CPP = cpp
MAKELIB = ar ruv
REXX_EXE = rexx
LSTR_LIB = liblstring.a
LSTR_SO = liblstring.so
CCOPTIONS = $(CFLAGS) $(GREEK) $(RMLAST) -I$(INCDIR)
USRLIB = /usr/lib
################### Install Directories ###############
INSTALL = install
ifeq (.$(PREFIX),.)
PREFIX = /usr/local
endif
INSBIN := $(PREFIX)/bin
INSINC := $(PREFIX)/include/brexx
INSLIB := $(PREFIX)/lib/
INSLIBR := $(PREFIX)/lib/brexx
INSSHA := $(PREFIX)/share/brexx
INSDOC := $(PREFIX)/share/doc/brexx
################### OS specific #######################
aix:
$(MAKE) targets \
"EXTRA = rxunix.c" \
"CFLAGS = -Aa -O3 -DALIGN"
aix_debug:
$(MAKE) targets \
"EXTRA = rxunix.c" \
"CFLAGS = -Aa -g -D__DEBUG__ -DALIGN"
alpha:
$(MAKE) targets \
"EXTRA = rxunix.c" \
"CFLAGS = -O3 -DALIGN -DHAVE_SETENV"
alpha_debug:
$(MAKE) targets \
"EXTRA = rxunix.c" \
"CFLAGS = -g -D__DEBUG__ -DALIGN -DHAVE_SETENV"
amiga:
$(MAKE) targets \
"CC = gcc" \
"CFLAGS = -O2 -DALIGN -DINLINE"
android:
$(MAKE) targets \
"CC = $(ANDARM)-gcc" \
"CPP = $(ANDARM)-cpp" \
"STATIC = no" \
"CFLAGS = -O -rdynamic -pie -fPIE -fPIC -DALIGN -DINLINE -DANDROID -D__ANDROID_API__=${ANDOS}" \
"LDEXTRA = -ldl -lm" \
"LIBEXTRA = -ldl -lm"
# "CFLAGS = -O -rdynamic -fpic -pie -fPIE -DALIGN -DINLINE -DANDROID --sysroot=$(ANDROOT)" \
android_debug:
$(MAKE) targets \
"CC = $(ANDARM)-gcc" \
"CPP = $(ANDARM)-cpp" \
"STATIC = no" \
"CFLAGS = -O0 -g -rdynamic -fPIE -fPIC -D__DEBUG__ -DALIGN -DINLINE -DANDROID -D__ANDROID_API__=${ANDOS}" \
"LDEXTRA = -pie -ldl -lm" \
"LIBEXTRA = -ldl -lm"
# "CFLAGS = -O0 -g -rdynamic -fpic -pie -fPIE -D__DEBUG__ -DALIGN -DINLINE -DANDROID --sysroot=$(ANDROOT)" \
bc:
$(MAKE) targets \
"REXX_EXE = rexx.exe" \
"LSTR_LIB = lstr.lib" \
"CC = bcc" \
"CFLAGS = -g -D__DEBUG__ -DALIGN" \
"MAKELIB = tlib lstr.lib -+"
dos32:
$(MAKE) targets \
"REXX_EXE = rexx.exe" \
"CC = gcc" \
"RM = del" \
"CFLAGS = -O2 -DMSDOS -DALIGN -DINLINE -DRXCONIO" \
"EXTRA = rxconio.c"
gcc:
$(MAKE) targets \
"CC = gcc" \
"CFLAGS = -O -DALIGN -DINLINE"
gcc_debug:
$(MAKE) targets \
"CC = gcc" \
"CFLAGS = -g -pg -Wall -DALIGN -D__DEBUG__"
# cygwin
cygwin:
$(MAKE) targets \
"CC = gcc" \
"STATIC = no" \
"EXTRA = " \
"CFLAGS = -O2 -fpic -DALIGN -DINLINE -DHAVE_SETENV -DHAVE_READLINE" \
"LDEXTRA = -lreadline -lnsl -ldl -lm" \
"LIBEXTRA = -lreadline -lnsl -ldl -lm -Wl,-rpath"
# cygwin
cygwin2:
$(MAKE) targets \
"CC = gcc" \
"STATIC = yes" \
"EXTRA = " \
"CFLAGS = -O2 -fpic -DALIGN -DINLINE -DHAVE_SETENV -DHAVE_READLINE" \
"LDEXTRA = -nostdlib -lreadline -lnsl -ldl -lm" \
"LIBEXTRA = -lreadline -lnsl -ldl -lm -Wl,-rpath"
# termux
termux:
$(MAKE) targets \
"CC = cc" \
"STATIC = no" \
"EXTRA = " \
"CFLAGS = -O2 -fpic -DALIGN -DINLINE -DHAVE_SETENV -DHAVE_READLINE" \
"LDEXTRA = -lreadline -ldl -lm" \
"LIBEXTRA = -lreadline -ldl -lm"
# linux dynamic
linux:
$(MAKE) targets \
"CC = cc" \
"STATIC = no" \
"EXTRA = " \
"CFLAGS = -O2 -fno-stack-protector -fpic -DALIGN -DINLINE -DHAVE_SETENV -DHAVE_READLINE" \
"LDEXTRA = -nostdlib -lreadline -ldl -lm" \
"LIBEXTRA = -lreadline -ldl -lm -Wl,-rpath"
# "LDEXTRA = -nostdlib -lreadline -lnsl -ldl -lm" \
# "LIBEXTRA = -lreadline -lnsl -ldl -lm -Wl,-rpath"
# linux debug
linux_debug:
$(MAKE) targets \
"CC = gcc" \
"EXTRA = " \
"CFLAGS = -g -fno-stack-protector -fpic -rdynamic -D__DEBUG__ -DALIGN -DINLINE -DHAVE_SETENV -DHAVE_READLINE" \
"LDEXTRA = -nostdlib -lreadline -lnsl -ldl -lm" \
"LIBEXTRA = -lreadline -lnsl -ldl -lm"
linux32:
$(MAKE) targets \
"CC = gcc" \
"STATIC = no" \
"EXTRA = " \
"CFLAGS = -O2 -m32 -fno-stack-protector -fpic -rdynamic -DALIGN -DINLINE -DHAVE_SETENV -DHAVE_READLINE" \
"LDEXTRA = -nostdlib -lreadline -lnsl -ldl -lm" \
"LIBEXTRA = -lreadline -lnsl -ldl -lm -Wl,-rpath"
# linux debug
linux32_debug:
$(MAKE) targets \
"CC = gcc" \
"EXTRA = " \
"CFLAGS = -g -m32 -fno-stack-protector -fpic -rdynamic -D__DEBUG__ -DALIGN -DINLINE -DHAVE_SETENV -DHAVE_READLINE" \
"LDEXTRA = -nostdlib -lreadline -lnsl -ldl -lm" \
"LIBEXTRA = -lreadline -lnsl -ldl -lm"
linux64:
$(MAKE) targets \
"CC = gcc" \
"USRLIB = /usr/lib64" \
"STATIC = no" \
"EXTRA = " \
"CFLAGS = -O2 -m64 -fno-stack-protector -fpic -rdynamic -DALIGN -DINLINE -DHAVE_SETENV -DHAVE_READLINE" \
"LDEXTRA = -nostdlib -lreadline -lnsl -ldl -lm" \
"LIBEXTRA = -lreadline -lnsl -ldl -lm -Wl,-rpath"
# linux debug
linux64_debug:
$(MAKE) targets \
"CC = gcc" \
"USRLIB = /usr/lib64" \
"EXTRA = " \
"CFLAGS = -g -m64 -fno-stack-protector -fpic -rdynamic -D__DEBUG__ -DALIGN -DINLINE -DHAVE_SETENV -DHAVE_READLINE" \
"LDEXTRA = -nostdlib -lreadline -lnsl -ldl -lm" \
"LIBEXTRA = -lreadline -lnsl -ldl -lm"
linux_noalign:
$(MAKE) targets \
"CC = gcc" \
"EXTRA = rxunix.c" \
"CFLAGS = -O2 -DINLINE -DHAVE_SETENV -DHAVE_READLINE" \
"LIBEXTRA = -lreadline -lhistory -lcurses"
linux_noalign_debug:
$(MAKE) targets \
"CC = gcc" \
"EXTRA = rxunix.c" \
"CFLAGS = -g -pg -Wall -D__DEBUG__ -DHAVE_SETENV -DHAVE_READLINE" \
"LIBEXTRA = -lreadline -lhistory -lcurses"
linux_intel:
$(MAKE) targets \
"CC = icc" \
"CFLAGS = -O -DALIGN -DINLINE -DHAVE_SETENV -DHAVE_READLINE" \
"LIBEXTRA = -lreadline -lhistory -lcurses"
linux_intel_debug:
$(MAKE) targets \
"CC = icc" \
"CFLAGS = -g -pg -Wall -DALIGN -D__DEBUG__ -DHAVE_SETENV -DHAVE_READLINE" \
"LIBEXTRA = -lreadline -lhistory -lcurses"
hpux:
$(MAKE) targets \
"EXTRA = rxunix.c" \
"CFLAGS = -Aa +O2 -D_HPUX_SOURCE -DALIGN"
hpux_debug:
$(MAKE) targets \
"EXTRA = rxunix.c" \
"CFLAGS = -Aa -g -D__DEBUG__ -D_HPUX_SOURCE -DALIGN"
hpux-gcc:
$(MAKE) targets \
"CC = gcc" \
"EXTRA = rxunix.c" \
"CFLAGS = -O2 -DALIGN"
hpux-gcc_debug:
$(MAKE) targets \
"CC = gcc" \
"EXTRA = rxunix.c" \
"CFLAGS = -g -pg -Wall -D__DEBUG__ -DALIGN"
custom:
$(MAKE) targets \
"CC = gcc" \
"CFLAGS = -O2 -DALIGN -DINLINE -DHAVE_SETENV"
test:
$(MAKE) targets \
"CC = gcc" \
"MAIN = maintest.c" \
"CFLAGS = -O2 -DALIGN -DINLINE -DHAVE_SETENV"
test_debug:
$(MAKE) targets \
"CC = gcc" \
"MAIN = maintest.c" \
"CFLAGS = -g -pg -Wall -DALIGN -D__DEBUG__ -DHAVE_SETENV"
macos:
$(MAKE) targets \
"CC = gcc" \
"MACOS = yes" \
"STATIC = no" \
"EXTRA = " \
"LSTR_SO = liblstring.dylib" \
"CFLAGS = -O3 -Wno-format -Wno-format-security -Wno-implicit-function-declaration -Wno-pointer-sign -Wno-empty-body -fno-stack-protector -fpic -DALIGN -DINLINE -DHAVE_SETENV -DHAVE_READLINE" \
"LDEXTRA = -lreadline -ldl -lm" \
"LIBEXTRA = -lreadline -ldl -lm -Wl,-rpath"