Subversion Repositories eduke32

Rev

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