Subversion Repositories eduke32

Rev

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