Subversion Repositories eduke32

Rev

Rev 4756 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
1739 helixhorne 1
 
4547 hendricks2 2
PACKAGE_REPOSITORY ?= 0
3
4
 
5
PRETTY_OUTPUT ?= 1
1791 helixhorne 6
1739 helixhorne 7
 
3096 hendricks2 8
CROSS=
3972 hendricks2 9
ifneq ($(CROSS),)
4547 hendricks2 10
    undefine CC
11
    undefine CXX
12
    undefine AR
13
    undefine RC
14
    undefine RANLIB
15
    undefine STRIP
16
endif
17
3096 hendricks2 18
 
4647 hendricks2 19
CXX=$(CROSS)g++
20
AR=$(CROSS)ar
21
RC=$(CROSS)windres
22
RANLIB=$(CROSS)ranlib
23
STRIP=$(CROSS)strip
24
AS=nasm
25
PKG_CONFIG=pkg-config
26
4547 hendricks2 27
 
28
ifeq ($(CC),cc)
29
    override CC=gcc
30
endif
31
ifeq ($(AS),as)
32
    override AS=nasm
33
endif
34
35
 
4644 hendricks2 36
L_CC=$(CC)
3122 hendricks2 37
L_CXX=$(CXX)
38
39
 
4543 hendricks2 40
3278 hendricks2 41
 
42
    ifeq ($(strip $(DEVKITPPC)),)
43
        $(error "Please set DEVKITPPC in your environment. export DEVKITPPC=<path to>devkitPPC")
44
    endif
45
46
 
47
48
 
4543 hendricks2 49
50
 
4647 hendricks2 51
    RANLIB=powerpc-eabi-ranlib
3278 hendricks2 52
    STRIP=powerpc-eabi-strip
53
endif
54
55
 
4644 hendricks2 56
57
 
58
59
 
60
    override CLANG=1
61
endif
62
# detect clang symlinked as gcc, as in OS X
63
ifeq ($(findstring clang,$(CLANG_POTENTIAL_VERSION)),clang)
64
    override CLANG=1
65
endif
66
67
 
68
    override CC=clang -x c
69
    override CXX=clang -x c++
70
    override COMPILER_OBJC=clang -x objective-c
71
    override L_CC=clang
72
    override L_CXX=clang
73
endif
74
75
 
3096 hendricks2 76
ifndef GCC_MAJOR
3278 hendricks2 77
    GCC_MAJOR    := $(shell $(CCFULLPATH) -dumpversion 2>&1 | cut -d'.' -f1)
4543 hendricks2 78
endif
3278 hendricks2 79
ifeq ($(GCC_MAJOR),)
80
    GCC_MAJOR    := 4
81
endif
82
ifndef GCC_MINOR
83
    GCC_MINOR    := $(shell $(CCFULLPATH) -dumpversion 2>&1 | cut -d'.' -f2)
4543 hendricks2 84
endif
3278 hendricks2 85
ifeq ($(GCC_MINOR),)
86
    GCC_MINOR    := 8
4543 hendricks2 87
endif
3278 hendricks2 88
3096 hendricks2 89
 
90
ifndef SYSARCH
3278 hendricks2 91
    SYSARCH:=$(strip $(shell uname -m))
92
endif
93
SYSBITS=32
4543 hendricks2 94
3096 hendricks2 95
 
96
# the outside world. This allows cross-compilation by overriding
97
# CC and giving us PLATFORM specifically.
98
#
99
ifndef PLATFORM
100
    uname:=$(strip $(shell uname -s))
3278 hendricks2 101
    PLATFORM=UNKNOWN
3096 hendricks2 102
    ifeq ($(findstring Linux,$(uname)),Linux)
103
        PLATFORM=LINUX
104
    endif
105
    ifeq ($(findstring BSD,$(uname)),BSD)
106
        PLATFORM=BSD
107
    endif
108
    ifeq ($(findstring MINGW,$(uname)),MINGW)
109
        PLATFORM=WINDOWS
110
    endif
111
    ifeq ($(findstring Darwin,$(uname)),Darwin)
112
        PLATFORM=DARWIN
113
    endif
114
    ifeq ($(findstring BeOS,$(uname)),BeOS)
115
        PLATFORM=BEOS
116
    endif
117
    ifeq ($(findstring skyos,$(uname)),skyos)
118
        PLATFORM=SKYOS
119
    endif
120
    ifeq ($(findstring QNX,$(uname)),QNX)
121
        PLATFORM=QNX
122
    endif
123
    ifeq ($(findstring SunOS,$(uname)),SunOS)
124
        PLATFORM=SUNOS
125
    endif
126
    ifeq ($(findstring syllable,$(uname)),syllable)
127
        PLATFORM=SYLLABLE
128
    endif
129
endif
130
131
 
3272 hendricks2 132
    SUBPLATFORM=
133
    ifeq ($(PLATFORM),LINUX)
134
        SUBPLATFORM=LINUX
135
    endif
136
    ifeq ($(PLATFORM),DINGOO)
137
        SUBPLATFORM=LINUX
138
        CROSS=mipsel-linux-
3972 hendricks2 139
    endif
3272 hendricks2 140
    ifeq ($(PLATFORM),GCW)
141
        SUBPLATFORM=LINUX
142
        CROSS=mipsel-linux-
3972 hendricks2 143
    endif
3272 hendricks2 144
    ifeq ($(PLATFORM),CAANOO)
145
        SUBPLATFORM=LINUX
146
    endif
147
endif
148
149
 
2476 hendricks2 150
EXESUFFIX_OVERRIDE ?=
151
152
 
4023 helixhorne 153
SYNTHESIS ?= 0
154
155
 
2398 hendricks2 156
# Like above, use absolute paths.
157
APPLE_FRAMEWORKS ?=/Library/Frameworks
158
# Without the resource files packaged in the .app bundle, the startupwindow produces errors, so give it an off switch.
3368 hendricks2 159
OSX_STARTUPWINDOW ?= 1
3278 hendricks2 160
2398 hendricks2 161
 
1739 helixhorne 162
#  USE_OPENGL     - enables basic OpenGL Polymost renderer
1820 terminx 163
#  POLYMER        - enables fancy Polymer renderer
164
#  NOASM          - disables the use of inline assembly pragmas
1739 helixhorne 165
#  LINKED_GTK     - enables compile-time linkage to GTK
166
#
167
POLYMER = 1
168
USE_OPENGL = 1
169
NOASM = 0
170
LINKED_GTK = 0
171
BUILD32_ON_64 ?= 0
1907 helixhorne 172
USE_LIBPNG ?= 1
2843 helixhorne 173
USE_LIBVPX ?= 1
2076 helixhorne 174
HAVE_VORBIS ?= 1
4713 terminx 175
HAVE_FLAC ?= 1
176
NETCODE ?= 1
3260 helixhorne 177
4107 helixhorne 178
 
3957 helixhorne 179
USE_LUAJIT_2_1 ?= 0
4107 helixhorne 180
1739 helixhorne 181
 
4066 helixhorne 182
USE_ASM64 ?= 0
183
184
 
1739 helixhorne 185
    POLYMER = 0
186
    USE_LIBVPX = 0
1933 helixhorne 187
endif
1739 helixhorne 188
189
 
190
#  CPLUSPLUS - 1 = enable C++ building
3116 hendricks2 191
#  RELEASE - 1 = no debugging
1739 helixhorne 192
#  DEBUGANYWAY:
4756 helixhorne 193
#    1 = Include debug symbols even when generating release code.
194
#    2 = Also enable sanitizers with Clang. On the C side, make 'sprite' etc. be real arrays.
195
#  DISABLEINLINING - 1 = compile inline functions as extern __fastcall instead of static inline
4247 hendricks2 196
#  FORCEWARNINGS - 1 = do not disable any compiler warnings within the source
3237 hendricks2 197
#  KRANDDEBUG - 1 = include logging of krand() calls for debugging the demo system
1739 helixhorne 198
#  MEMMAP - 1 = produce .memmap file when linking
4543 hendricks2 199
#  EFENCE  - 1 = compile with Electric Fence for malloc() debugging
1739 helixhorne 200
#  OPTLEVEL	- 0..3 = GCC optimization strategy
201
#  LTO - 1 = enable link-time optimization, for GCC 4.5 and up
1856 helixhorne 202
#
1739 helixhorne 203
CPLUSPLUS?=1
4704 terminx 204
RELEASE?=1
1739 helixhorne 205
DEBUGANYWAY?=0
206
KRANDDEBUG?=0
207
MEMMAP?=0
4543 hendricks2 208
DISABLEINLINING?=0
3116 hendricks2 209
FORCEWARNINGS?=0
3237 hendricks2 210
EFENCE?=0
1739 helixhorne 211
DMALLOC?=0
2254 helixhorne 212
PROFILER?=0
1739 helixhorne 213
MUDFLAP?=0
1850 terminx 214
1739 helixhorne 215
 
4298 helixhorne 216
# allocache()-allocated memory accesses with e.g. Valgrind.
217
# For debugging with Valgrind + GDB, see
218
# http://valgrind.org/docs/manual/manual-core-adv.html#manual-core-adv.gdbserver
219
ALLOCACHE_AS_MALLOC?=0
220
221
 
3725 helixhorne 222
ifeq ($(RELEASE),0)
3728 Plagman 223
    OPTLEVEL?=0
3725 helixhorne 224
else
225
    OPTLEVEL?=2
226
endif
227
228
 
3422 helixhorne 229
    override STRIP=
3423 helixhorne 230
endif
3422 helixhorne 231
ifneq ($(DEBUGANYWAY),0)
232
    override STRIP=
3423 helixhorne 233
endif
3422 helixhorne 234
235
 
3957 helixhorne 236
    # FIXME: Lunatic builds with LTO don't start up properly as the required
237
    # symbol names are apparently not exported.
238
    override LTO=0
239
endif
240
241
 
3122 hendricks2 242
    LTO=1
243
    ifneq (0,$(CLANG))
244
        ifeq ($(PLATFORM), WINDOWS)
245
            LTO=0
246
        endif
247
    endif
248
endif
249
250
 
4547 hendricks2 251
COMPILERFLAGS=
4543 hendricks2 252
253
 
4547 hendricks2 254
    COMMONFLAGS += $(OPTIMIZATIONS)
255
endif
4543 hendricks2 256
257
 
4547 hendricks2 258
4543 hendricks2 259
 
4547 hendricks2 260
ifneq (0,$(CLANG))
261
    ifneq ($(PLATFORM),WII)
262
        DEBUGFLAG=-ggdb
263
    endif
264
endif
265
ifneq ($(RELEASE)$(DEBUGANYWAY),10)
4543 hendricks2 266
    # debug build or DEBUGANYWAY=1 --> -g flag
267
    OPTIMIZATIONS += $(DEBUGFLAG)
4547 hendricks2 268
endif
4543 hendricks2 269
270
 
4762 hendricks2 271
CPPONLYFLAGS= -fno-exceptions -fno-rtti -Wno-write-strings
4547 hendricks2 272
ASFORMAT=elf$(SYSBITS)
4543 hendricks2 273
ASFLAGS=-s -f $(ASFORMAT) #-g
274
LINKERFLAGS=
275
LIBS=-lm
276
LIBDIRS=
277
278
 
3278 hendricks2 279
    F_NO_STACK_PROTECTOR := -fno-stack-protector
3096 hendricks2 280
    # there are some link-time issues with stack protectors, so make it possible to override
281
    F_STACK_PROTECTOR_ALL ?= -fstack-protector-all
282
    ifeq (0,$(CLANG))
283
        F_JUMP_TABLES := -fjump-tables
284
    endif
285
    M_TUNE_GENERIC := -mtune=generic
286
    M_STACKREALIGN := -mstackrealign
287
    W_STRICT_OVERFLOW := -Wno-strict-overflow
3963 helixhorne 288
endif
3096 hendricks2 289
290
 
3278 hendricks2 291
    ifndef COMPILERTARGET
292
        COMPILERTARGET:=$(strip $(shell $(CC) -dumpmachine))
293
    endif
294
295
 
296
        SYSARCH:=x86_64
297
        SYSBITS=64
4552 hendricks2 298
    endif
3278 hendricks2 299
300
 
4543 hendricks2 301
else
4552 hendricks2 302
ifneq (1,$(BUILD32_ON_64))
303
    ifeq ($(findstring x86_64,$(ARCH)),x86_64)
304
        SYSBITS=64
305
    endif
306
    ifeq ($(ARCH),)
307
        ifeq ($(findstring x86_64,$(SYSARCH)),x86_64)
308
            SYSBITS=64
309
        endif
310
    endif
311
endif
3278 hendricks2 312
endif
4552 hendricks2 313
3278 hendricks2 314
 
3096 hendricks2 315
    ifndef DARWINVERSION
3278 hendricks2 316
        DARWINVERSION:=$(strip $(shell uname -r | cut -d . -f 1))
317
    endif
318
4644 hendricks2 319
 
320
	DARWIN10 ?= 0
321
    ifeq (1,$(strip $(shell expr $(DARWINVERSION) \< 10)))
3096 hendricks2 322
        override DARWIN9 := 1
4644 hendricks2 323
    endif
3096 hendricks2 324
    ifeq (1,$(strip $(shell expr $(DARWINVERSION) \< 11)))
4644 hendricks2 325
        override DARWIN10 := 1
326
    endif
327
3096 hendricks2 328
 
4543 hendricks2 329
3096 hendricks2 330
 
331
        F_JUMP_TABLES :=
332
        W_STRICT_OVERFLOW :=
333
    endif
334
335
 
336
        COMMONFLAGS += $(F_NO_STACK_PROTECTOR)
4543 hendricks2 337
    else
3096 hendricks2 338
        ifeq ($(findstring ppc,$(ARCH)),ppc)
339
            COMMONFLAGS += $(F_NO_STACK_PROTECTOR)
4543 hendricks2 340
        endif
3096 hendricks2 341
    endif
342
    ifneq (0,$(OSX_STARTUPWINDOW))
3334 hendricks2 343
        COMPILERFLAGS+= -DOSX_STARTUPWINDOW
4543 hendricks2 344
    endif
3334 hendricks2 345
endif
3096 hendricks2 346
347
 
4543 hendricks2 348
 
4555 hendricks2 349
    # Debugging disabled
350
    COMMONFLAGS += $(F_NO_STACK_PROTECTOR)
351
else
352
    # Debugging enabled
353
    ifneq (0,$(KRANDDEBUG))
354
        COMMONFLAGS += -fno-inline -fno-inline-functions -fno-inline-functions-called-once
355
    endif
356
    ifeq (1,$(SDL_TARGET))
357
        COMPILERFLAGS += -DNOSDLPARACHUTE
358
    endif
359
endif
360
361
 
3096 hendricks2 362
    ifeq ($(PLATFORM), WII)
363
        OPTOPT=
364
    else
365
        OPTOPTARCH=$(ARCH)
366
        ifeq (,$(OPTOPTARCH))
367
            OPTOPTARCH=$(SYSARCH)
368
        endif
369
370
 
371
            OPTOPT=-march=pentium3 $(M_TUNE_GENERIC) -mmmx
372
            # -msse2 -mfpmath=sse,387 -malign-double $(M_STACKREALIGN)
373
        else
374
            OPTOPT=
375
        endif
376
    endif
377
endif
378
379
 
1739 helixhorne 380
    RELEASE=0
381
endif
382
ifneq (0,$(PROFILER))
383
    # XXX: Why?
4756 helixhorne 384
    DEBUGANYWAY=1
1739 helixhorne 385
endif
386
387
 
388
 
389
 
2520 hendricks2 390
 
3278 hendricks2 391
    ifeq (1,$(strip $(shell expr $(GCC_MINOR) \>= 1)))
392
        COMPILERFLAGS+= -Wno-attributes
4543 hendricks2 393
    endif
3278 hendricks2 394
endif
395
396
 
3691 helixhorne 397
ifeq (1,$(strip $(shell expr $(GCC_MAJOR) \>= 4)))
398
    ifeq (1,$(strip $(shell expr $(GCC_MINOR) \>= 3)))
399
        CPPONLYFLAGS+= -Wno-narrowing
4547 hendricks2 400
    endif
3691 helixhorne 401
endif
402
403
 
2685 hendricks2 404
    override USE_LIBVPX = 0
405
    override NETCODE = 0
4390 terminx 406
    override HAVE_FLAC = 0
4713 terminx 407
endif
2685 hendricks2 408
ifeq ($(PLATFORM),GCW)
3972 hendricks2 409
    override USE_LIBVPX = 0
410
endif
411
ifeq ($(PLATFORM),DINGOO)
412
    override USE_LIBVPX = 0
413
endif
414
2685 hendricks2 415
 
1933 helixhorne 416
    # On Windows, we link statically to libvpx
2038 helixhorne 417
    LIBS+= -lvpx
4543 hendricks2 418
endif
1933 helixhorne 419
1852 helixhorne 420
 
2292 helixhorne 421
 
4298 helixhorne 422
    COMPILERFLAGS += -DDEBUG_ALLOCACHE_AS_MALLOC
4543 hendricks2 423
endif
4298 helixhorne 424
425
 
4020 helixhorne 426
# for a list of possible UBSan options.
427
# Clang 3.2 does only supports -fsanitize=address for the AddressSanitizer
428
CLANG_DEBUG_FLAGS := -fsanitize=address -fsanitize=bounds,enum,float-cast-overflow,object-size
4756 helixhorne 429
#CLANG_DEBUG_FLAGS := $(CLANG_DEBUG_FLAGS),signed-integer-overflow
430
#CLANG_DEBUG_FLAGS := $(CLANG_DEBUG_FLAGS),unsigned-integer-overflow
431
#CLANG_DEBUG_FLAGS := $(CLANG_DEBUG_FLAGS) -fsanitize-undefined-trap-on-error
432
4020 helixhorne 433
 
1739 helixhorne 434
    ## Debugging disabled
4756 helixhorne 435
436
 
2672 helixhorne 437
        COMMONFLAGS += -funswitch-loops
4543 hendricks2 438
        ifeq (1,$(strip $(shell expr $(GCC_MAJOR) \< 4)))
3278 hendricks2 439
            override LTO=0
4684 hendricks2 440
        endif
3278 hendricks2 441
        ifeq (1,$(strip $(shell expr $(GCC_MAJOR) = 4)))
442
            ifeq ($(PLATFORM),WII)
4684 hendricks2 443
                ifeq (1,$(strip $(shell expr $(GCC_MINOR) \< 8)))
444
                    override LTO=0
445
                endif
446
            else
447
                ifeq (1,$(strip $(shell expr $(GCC_MINOR) \< 6)))
448
                    override LTO=0
449
                endif
450
            endif
3278 hendricks2 451
        endif
452
    endif
2182 helixhorne 453
4756 helixhorne 454
 
2040 helixhorne 455
        COMMONFLAGS += -fomit-frame-pointer
4543 hendricks2 456
        COMPILERFLAGS += -DNDEBUG
457
    else
3138 Plagman 458
        # Our $(DEBUGANYWAY) -> DEBUGGINGAIDS #define
4756 helixhorne 459
        COMPILERFLAGS += -DDEBUGGINGAIDS=$(DEBUGANYWAY)
460
        ifneq (0,$(CLANG))
461
            ifeq (2,$(DEBUGANYWAY))
462
                COMMONFLAGS += $(CLANG_DEBUG_FLAGS)
463
            endif
464
        endif
465
    endif
2040 helixhorne 466
4756 helixhorne 467
 
1856 helixhorne 468
        COMPILERFLAGS += -DUSING_LTO
4543 hendricks2 469
        COMMONFLAGS += -flto
470
    endif
1856 helixhorne 471
else
1739 helixhorne 472
    ## Debugging enabled
4756 helixhorne 473
474
 
475
    COMPILERFLAGS += -DDEBUGGINGAIDS=$(DEBUGANYWAY)
476
    ifneq (0,$(CLANG))
477
        ifeq (2,$(DEBUGANYWAY))
478
            COMMONFLAGS += $(CLANG_DEBUG_FLAGS)
479
        endif
480
    endif
2270 helixhorne 481
482
 
3272 hendricks2 483
        LIBS+=-rdynamic
4543 hendricks2 484
    endif
1770 plagman 485
4756 helixhorne 486
 
1850 terminx 487
        LIBS+= -lmudflapth
4543 hendricks2 488
        COMMONFLAGS += -fmudflapth
489
    endif
1850 terminx 490
    ifneq (0,$(PROFILER))
1739 helixhorne 491
        ifneq ($(PLATFORM),DARWIN)
3278 hendricks2 492
            LIBS+= -lprofiler
4543 hendricks2 493
        endif
3278 hendricks2 494
        COMMONFLAGS += -pg
4543 hendricks2 495
    endif
1739 helixhorne 496
    ifneq (0,$(KRANDDEBUG))
497
        COMPILERFLAGS += -DKRANDDEBUG=1
4543 hendricks2 498
    endif
1739 helixhorne 499
endif
500
501
 
3278 hendricks2 502
ifeq (0,$(CLANG))
2672 helixhorne 503
#    W_NO_UNUSED_RESULT := $(shell echo '' | $(CC) -E -Wno-unused-result - 2>/dev/null && echo -Wno-unused-result)
2972 hendricks2 504
#    W_NO_UNUSED_RESULT := $(findstring -Wno-unused-result,$(W_NO_UNUSED_RESULT))
505
    ifeq (1,$(strip $(shell expr $(GCC_MAJOR) \>= 4)))
3278 hendricks2 506
        ifeq (1,$(strip $(shell expr $(GCC_MINOR) \>= 4)))
507
            W_NO_UNUSED_RESULT := -Wno-unused-result
508
        endif
509
    endif
510
endif
2159 helixhorne 511
1791 helixhorne 512
 
4762 hendricks2 513
    -Wpointer-arith \
2797 helixhorne 514
    -Wextra \
515
    -Wno-char-subscripts \
4543 hendricks2 516
    #-Wstrict-prototypes \
2797 helixhorne 517
    #-Waggregate-return \
518
    #-Wwrite-strings \
519
    #-Wcast-qual -Wcast-align \
520
    #-Waddress -Wlogical-op
521
522
 
2672 helixhorne 523
    CWARNS+= -Wno-unused-value -Wno-parentheses
4543 hendricks2 524
endif
2159 helixhorne 525
526
 
4543 hendricks2 527
528
 
4750 terminx 529
4543 hendricks2 530
 
3260 helixhorne 531
    COMPILERFLAGS+= -DNETCODE_DISABLE
4543 hendricks2 532
endif
3260 helixhorne 533
3148 helixhorne 534
 
3260 helixhorne 535
 
3957 helixhorne 536
# LuaJIT standalone interpreter executable:
537
LUAJIT:=luajit
4000 helixhorne 538
# Options to "luajit -b" for synthesis. Since it runs on Linux, we need to tell
4023 helixhorne 539
# the native LuaJIT to emit PE object files.
540
ifeq ($(PLATFORM),WINDOWS)
4319 hendricks2 541
    LUAJIT_BCOPTS := -o windows
542
    ifeq (32,$(SYSBITS))
4543 hendricks2 543
        LUAJIT_BCOPTS += -a x86
4319 hendricks2 544
    endif
545
    ifeq (64,$(SYSBITS))
4543 hendricks2 546
        LUAJIT_BCOPTS += -a x64
4319 hendricks2 547
    endif
548
endif
4023 helixhorne 549
3148 helixhorne 550
 
551
    # FIXME: Lunatic doesn't build with inlining because of wacky include
552
    # chains!
553
    override DISABLEINLINING=1
554
555
 
4286 helixhorne 556
        # FIXME: Lunatic C++ doesn't build because otherwise it doesn't find
557
        # INT32_MIN and the like.
558
        COMPILERFLAGS+= -D__STDC_LIMIT_MACROS
4543 hendricks2 559
    endif
4286 helixhorne 560
561
 
4543 hendricks2 562
    ifneq ($(USE_LUAJIT_2_1),0)
4107 helixhorne 563
        COMPILERFLAGS+= -DUSE_LUAJIT_2_1
4543 hendricks2 564
    endif
4107 helixhorne 565
3148 helixhorne 566
 
3785 helixhorne 567
    ifndef DEFS_BC_SIZE
568
        DEFS_BC_SIZE := $(shell $(LUAJIT) -bg -t h source/lunatic/defs.ilua -)
4543 hendricks2 569
        DEFS_BC_SIZE := $(word 3, $(DEFS_BC_SIZE))
3785 helixhorne 570
        # Pass it to the sub-makes, too.
4238 helixhorne 571
        export DEFS_BC_SIZE
3785 helixhorne 572
    endif
573
    # Determine size of defs_m32.ilua bytecode once.
4238 helixhorne 574
    ifndef DEFS_M32_BC_SIZE
575
        DEFS_M32_BC_SIZE := $(shell $(LUAJIT) -bg -t h source/lunatic/defs_m32.ilua -)
4543 hendricks2 576
        DEFS_M32_BC_SIZE := $(word 3, $(DEFS_M32_BC_SIZE))
4238 helixhorne 577
        export DEFS_M32_BC_SIZE
578
    endif
579
    COMPILERFLAGS+= -DLUNATIC_DEFS_BC_SIZE=$(DEFS_BC_SIZE) -DLUNATIC_DEFS_M32_BC_SIZE=$(DEFS_M32_BC_SIZE)
4543 hendricks2 580
3517 helixhorne 581
 
3148 helixhorne 582
        LIBS+= -lluajit
4543 hendricks2 583
    else
3148 helixhorne 584
        LIBS+= -lluajit-5.1
4543 hendricks2 585
    endif
3148 helixhorne 586
endif
587
588
 
589
590
 
3116 hendricks2 591
    COMPILERFLAGS+= -DDISABLE_INLINING
4543 hendricks2 592
endif
3116 hendricks2 593
ifneq (0,$(FORCEWARNINGS))
3237 hendricks2 594
    COMPILERFLAGS+= -DFORCE_WARNINGS
4543 hendricks2 595
endif
3237 hendricks2 596
3116 hendricks2 597
 
2718 helixhorne 598
ifdef EDUKE32_MY_DEVELOPER_ID
599
    COMPILERFLAGS+= -DMY_DEVELOPER_ID=$(EDUKE32_MY_DEVELOPER_ID)
4543 hendricks2 600
endif
2718 helixhorne 601
602
 
1852 helixhorne 603
    COMPILERFLAGS+= -DUSE_LIBPNG
4543 hendricks2 604
endif
1852 helixhorne 605
ifneq (0,$(USE_LIBVPX))
1933 helixhorne 606
    COMPILERFLAGS+= -DUSE_LIBVPX
4543 hendricks2 607
endif
1933 helixhorne 608
1739 helixhorne 609
 
4713 terminx 610
    COMPILERFLAGS+= -DHAVE_VORBIS
611
endif
612
ifneq (0,$(HAVE_FLAC))
613
    COMPILERFLAGS+= -DHAVE_FLAC
614
endif
615
ifneq (0,$(EFENCE))
2059 hendricks2 616
    LIBS+= -lefence
4543 hendricks2 617
    COMPILERFLAGS+= -DEFENCE
618
endif
2059 hendricks2 619
ifneq (0,$(DMALLOC))
2254 helixhorne 620
    LIBS+= -ldmalloc
4543 hendricks2 621
    COMPILERFLAGS+= -DDMALLOC
622
endif
2254 helixhorne 623
2059 hendricks2 624
 
4543 hendricks2 625
EXESUFFIX=
1739 helixhorne 626
DLLSUFFIX=.so
4543 hendricks2 627
4513 hendricks2 628
 
629
 
4543 hendricks2 630
SDL_FRAMEWORK ?= 0
4644 hendricks2 631
4543 hendricks2 632
 
633
    L_SSP := -lssp
634
endif
635
636
 
637
# Search for STDCPPLIB below and change it to -lsupc++.
638
639
 
640
SDL_LIB=-l$(SDLNAME)
641
SDL_MIXER_LIB=-l$(SDLNAME)_mixer
642
643
 
644
    RENDERTYPE=SDL
645
    MIXERTYPE=SDL
646
    COMPILERFLAGS+= -DHAVE_INTTYPES
647
    GTKCOMPAT32=0
648
    SDL_FRAMEWORK=0
649
650
 
651
    # presumably take care for us.
652
    STDCPPLIB:=
653
654
 
655
        override USE_OPENGL=0
656
        override NOASM=1
657
    endif
658
    ifeq ($(PLATFORM),DINGOO)
659
        override USE_OPENGL=0
660
        override NOASM=1
661
    endif
662
663
 
664
        ifeq (1,$(BUILD32_ON_64))
665
            # On my 64bit Gentoo these are the 32bit emulation libs
666
            LIBS+= -m32
667
            LIBDIRS+= -L/emul/linux/x86/usr/lib
668
            COMMONFLAGS+= -m32
669
            # Override WITHOUT_GTK=0
670
            GTKCOMPAT32=1
671
        else
672
            override NOASM=1
673
        endif
674
    endif
675
4555 hendricks2 676
 
677
    ifeq (0,$(CLANG))
678
        COMMONFLAGS	+= -fno-pic
679
    endif
680
endif
4543 hendricks2 681
ifeq ($(PLATFORM),DARWIN)
682
    COMPILERFLAGS+= -DUNDERSCORES
683
    ASFORMAT=macho$(SYSBITS)
684
    ASFLAGS+= -DUNDERSCORES
685
686
 
4646 hendricks2 687
    # COMPILERFLAGS+= -Iplatform/Apple/include
688
4543 hendricks2 689
 
4644 hendricks2 690
        LIBDIRS+= -L/opt/local/lib
691
        COMPILERFLAGS+= -I/opt/local/include
692
    endif
693
    ifneq ($(shell brew --version &>/dev/null; echo $$?),127)
694
        LIBDIRS+= -L/usr/local/lib
695
        COMPILERFLAGS+= -I/usr/local/include
696
    endif
697
    ifneq ($(shell fink --version &>/dev/null; echo $$?),127)
698
        LIBDIRS+= -L/sw/lib
699
        COMPILERFLAGS+= -I/sw/include
700
    endif
701
702
 
4543 hendricks2 703
    MIXERTYPE     = SDL
704
    STDCPPLIB:=-lstdc++
705
    COMPILERFLAGS    += -DHAVE_INTTYPES
706
    DLLSUFFIX=.dylib
4644 hendricks2 707
    GTKCOMPAT32    = 0
4543 hendricks2 708
    WITHOUT_GTK   ?= 1
4548 hendricks2 709
4543 hendricks2 710
 
711
        SDL_INCLUDES=-I$(APPLE_FRAMEWORKS)/SDL.framework/Headers -I$(APPLE_FRAMEWORKS)/SDL_mixer.framework/Headers
712
        SDL_LIB=-l$(SDLNAME)main -Wl,-framework,SDL -Wl,-rpath -Wl,"@loader_path/../Frameworks"
713
        SDL_MIXER_LIB=-Wl,-framework,SDL_mixer
714
    endif
715
716
 
717
        COMPILERFLAGS += -DDARWIN9
718
    endif
719
720
 
721
        ARCH=-arch i386
722
    else
723
        # ASM won't work on PowerPC or x86_64
724
        override NOASM=1
725
    endif
726
727
 
728
        ifeq (,$(ARCH))
729
            ifneq ($(findstring x86_64,$(SYSARCH)),x86_64)
730
                LINKERFLAGS += -read_only_relocs suppress
731
            endif
732
        else
733
            LINKERFLAGS += -read_only_relocs suppress
734
        endif
735
    endif
736
4555 hendricks2 737
 
738
endif
4543 hendricks2 739
ifeq ($(PLATFORM),WINDOWS)
740
    COMPILERFLAGS+= -DUNDERSCORES -DHAVE_INTTYPES -Iplatform/Windows/include
741
    LINKERFLAGS+= -static-libgcc
742
    ASFORMAT=win$(SYSBITS)
743
    ASFLAGS+= -DUNDERSCORES
744
745
 
746
    RENDERTYPE?=SDL
747
    MIXERTYPE?=WIN
748
    ifneq ($(RENDERTYPE),SDL)
749
        ifeq ($(MIXERTYPE),SDL)
750
            MIXERTYPE:=WIN
751
        endif
752
    endif
753
754
 
755
    ifeq ($(SDL_TARGET),1)
756
        SDL_MIXER_LIB=platform/Windows/lib$(WINLIB)/SDL_mixer.lib
757
    endif
758
759
 
760
    SDLCONFIG=
761
    SDL_FRAMEWORK=1
762
    EXESUFFIX=.exe
763
    DLLSUFFIX=.dll
764
    LIBDIRS+= -Lplatform/Windows/lib$(WINLIB)
4553 hendricks2 765
    LIBS+= -Wl,--enable-auto-import -lmingwex -lgdi32 -lcomctl32 -lwinmm $(L_SSP) -lwsock32 -lws2_32 -lshlwapi
4543 hendricks2 766
    ifeq (0,$(CLANG))
767
        LIBS+= -mwindows
768
    endif
769
    #-lshfolder
770
    STDCPPLIB:=-lstdc++
771
    ifeq ($(findstring x86_64,$(SYSARCH)),x86_64)
772
        ifneq (1,$(BUILD32_ON_64))
773
            override NOASM=1
774
        endif
775
    endif
776
4555 hendricks2 777
 
778
endif
4543 hendricks2 779
ifeq ($(PLATFORM),BSD)
780
    COMPILERFLAGS+= -I/usr/X11R6/include
781
782
 
783
    MIXERTYPE=SDL
784
    COMPILERFLAGS+= -DHAVE_INTTYPES
785
    ifneq ($(findstring i386,$(SYSARCH)),i386)
786
        override NOASM=1
787
    endif
788
    STDCPPLIB:=-lstdc++
789
endif
790
ifeq ($(PLATFORM),BEOS)
791
    override NOASM=1
792
793
 
794
    MIXERTYPE=SDL
795
    STDCPPLIB:=-lstdc++
796
endif
797
ifeq ($(PLATFORM),SKYOS)
798
    RENDERTYPE=SDL
799
    MIXERTYPE=SDL
800
    EXESUFFIX=.app
801
    override NOASM=1
802
    COMPILERFLAGS+= -DUNDERSCORES -I/boot/programs/sdk/include/sdl
803
    SDLCONFIG=
804
    LIBS+= -lSDL -lnet
805
endif
806
ifeq ($(PLATFORM),WII)
807
    RENDERTYPE=SDL
808
    MIXERTYPE=SDL
809
    SDL_INCLUDES=
810
    EXESUFFIX=.elf
811
    override USE_OPENGL=0
812
    override POLYMER=0
813
    override NOASM=1
814
    override WITHOUT_GTK=1
815
    # -msdata=eabi
816
    COMMONFLAGS+= -g -mtune=750 -meabi -mhard-float
817
    COMPILERFLAGS+= -DGEKKO -DHAVE_INTTYPES -D__POWERPC__ -I$(LIBOGC_INC) -I$(PORTLIBS)/include -Iplatform/Wii/include
818
    SDLCONFIG=
819
    SDL_TARGET=1
820
    SDL_FRAMEWORK=1
821
    LIBDIRS += -L$(LIBOGC_LIB) -L$(PORTLIBS)/lib -Lplatform/Wii/lib
4553 hendricks2 822
endif
4543 hendricks2 823
ifeq ($(PLATFORM),QNX)
824
    RENDERTYPE=SDL
825
    MIXERTYPE=SDL
826
    override USE_OPENGL=0
827
    override NOASM=1
828
    STDCPPLIB:=-lstdc++
829
    LIBS+= -lsocket
830
endif
831
ifeq ($(PLATFORM),SUNOS)
832
    RENDERTYPE=SDL
833
    MIXERTYPE=SDL
834
    override USE_OPENGL=0
835
    override NOASM=1
836
    STDCPPLIB:=-lstdc++
837
    LIBS+= -lsocket -lnsl
838
endif
839
ifeq ($(PLATFORM),SYLLABLE)
840
    RENDERTYPE=SDL
841
    MIXERTYPE=SDL
842
    override USE_OPENGL=0
843
    override NOASM=1
844
endif
845
ifeq ($(PLATFORM),GCW)
846
    COMPILERFLAGS += -D__OPENDINGUX__
847
endif
848
ifeq ($(PLATFORM),DINGOO)
849
    COMPILERFLAGS += -D__OPENDINGUX__
850
endif
851
852
 
853
    EXESUFFIX=$(EXESUFFIX_OVERRIDE)
854
endif
855
856
 
857
    ifneq (,$(STDCPPLIB))
858
        STDCPPLIB:=-Xlinker $(STDCPPLIB)
859
    endif
860
endif
861
862
 
863
    SDLCONFIG ?= sdl2-config
864
    SDLNAME ?= SDL2
865
endif
866
ifeq ($(SDL_TARGET),1)
867
    SDLCONFIG ?= sdl-config
868
    SDLNAME ?= SDL
869
endif
870
871
 
872
    SDLVERSION:=$(strip $(shell $(SDLCONFIG) --version))
873
    ifneq ($(SDLVERSION),)
874
        SDLROOT:=$(strip $(shell $(SDLCONFIG) --prefix))
875
    endif
876
endif
877
878
 
879
880
 
881
    COMPILERFLAGS += -DSDL_TARGET=$(SDL_TARGET)
882
883
 
884
        COMPILERFLAGS += -DSDL_FRAMEWORK
885
    endif
886
887
 
888
        ifeq ($(SDL_FRAMEWORK),1)
889
            ifeq ($(PLATFORM),DARWIN)
890
                LIBS        += -Wl,-framework,SDL
891
                COMPILERFLAGS+= -I$(APPLE_FRAMEWORKS)/SDL.framework/Headers \
892
                                -I$(APPLE_FRAMEWORKS)/SDL_mixer.framework/Headers
893
            endif
894
        else
895
            ifneq ($(SDLCONFIG),)
896
                SDLCONFIG_COMMONFLAGS:=$(subst -Dmain=SDL_main,,$(strip $(shell $(SDLCONFIG) --cflags)))
897
                SDLCONFIG_LIBS:=$(strip $(shell $(SDLCONFIG) --libs))
898
899
 
900
                COMMONFLAGS+= $(SDLCONFIG_COMMONFLAGS)
901
            endif
902
        endif
903
    else
904
        COMPILERFLAGS += -D_GNU_SOURCE=1
905
        ifneq ($(SDL_STATIC),0)
906
            ifneq ($(SDL_TARGET),1) # Since SDL2 is under the zlib license, link statically if possible.
907
                LIBS+= -static
908
            endif
909
        endif
910
        LIBS+= -l$(SDLNAME)main -l$(SDLNAME) -lmingw32 -lgdi32 -limm32 -lole32 -loleaut32 -lwinmm -lversion
911
    endif
912
913
 
914
        HAVE_GTK2=0
915
    else
916
        ifneq (No,$(shell $(PKG_CONFIG) --exists gtk+-2.0 || echo No))
4547 hendricks2 917
            HAVE_GTK2=1
4543 hendricks2 918
            # On my 64bit Gentoo box I have Cairo enabled which means the libs list includes
919
            # -lpangocairo-1.0 and -lcairo, however the 32bit compatibility libraries don't
920
            # include cairo, so we need to filter out those -l switches in order to link
921
            ifneq ($(LINKED_GTK),0)
922
                ifeq ($(GTKCOMPAT32),1)
923
                    LIBS+= $(shell $(PKG_CONFIG) --libs gtk+-2.0 | sed 's/\s-l\(pango\)\{0,1\}cairo\S*\s/ /g')
4547 hendricks2 924
                else
4543 hendricks2 925
                    LIBS+= $(shell $(PKG_CONFIG) --libs gtk+-2.0)
4547 hendricks2 926
                endif
4543 hendricks2 927
            endif
928
            COMPILERFLAGS += -DHAVE_GTK2 $(shell $(PKG_CONFIG) --cflags gtk+-2.0)
4547 hendricks2 929
        else
4543 hendricks2 930
            HAVE_GTK2=0
931
        endif
932
    endif
933
934
 
935
    ifneq ($(MIXERTYPE),WIN)
936
        LIBS += $(SDL_MIXER_LIB)
937
    endif
938
    LIBS += $(SDL_LIB)
939
endif
940
ifeq ($(RENDERTYPE),WIN)
941
    LIBS+= -ldxguid
942
endif
943
944
 
945
ifeq ($(PLATFORM),WINDOWS)
946
    ifeq ($(RENDERTYPE),SDL)
947
    SDL_LIB:=-l$(SDLNAME)main $(SDL_LIB)
948
        ifeq ($(MIXERTYPE),WIN)
949
            LIBS+= -ldxguid_sdl
950
        endif
951
    endif
952
endif
953
ifeq ($(PLATFORM),WII)
954
    LIBS+= -laesnd_tueidj -lpng -lfat -lwiiuse -lbte -logc -lm -lwiikeyboard
955
endif
956
957
 
958
959
 
960
    COMPILERFLAGS+= -DUSE_OPENGL
961
endif
962
ifneq (0,$(NOASM))
963
    COMPILERFLAGS+= -DNOASM
964
endif
965
ifneq (0,$(USE_ASM64))
966
    COMPILERFLAGS+= -DUSE_ASM64
967
endif
968
ifneq (0,$(LINKED_GTK))
969
    COMPILERFLAGS+= -DLINKED_GTK
970
endif
971
972
 
973
 ifneq (0,$(USE_OPENGL))
974
  COMPILERFLAGS+= -DPOLYMER
975
 endif
976
endif
977
978
 
979
ifeq (1,$(STATICSTDCPP))
980
    STATICSTDCPP= -static
981
endif
982
ifeq (0,$(STATICSTDCPP))
983
    STATICSTDCPP= -shared
984
endif
985
986
 
987
 
988
    ifneq ($(PLATFORM),WII)
989
        LIBS+= -ldl
990
        ifneq ($(PLATFORM),DARWIN)
4684 hendricks2 991
            LIBS+= -pthread
992
        endif
993
    endif
4543 hendricks2 994
endif
995
996
 
997
    ifneq ($(USE_LIBPNG),0)
998
        LIBS+= -lpng_mini -lz_mini
999
    endif
1000
else
1001
    ifeq ($(PLATFORM),DARWIN)
1002
        ifneq ($(USE_LIBPNG),0)
1003
            LIBS+= -lpng # -lz
1004
        endif
1005
    else
1006
        ifneq ($(USE_LIBPNG),0)
1007
            LIBS+= -lpng -lz
1008
        endif
1009
    endif
1010
endif
1011
1012
 
1013
 
1014
    ifneq ($(findstring x86_64,$(COMPILERTARGET)),x86_64)
1015
        LINKERFLAGS+= -Wl,--large-address-aware
1016
    endif
1017
endif
1018
1019
 
1020
ifeq ($(PLATFORM),DARWIN)
1021
    LINKERFLAGS+=-Wl,-map -Wl,$@.memmap
1022
else
1023
    LINKERFLAGS+=-Wl,-Map=$@.memmap
1024
endif
1025
endif
1026
1027
 
1028
    LINKERFLAGS+=-pg
1029
endif
1030
ifeq ($(PLATFORM),WII)
1031
    LINKERFLAGS+= -mrvl -meabi -mhard-float -Wl,--gc-sections
1032
    # -msdata=eabi
1033
endif
1034
1035
 
4565 hendricks2 1036
ifeq (,$(VC_REV))
1037
    ifneq (,$(wildcard EDUKE32_REVISION))
1038
        VC_REV    := $(shell cat EDUKE32_REVISION)
1039
    endif
1040
endif
1041
ifeq (,$(VC_REV))
1042
    VC_REV    := $(shell svn info 2>&1 | grep Revision | cut -d' ' -f2)
1043
endif
1044
ifeq (,$(VC_REV))
1045
    VC_REV    := $(shell git svn info 2>&1 | grep Revision | cut -d' ' -f2)
1046
endif
1047
ifneq (,$(VC_REV)$(VC_REV_CUSTOM))
1048
    REVFLAG += -DREV="\"r$(VC_REV)$(VC_REV_CUSTOM)\""
1049
endif
1050
1051
 
4543 hendricks2 1052
LINKER=$(L_CC)
1053
ifneq ($(CPLUSPLUS),0)
1054
    COMPILER=$(CXX) $(CPPONLYFLAGS)
4547 hendricks2 1055
    LINKER=$(L_CXX)
4543 hendricks2 1056
endif
1057
1058
 
4513 hendricks2 1059
    COMMONFLAGS+= $(CUSTOMOPT)
4543 hendricks2 1060
endif
4513 hendricks2 1061
ifneq (,$(CFLAGS))
4543 hendricks2 1062
    COMMONFLAGS+= $(CFLAGS)
1063
endif
1064
ifneq (,$(CXXFLAGS))
4547 hendricks2 1065
    CPPONLYFLAGS+= $(CXXFLAGS)
1066
endif
1067
ifneq (,$(LDFLAGS))
1068
    LINKERFLAGS+= $(LDFLAGS)
1069
endif
1070
4543 hendricks2 1071
 
1072
RECIPE_IF = if
1073
BUILD_SETTINGS_COMPILER = \033[1;36mcompiler: \033[0;36m\"$(COMPILER) $(COMMONFLAGS) $(COMPILERFLAGS)\"
1074
BUILD_SETTINGS_ASSEMBLER = \033[1;36massembler: \033[0;36m\"$(AS) $(ASFLAGS)\"
1075
BUILD_SETTINGS_LINKER = \033[1;36mlinker: \033[0;36m\"$(LINKER) $(COMMONFLAGS) $(LINKERFLAGS) $(LIBDIRS) $(LIBS) $(STATICSTDCPP) $(STDCPPLIB)\"
1076
ifeq (0,$(NOASM))
1077
    BUILD_SETTINGS = printf "$(BUILD_SETTINGS_COMPILER)\n$(BUILD_SETTINGS_ASSEMBLER)\n$(BUILD_SETTINGS_LINKER)\033[0m\n"
1078
else
1079
    BUILD_SETTINGS = printf "$(BUILD_SETTINGS_COMPILER)\n$(BUILD_SETTINGS_LINKER)\033[0m\n"
1080
endif
1081
BUILD_STARTED = printf "\033[K\033[1;36mBuild started using:\033[0m\n"; $(BUILD_SETTINGS)
1082
BUILD_ECHOFLAGS = printf "\033[K\033[1;36mEnded compilation in this directory using:\n$(BUILD_SETTINGS_COMPILER)\033[0m\n"
1083
BUILD_FINISHED = printf "\033[K\033[1;36mBuild successful:\033[0m\n"
1084
COMPILE_STATUS = printf "\033[K\033[0mBuilding object \033[1m$@\033[0m...\033[0m\r"
1085
COMPILE_OK = printf "\033[K\033[0;32mBuilt object \033[1;32m$@\033[0;32m \033[0m\n"
1086
COMPILE_FAILED = printf "\033[K\033[0;31mFailed building \033[1;31m$@\033[0;31m from\033[0m \033[1;31m$<\033[0;31m!\033[0m\n"; exit 1
1087
RECIPE_RESULT_COMPILE = ; then $(COMPILE_OK); else $(COMPILE_FAILED); fi
1088
ONESTEP_STATUS = printf "\033[K\033[0mBuilding executable \033[1m$@\033[0m...\033[0m\r"
1089
ONESTEP_OK = printf "\033[K\033[0;32mBuilt executable \033[1;32m$@\033[0;32m \033[0m\n"
1090
ONESTEP_FAILED = printf "\033[K\033[0;31mFailed building executable \033[1;31m$@\033[0;31m!\033[0m\n"; exit 1
1091
RECIPE_RESULT_ONESTEP = ; then $(ONESTEP_OK); else $(ONESTEP_FAILED); fi
1092
ARCHIVE_STATUS = printf "\033[K\033[0mCreating library archive \033[1m$@\033[0m...\033[0m\r"
1093
ARCHIVE_OK = printf "\033[K\033[0;32mCreated library archive \033[1;32m$@\033[0;32m \033[0m\n"
1094
ARCHIVE_FAILED = printf "\033[K\033[0;31mFailed creating library archive \033[1;31m$@\033[0;31m from\033[0m \033[1;31m$<\033[0;31m!\033[0m\n"; exit 1
1095
RECIPE_RESULT_ARCHIVE = ; then $(ARCHIVE_OK); else $(ARCHIVE_FAILED); fi
1096
LINK_STATUS = printf "\033[K\033[0;0mLinking executable \033[1m$@\033[0;0m...\033[0m\r"
1097
LINK_OK = printf "\033[K\033[0;32mLinked executable \033[1;32m$@\033[0;32m \033[0m\n"
1098
LINK_FAILED = printf "\033[K\033[0;31mFailed linking executable \033[1;31m$@\033[0;31m!\033[0m\n"; exit 1
1099
RECIPE_RESULT_LINK = ; then $(LINK_OK); else $(LINK_FAILED); fi
1100
else
1101
RECIPE_IF =
1102
BUILD_STARTED =
1103
BUILD_ECHOFLAGS =
1104
BUILD_FINISHED =
1105
COMPILE_STATUS =
1106
COMPILE_OK = true
1107
COMPILE_FAILED = false; exit 1
1108
RECIPE_RESULT_COMPILE =
1109
ONESTEP_STATUS =
1110
ONESTEP_OK = true
1111
ONESTEP_FAILED = false; exit 1
1112
RECIPE_RESULT_ONESTEP =
1113
ARCHIVE_STATUS =
1114
ARCHIVE_OK = true
1115
ARCHIVE_FAILED = false; exit 1
1116
RECIPE_RESULT_ARCHIVE =
1117
LINK_STATUS =
1118
LINK_OK = true
1119
LINK_FAILED = false; exit 1
1120
RECIPE_RESULT_LINK =
1121
endif
1122