Subversion Repositories eduke32

Rev

Rev 8093 | Rev 8210 | Go to most recent revision | 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
 
6147 hendricks2 5
SYNTHESIS := 0
6418 hendricks2 6
6147 hendricks2 7
 
8
 
6419 hendricks2 9
10
 
11
override space := $(empty) $(empty)
12
override comma := ,
13
override paren_open := (
7786 hendricks2 14
override paren_close := )
15
6419 hendricks2 16
 
17
 
6147 hendricks2 18
19
 
20
    HOSTPLATFORM := UNKNOWN
6418 hendricks2 21
    ifeq ($(findstring Windows,$(OS)),Windows)
6147 hendricks2 22
        HOSTPLATFORM := WINDOWS
6418 hendricks2 23
    else
6147 hendricks2 24
        uname := $(strip $(shell uname -s))
6418 hendricks2 25
        ifeq ($(findstring Linux,$(uname)),Linux)
6147 hendricks2 26
            HOSTPLATFORM := LINUX
6418 hendricks2 27
        else ifeq ($(findstring BSD,$(uname)),BSD)
6147 hendricks2 28
            HOSTPLATFORM := BSD
6418 hendricks2 29
        else ifeq ($(findstring MINGW,$(uname)),MINGW)
6147 hendricks2 30
            HOSTPLATFORM := WINDOWS
6418 hendricks2 31
        else ifeq ($(findstring MSYS,$(uname)),MSYS)
6147 hendricks2 32
            HOSTPLATFORM := WINDOWS
6418 hendricks2 33
        else ifeq ($(findstring Darwin,$(uname)),Darwin)
6147 hendricks2 34
            HOSTPLATFORM := DARWIN
6418 hendricks2 35
        else ifeq ($(findstring BeOS,$(uname)),BeOS)
6147 hendricks2 36
            HOSTPLATFORM := BEOS
6418 hendricks2 37
        else ifeq ($(findstring skyos,$(uname)),skyos)
6147 hendricks2 38
            HOSTPLATFORM := SKYOS
6418 hendricks2 39
        else ifeq ($(findstring QNX,$(uname)),QNX)
6147 hendricks2 40
            HOSTPLATFORM := QNX
6418 hendricks2 41
        else ifeq ($(findstring SunOS,$(uname)),SunOS)
6147 hendricks2 42
            HOSTPLATFORM := SUNOS
6418 hendricks2 43
        else ifeq ($(findstring syllable,$(uname)),syllable)
6147 hendricks2 44
            HOSTPLATFORM := SYLLABLE
6418 hendricks2 45
        endif
6147 hendricks2 46
    endif
47
endif
48
ifndef PLATFORM
49
    PLATFORM := $(HOSTPLATFORM)
6418 hendricks2 50
endif
6147 hendricks2 51
52
 
53
    SUBPLATFORM :=
6418 hendricks2 54
    ifeq ($(PLATFORM),$(filter $(PLATFORM),LINUX DINGOO GCW CAANOO))
6147 hendricks2 55
        SUBPLATFORM := LINUX
6418 hendricks2 56
    endif
6147 hendricks2 57
endif
58
59
 
60
    DARWINVERSION := $(word 1,$(subst ., ,$(strip $(shell uname -r))))
6419 hendricks2 61
6147 hendricks2 62
 
6418 hendricks2 63
    DARWIN10 := 0
64
    ifneq (,$(filter 0 1 2 3 4 5 6 7 8 9 10,$(DARWINVERSION)))
6419 hendricks2 65
        DARWIN10 := 1
66
        ifneq (,$(filter 0 1 2 3 4 5 6 7 8 9,$(DARWINVERSION)))
67
            DARWIN9 := 1
68
        endif
69
    endif
6147 hendricks2 70
endif
71
72
 
6418 hendricks2 73
ifeq ($(HOSTPLATFORM),WINDOWS)
74
    HOSTEXESUFFIX := .exe
75
endif
76
6147 hendricks2 77
 
6418 hendricks2 78
DLLSUFFIX := .so
79
DOLSUFFIX := .dol
80
ifeq ($(PLATFORM),DARWIN)
81
    DLLSUFFIX := .dylib
82
endif
83
ifeq ($(PLATFORM),WII)
84
    EXESUFFIX := .elf
85
endif
86
ifeq ($(PLATFORM),SKYOS)
87
    EXESUFFIX := .app
88
endif
89
ifeq ($(PLATFORM),WINDOWS)
90
    EXESUFFIX := .exe
91
    DLLSUFFIX := .dll
92
endif
93
94
 
95
 
6147 hendricks2 96
97
 
6418 hendricks2 98
1739 helixhorne 99
 
6418 hendricks2 100
6147 hendricks2 101
 
102
# MSYS2 lets you create files named NUL but has a /dev/null. Go figure.
103
    ifeq (,$(wildcard /dev/null))
104
        NULLSTREAM := NUL
6418 hendricks2 105
    endif
6147 hendricks2 106
endif
107
108
 
6418 hendricks2 109
DONT_PRINT_STDERR := 2> $(NULLSTREAM)
110
DONT_FAIL := ; exit 0
6424 hendricks2 111
ESCAPE=\\
7786 hendricks2 112
6147 hendricks2 113
 
6418 hendricks2 114
# when no sh.exe is found in PATH on Windows, no path is prepended to it
115
ifeq (sh.exe,$(SHELL))
116
    HAVE_SH := 0
117
endif
118
6147 hendricks2 119
 
6424 hendricks2 120
    ls -l $1
121
endef
122
define MKDIR
123
    mkdir -p $1
124
endef
125
define RM
126
    rm -f $(filter-out / *,$1)
127
endef
128
define RMDIR
129
    rm -rf $(filter-out / *,$1)
130
endef
131
define CAT
7782 pogokeen 132
    cat $1
133
endef
134
define RAW_ECHO
7786 hendricks2 135
    echo '$1'
136
endef
137
6424 hendricks2 138
 
6418 hendricks2 139
    DONT_FAIL := & rem
6424 hendricks2 140
    ESCAPE=^
7786 hendricks2 141
6419 hendricks2 142
 
6424 hendricks2 143
        dir $(subst /,\,$1)
144
    endef
145
    define MKDIR
146
        if not exist $(subst /,\,$1) mkdir $(subst /,\,$1)
147
    endef
148
    define RM
149
        del /f /q $(subst /,\,$(filter-out / *,$1)) $(DONT_PRINT_STDERR) $(DONT_FAIL)
150
    endef
151
    define RMDIR
152
        rmdir /s /q $(subst /,\,$(filter-out / *,$1)) $(DONT_PRINT_STDERR) $(DONT_FAIL)
153
    endef
154
    define CAT
7782 pogokeen 155
        type $(subst /,\,$1)
7786 hendricks2 156
    endef
7782 pogokeen 157
    define RAW_ECHO
7786 hendricks2 158
        echo $(subst ",$(ESCAPE)",$(subst $(paren_open),$(ESCAPE)$(paren_open),$(subst $(paren_close),$(ESCAPE)$(paren_close),$1)))
159
    endef
160
6424 hendricks2 161
 
6418 hendricks2 162
    PRETTY_OUTPUT := 0
6419 hendricks2 163
endif
4547 hendricks2 164
3096 hendricks2 165
 
6147 hendricks2 166
 
6418 hendricks2 167
6147 hendricks2 168
 
6418 hendricks2 169
CROSS_SUFFIX :=
170
6147 hendricks2 171
 
6420 hendricks2 172
173
 
174
    ifeq ($(strip $(DEVKITPPC)),)
175
        $(error "Please set DEVKITPPC in your environment. export DEVKITPPC := <path to>devkitPPC")
176
    endif
177
178
 
179
        override DEVKITPRO := $(subst /c/,C:/,$(DEVKITPRO))
180
        override DEVKITPPC := $(subst /c/,C:/,$(DEVKITPPC))
181
    endif
182
183
 
184
185
 
186
187
 
188
endif
189
190
 
6418 hendricks2 191
CXX := $(CROSS)g++$(CROSS_SUFFIX)
192
6430 hendricks2 193
 
194
    CC := $(CROSS)clang$(CROSS_SUFFIX)
195
    CXX := $(CROSS)clang++$(CROSS_SUFFIX)
196
endif
197
198
 
6418 hendricks2 199
COBJCXX := $(CXX) -x objective-c++
200
L_CC := $(CC)
201
L_CXX := $(CXX)
202
203
 
204
RC := $(CROSS)windres$(CROSS_SUFFIX)
205
RANLIB := $(CROSS)ranlib$(CROSS_SUFFIX)
206
STRIP := $(CROSS)strip$(CROSS_SUFFIX)
207
208
 
209
210
 
6147 hendricks2 211
LUAJIT := luajit$(HOSTEXESUFFIX)
6418 hendricks2 212
6147 hendricks2 213
 
6418 hendricks2 214
4547 hendricks2 215
 
6418 hendricks2 216
4807 hendricks2 217
 
4547 hendricks2 218
ifeq ($(CC),cc)
219
    override CC := gcc
6418 hendricks2 220
endif
4547 hendricks2 221
ifeq ($(AS),as)
222
    override AS := nasm
6418 hendricks2 223
endif
4547 hendricks2 224
225
 
6147 hendricks2 226
    CROSS := mipsel-linux-
6418 hendricks2 227
endif
6147 hendricks2 228
229
 
6418 hendricks2 230
ifeq ($(findstring clang,$(CC) $(MAKECMDGOALS)),clang)
6108 hendricks2 231
    override CLANG := 1
6418 hendricks2 232
    CLANGNAME := $(CC)
233
else
5869 hendricks2 234
    CLANGNAME := clang
6418 hendricks2 235
endif
4644 hendricks2 236
# detect clang symlinked as gcc, as in OS X
237
CLANG_POTENTIAL_VERSION := $(shell $(CCFULLPATH) --version)
6147 hendricks2 238
ifeq ($(findstring clang,$(CLANG_POTENTIAL_VERSION)),clang)
4644 hendricks2 239
    override CLANG := 1
6418 hendricks2 240
    ifeq ($(findstring Apple,$(CLANG_POTENTIAL_VERSION)),Apple)
6631 hendricks2 241
        override APPLE_CLANG := 1
242
        APPLE_CLANG_VER := $(word 4,$(CLANG_POTENTIAL_VERSION))
243
        override APPLE_CLANG_VER_SPLIT := $(subst ., ,$(APPLE_CLANG_VER))
244
        APPLE_CLANG_MAJOR := $(word 1,$(APPLE_CLANG_VER_SPLIT))
245
        APPLE_CLANG_MINOR := $(word 2,$(APPLE_CLANG_VER_SPLIT))
246
    else
247
        CLANG_VER := $(word 3,$(CLANG_POTENTIAL_VERSION))
248
        override CLANG_VER_SPLIT := $(subst ., ,$(CLANG_VER))
249
        CLANG_MAJOR := $(word 1,$(CLANG_VER_SPLIT))
250
        CLANG_MINOR := $(word 2,$(CLANG_VER_SPLIT))
251
    endif
252
endif
4644 hendricks2 253
254
 
255
    CLANGXXNAME := $(subst clang,clang++,$(CLANGNAME))
6418 hendricks2 256
    override CC := $(CLANGNAME) -x c
257
    override CXX := $(CLANGXXNAME) -x c++
258
    override COBJC := $(CLANGNAME) -x objective-c
259
    override COBJCXX := $(CLANGXXNAME) -x objective-c++
260
    override L_CC := $(CLANGNAME)
261
    override L_CXX := $(CLANGXXNAME)
262
endif
4644 hendricks2 263
264
 
6419 hendricks2 265
ifeq (0,$(CLANG))
266
    GCC_VER := $(strip $(shell $(CCFULLPATH) -dumpversion 2>&1))
267
endif
3278 hendricks2 268
ifeq (,$(GCC_VER))
6419 hendricks2 269
    GCC_VER := 4.9.0
270
endif
3278 hendricks2 271
override GCC_VER_SPLIT := $(subst ., ,$(GCC_VER))
6419 hendricks2 272
GCC_MAJOR := $(word 1,$(GCC_VER_SPLIT))
273
GCC_MINOR := $(word 2,$(GCC_VER_SPLIT))
274
3096 hendricks2 275
 
6147 hendricks2 276
6419 hendricks2 277
 
278
    ifeq (0,$(CLANG))
6147 hendricks2 279
        GCC_PREREQ_4 := 0
280
        $(error How do you still have an old GCC in $$(CURRENT_YEAR)?)
281
    endif
3096 hendricks2 282
endif
283
284
 
6147 hendricks2 285
 
286
287
 
6418 hendricks2 288
6147 hendricks2 289
 
290
    ifndef COMPILERTARGET
291
        COMPILERTARGET := $(strip $(shell $(CC) -dumpmachine))
6418 hendricks2 292
    endif
3272 hendricks2 293
6147 hendricks2 294
 
6418 hendricks2 295
    ifeq ($(findstring x86_64,$(COMPILERTARGET)),x86_64)
6147 hendricks2 296
        IMPLICIT_ARCH := x86_64
6418 hendricks2 297
        BITS := 64
298
    endif
3272 hendricks2 299
else ifeq ($(PLATFORM),WII)
6147 hendricks2 300
    IMPLICIT_ARCH := ppc
6418 hendricks2 301
else
6147 hendricks2 302
    ifneq ($(ARCH),)
303
        override ARCH := $(subst i486,i386,$(subst i586,i386,$(subst i686,i386,$(strip $(ARCH)))))
6418 hendricks2 304
        IMPLICIT_ARCH := $(ARCH)
305
    else
6147 hendricks2 306
        IMPLICIT_ARCH := $(subst i486,i386,$(subst i586,i386,$(subst i686,i386,$(strip $(shell uname -m)))))
6418 hendricks2 307
    endif
3272 hendricks2 308
6147 hendricks2 309
 
310
        BITS := 64
6418 hendricks2 311
    endif
3272 hendricks2 312
endif
313
314
 
2476 hendricks2 315
 
6147 hendricks2 316
2398 hendricks2 317
 
6418 hendricks2 318
#  RELEASE - 1 := no debugging
319
#  FORCEDEBUG:
6548 terminx 320
#    1 := Include debug symbols even when generating release code.
6418 hendricks2 321
#    2 := Also enable sanitizers with Clang. On the C side, make 'sprite' etc. be real arrays.
322
#  KRANDDEBUG - 1 := include logging of krand() calls for debugging the demo system
323
#  MEMMAP - 1 := produce .memmap file when linking
324
#  OPTLEVEL - 0..3 := GCC optimization strategy
325
#  LTO - 1 := enable link-time optimization
326
6147 hendricks2 327
 
328
APPNAME ?=
8044 hendricks2 329
APPBASENAME ?=
330
6147 hendricks2 331
 
332
RELEASE := 1
6418 hendricks2 333
NOASM := 0
334
# EXPERIMENTAL, unfinished x86_64 assembly routines. DO NOT ENABLE.
6147 hendricks2 335
USE_ASM64 := 0
6418 hendricks2 336
MEMMAP := 0
337
CPLUSPLUS := 1
338
6147 hendricks2 339
 
340
STANDALONE ?= 0
8044 hendricks2 341
NETCODE ?= 1
342
STARTUP_WINDOW ?= 1
343
SIMPLE_MENU ?= 0
344
POLYMER ?= 1
345
USE_OPENGL := 1
6418 hendricks2 346
LUNATIC := 0
347
USE_LUAJIT_2_1 := 0
348
6147 hendricks2 349
 
350
HAVE_GTK2 := 1
6418 hendricks2 351
USE_LIBVPX ?= 1
8044 hendricks2 352
HAVE_VORBIS := 1
6418 hendricks2 353
HAVE_FLAC := 1
354
HAVE_XMP := 1
355
RENDERTYPE := SDL
356
MIXERTYPE := SDL
357
SDL_TARGET := 2
358
USE_PHYSFS := 0
7359 hendricks2 359
4107 helixhorne 360
 
7359 hendricks2 361
    # PhysFS requires this to be off
362
    override CPLUSPLUS := 0
363
endif
364
365
 
1739 helixhorne 366
FORCEDEBUG := 0
6548 terminx 367
KRANDDEBUG := 0
6418 hendricks2 368
PROFILER := 0
369
# Make allocache() a wrapper around malloc()? Useful for debugging
4298 helixhorne 370
# allocache()-allocated memory accesses with e.g. Valgrind.
371
# For debugging with Valgrind + GDB, see
372
# http://valgrind.org/docs/manual/manual-core-adv.html#manual-core-adv.gdbserver
373
ALLOCACHE_AS_MALLOC := 0
6418 hendricks2 374
4298 helixhorne 375
 
6147 hendricks2 376
 
377
378
 
379
    RELEASE := 0
6418 hendricks2 380
endif
3725 helixhorne 381
ifneq (100,$(RELEASE)$(PROFILER)$(ALLOCACHE_AS_MALLOC))
6147 hendricks2 382
    # so that we have debug symbols
383
    FORCEDEBUG := 1
6548 terminx 384
endif
6147 hendricks2 385
3725 helixhorne 386
 
6147 hendricks2 387
    MIXERTYPE := WIN
6418 hendricks2 388
    ifneq ($(RENDERTYPE),SDL)
6147 hendricks2 389
        ifeq ($(MIXERTYPE),SDL)
390
            override MIXERTYPE := WIN
6418 hendricks2 391
        endif
6147 hendricks2 392
    endif
393
    override HAVE_GTK2 := 0
6418 hendricks2 394
else ifeq ($(PLATFORM),DARWIN)
6147 hendricks2 395
    HAVE_GTK2 := 0
6418 hendricks2 396
else ifeq ($(PLATFORM),WII)
6147 hendricks2 397
    override USE_OPENGL := 0
6418 hendricks2 398
    override NETCODE := 0
399
    override HAVE_GTK2 := 0
400
    override HAVE_FLAC := 0
401
    SDL_TARGET := 1
402
else ifeq ($(PLATFORM),$(filter $(PLATFORM),DINGOO GCW QNX SUNOS SYLLABLE))
6147 hendricks2 403
    override USE_OPENGL := 0
6418 hendricks2 404
    override NOASM := 1
405
else ifeq ($(PLATFORM),$(filter $(PLATFORM),BEOS SKYOS))
6147 hendricks2 406
    override NOASM := 1
6418 hendricks2 407
endif
6147 hendricks2 408
409
 
410
    override NOASM := 1
6418 hendricks2 411
endif
6147 hendricks2 412
413
 
414
    override POLYMER := 0
6418 hendricks2 415
    override USE_LIBVPX := 0
416
endif
6147 hendricks2 417
418
 
3422 helixhorne 419
    override STRIP :=
6418 hendricks2 420
endif
3422 helixhorne 421
ifneq ($(FORCEDEBUG),0)
6548 terminx 422
    override STRIP :=
6418 hendricks2 423
endif
3422 helixhorne 424
425
 
6147 hendricks2 426
    OPTLEVEL := 0
6418 hendricks2 427
6631 hendricks2 428
 
429
    ifeq (1,$(APPLE_CLANG))
430
      # Apple clang >= 9.0
431
      ifeq (,$(filter 0 1 2 3 4 5 6 7 8,$(APPLE_CLANG_MAJOR)))
432
        OPTLEVEL := g
433
      endif
434
    else ifeq (1,$(CLANG))
435
      # clang >= 4.0
436
      ifeq (,$(filter 0 1 2 3,$(CLANG_MAJOR)))
437
        OPTLEVEL := g
438
      endif
439
    else
440
      # GCC >= 4.8
441
      ifeq (,$(filter 0 1 2 3 4,$(GCC_MAJOR)))
442
        OPTLEVEL := g
443
      else ifeq (4,$(GCC_MAJOR))
444
        ifeq (,$(filter 0 1 2 3 4 5 6 7,$(GCC_MINOR)))
445
          OPTLEVEL := g
446
        endif
447
      endif
448
    endif
449
450
 
6418 hendricks2 451
else
6147 hendricks2 452
    OPTLEVEL := 2
6418 hendricks2 453
    LTO := 1
454
endif
6147 hendricks2 455
456
 
457
    ifeq ($(PLATFORM),WINDOWS)
458
        LTO := 0
6418 hendricks2 459
    endif
6147 hendricks2 460
endif
461
ifneq ($(LUNATIC),0)
3957 helixhorne 462
    # FIXME: Lunatic builds with LTO don't start up properly as the required
463
    # symbol names are apparently not exported.
464
    override LTO := 0
6418 hendricks2 465
endif
3957 helixhorne 466
ifeq (0,$(CLANG))
6147 hendricks2 467
    ifeq (0,$(GCC_PREREQ_4))
468
        override LTO := 0
6418 hendricks2 469
    endif
6147 hendricks2 470
    ifeq (4,$(GCC_MAJOR))
6419 hendricks2 471
        ifeq ($(PLATFORM),WII)
6147 hendricks2 472
            ifneq (,$(filter 0 1 2 3 4 5 6 7,$(GCC_MINOR)))
6419 hendricks2 473
                override LTO := 0
6418 hendricks2 474
            endif
6147 hendricks2 475
        else
476
            ifneq (,$(filter 0 1 2 3 4 5,$(GCC_MINOR)))
6419 hendricks2 477
                override LTO := 0
6418 hendricks2 478
            endif
6147 hendricks2 479
        endif
3122 hendricks2 480
    endif
481
endif
482
483
 
4543 hendricks2 484
 
6147 hendricks2 485
4543 hendricks2 486
 
487
 
6147 hendricks2 488
4543 hendricks2 489
 
6418 hendricks2 490
COMPILERFLAGS := -funsigned-char
491
6147 hendricks2 492
 
6418 hendricks2 493
CXXSTD := -std=gnu++11
494
ifneq (0,$(CLANG))
6110 hendricks2 495
    CSTD := $(subst gnu,c,$(CSTD))
6418 hendricks2 496
    CXXSTD := $(subst gnu,c,$(CXXSTD))
497
endif
6110 hendricks2 498
CONLYFLAGS := $(CSTD)
6418 hendricks2 499
CXXONLYFLAGS := $(CXXSTD) -fno-exceptions -fno-rtti
500
6110 hendricks2 501
 
6418 hendricks2 502
6147 hendricks2 503
 
504
505
 
6418 hendricks2 506
L_CXXONLYFLAGS :=
507
6147 hendricks2 508
 
6418 hendricks2 509
GUI_LIBS :=
510
LIBDIRS :=
511
4543 hendricks2 512
 
3096 hendricks2 513
 
6147 hendricks2 514
5555 hendricks2 515
 
6418 hendricks2 516
# Options to "luajit -b" for synthesis. Since it runs on Linux, we need to tell
6147 hendricks2 517
# the native LuaJIT to emit PE object files.
518
ifeq ($(PLATFORM),WINDOWS)
3278 hendricks2 519
    LINKERFLAGS += -static-libgcc -static
6418 hendricks2 520
    ifeq (0,$(CLANG))
6147 hendricks2 521
        L_CXXONLYFLAGS += -static-libstdc++
522
    endif
3278 hendricks2 523
524
 
6147 hendricks2 525
        GUI_LIBS += -mwindows
526
    endif
3278 hendricks2 527
528
 
6418 hendricks2 529
    ASFORMAT := win$(BITS)
530
    ASFLAGS += -DUNDERSCORES
531
5762 hendricks2 532
 
8093 hendricks2 533
    LINKERFLAGS += -Wl,--enable-auto-import,--nxcompat$(DYNAMICBASE)
534
    ifneq ($(findstring x86_64,$(COMPILERTARGET)),x86_64)
6147 hendricks2 535
        LINKERFLAGS += -Wl,--large-address-aware
6418 hendricks2 536
    else
8054 terminx 537
        LINKERFLAGS += -Wl,--high-entropy-va
538
    endif
5762 hendricks2 539
3278 hendricks2 540
 
6147 hendricks2 541
    ifeq (32,$(BITS))
542
        LUAJIT_BCOPTS += -a x86
543
    endif
3278 hendricks2 544
    ifeq (64,$(BITS))
6147 hendricks2 545
        LUAJIT_BCOPTS += -a x64
546
    endif
3096 hendricks2 547
else ifeq ($(PLATFORM),DARWIN)
6147 hendricks2 548
    ifneq ($(ARCH),)
5919 hendricks2 549
        ifneq ($(findstring -arch,$(ARCH)),-arch)
550
            override ARCH := -arch $(ARCH)
551
        endif
552
    endif
553
    COMMONFLAGS += $(ARCH)
6147 hendricks2 554
5919 hendricks2 555
 
6147 hendricks2 556
        LINKERFLAGS += -read_only_relocs suppress
557
    endif
3096 hendricks2 558
5983 hendricks2 559
 
6418 hendricks2 560
    ASFORMAT := macho
561
    ASFLAGS += -DUNDERSCORES
562
3096 hendricks2 563
 
6147 hendricks2 564
        ASFORMAT += 64
6418 hendricks2 565
    endif
4555 hendricks2 566
else ifeq ($(PLATFORM),WII)
6147 hendricks2 567
    LIBOGC_INC := $(DEVKITPRO)/libogc/include
6420 hendricks2 568
    LIBOGC_LIB := $(DEVKITPRO)/libogc/lib/wii
569
570
 
571
    LINKERFLAGS += -Wl,--gc-sections
572
    # -msdata=eabiexport
573
    COMPILERFLAGS += -DGEKKO -D__POWERPC__ -I$(LIBOGC_INC)
6418 hendricks2 574
    LIBDIRS += -L$(LIBOGC_LIB)
6147 hendricks2 575
else ifeq ($(PLATFORM),$(filter $(PLATFORM),DINGOO GCW))
576
    COMPILERFLAGS += -D__OPENDINGUX__
577
else ifeq ($(PLATFORM),SKYOS)
578
    COMPILERFLAGS += -DUNDERSCORES
6418 hendricks2 579
else ifeq ($(SUBPLATFORM),LINUX)
8094 hendricks2 580
    # Locate .so files
581
    LINKERFLAGS += -Wl,-rpath,'$$ORIGIN' -Wl,-z,origin
582
endif
4555 hendricks2 583
ASFLAGS += -f $(ASFORMAT)
6147 hendricks2 584
4555 hendricks2 585
 
6418 hendricks2 586
6147 hendricks2 587
 
588
 
589
590
 
3096 hendricks2 591
    ifeq ($(findstring x86_64, $(IMPLICIT_ARCH)),x86_64)
5766 hendricks2 592
        ifeq ($(findstring x86_64h, $(IMPLICIT_ARCH)),x86_64h)
5776 hendricks2 593
            OPTOPT := -march=haswell -mmmx -msse -msse2 -msse3 -mssse3 -msse4.1 -msse4.2 -mpopcnt -mpclmul -mavx -mrdrnd -mf16c -mfsgsbase -mavx2 -maes -mfma -mbmi -mbmi2
6418 hendricks2 594
            # -mcrc32 -mmovbe
5776 hendricks2 595
        else
596
            ifeq ($(PLATFORM),DARWIN)
597
                OPTOPT := -march=core2 -mmmx -msse -msse2 -msse3 -mssse3
6418 hendricks2 598
            endif
5776 hendricks2 599
        endif
5766 hendricks2 600
    endif
601
    ifeq ($(findstring i386, $(IMPLICIT_ARCH)),i386)
5762 hendricks2 602
        ifeq ($(PLATFORM),DARWIN)
5763 hendricks2 603
            OPTOPT := -march=nocona -mmmx -msse -msse2 -msse3
6418 hendricks2 604
        else
5763 hendricks2 605
            OPTOPT := -march=pentium3
6418 hendricks2 606
            ifneq (0,$(GCC_PREREQ_4))
6147 hendricks2 607
                OPTOPT += -mtune=generic
608
                # -mstackrealign
609
            endif
610
            OPTOPT += -mmmx -msse -msse2 -mfpmath=sse
7749 pogokeen 611
        endif
5763 hendricks2 612
    endif
3096 hendricks2 613
    ifeq ($(PLATFORM),WII)
6147 hendricks2 614
        OPTOPT := -mtune=750
6418 hendricks2 615
    endif
6147 hendricks2 616
endif
3096 hendricks2 617
618
 
6147 hendricks2 619
    COMMONFLAGS += -O$(OPTLEVEL) $(OPTOPT)
620
endif
1739 helixhorne 621
6147 hendricks2 622
 
623
    COMPILERFLAGS += -DUSING_LTO
624
    COMMONFLAGS += -flto
625
endif
1739 helixhorne 626
627
 
628
 
6147 hendricks2 629
2685 hendricks2 630
 
6548 terminx 631
    ifeq ($(PACKAGE_REPOSITORY),0)
6147 hendricks2 632
        COMMONFLAGS += -g
633
        ifeq (0,$(CLANG))
634
            ifneq ($(PLATFORM),WII)
635
                COMMONFLAGS += -fno-omit-frame-pointer
636
            endif
637
        endif
638
    endif
639
    ifeq ($(SUBPLATFORM),LINUX)
640
        # This option is needed to allow obtaining backtraces from within a program.
641
        LIBS += -rdynamic
6418 hendricks2 642
    endif
6147 hendricks2 643
endif
1933 helixhorne 644
1852 helixhorne 645
 
4298 helixhorne 646
    COMPILERFLAGS += -DDEBUG_ALLOCACHE_AS_MALLOC
4543 hendricks2 647
endif
4298 helixhorne 648
649
 
6549 terminx 650
# and https://gcc.gnu.org/onlinedocs/gcc/Instrumentation-Options.html
651
# for a list of possible ASan and UBsan options.
652
4020 helixhorne 653
 
6549 terminx 654
ASAN_FLAGS := $(ASAN_FLAGS),signed-integer-overflow,unsigned-integer-overflow
655
ASAN_FLAGS := $(ASAN_FLAGS),undefined,return,null,pointer-overflow,float-divide-by-zero
656
#ASAN_FLAGS := $(ASAN_FLAGS) -fsanitize-undefined-trap-on-error
657
658
 
6548 terminx 659
    COMPILERFLAGS += -DNDEBUG
6147 hendricks2 660
else
1739 helixhorne 661
    COMPILERFLAGS += -DDEBUGGINGAIDS=$(FORCEDEBUG)
6548 terminx 662
6549 terminx 663
 
664
        ifneq (0,$(CLANG))
665
            COMMONFLAGS += $(ASAN_FLAGS)
666
        else ifneq (,$(filter 1 2 3 4 5 6,$(GCC_MAJOR)))
667
            ifneq (,$(filter 0 1,$(GCC_MINOR)))
668
                COMMONFLAGS += $(ASAN_FLAGS)
669
            endif
670
        endif
4756 helixhorne 671
    endif
2270 helixhorne 672
endif
6147 hendricks2 673
2270 helixhorne 674
 
6147 hendricks2 675
    COMPILERFLAGS += -DKRANDDEBUG=1
676
endif
677
678
 
679
    ifneq ($(PLATFORM),DARWIN)
680
        LIBS += -lprofiler
6418 hendricks2 681
    endif
1770 plagman 682
    COMMONFLAGS += -pg
6147 hendricks2 683
endif
684
4756 helixhorne 685
 
6147 hendricks2 686
 
687
688
 
689
    F_NO_STACK_PROTECTOR := -fno-stack-protector
690
    ifeq (0,$(CLANG))
691
        F_JUMP_TABLES := -fjump-tables
692
    endif
1850 terminx 693
endif
6147 hendricks2 694
695
 
696
    ifeq (1,$(DARWIN9))
697
        F_JUMP_TABLES :=
698
    endif
1739 helixhorne 699
    ifeq ($(findstring ppc,$(IMPLICIT_ARCH))$(findstring i386,$(IMPLICIT_ARCH)),)
6147 hendricks2 700
        F_NO_STACK_PROTECTOR :=
701
    endif
1739 helixhorne 702
endif
703
704
 
6147 hendricks2 705
    F_NO_STACK_PROTECTOR :=
706
else
707
    ifeq (0,$(CLANG))
708
        COMMONFLAGS += -funswitch-loops
709
    endif
710
711
 
6548 terminx 712
        COMMONFLAGS += -fomit-frame-pointer
6147 hendricks2 713
    endif
714
endif
715
716
 
717
    COMMONFLAGS += -fno-inline -fno-inline-functions -fno-inline-functions-called-once
718
endif
719
720
 
7297 terminx 721
6147 hendricks2 722
 
723
 
724
725
 
726
727
 
728
    ifneq (0,$(DARWIN9))
729
        W_STRICT_OVERFLOW :=
730
    endif
731
endif
732
733
 
5555 hendricks2 734
W_GCC_4_1 := -Wno-attributes
735
W_GCC_4_2 := $(W_STRICT_OVERFLOW)
736
W_GCC_4_4 := -Wno-unused-result
737
W_GCC_4_5 := -Wlogical-op -Wcast-qual
738
W_GCC_6 := -Wduplicated-cond -Wnull-dereference
7671 terminx 739
W_GCC_7 := -Wduplicated-branches
740
W_GCC_8 := -Warray-bounds=2
7743 terminx 741
W_GCC_9 := -Wmultistatement-macros
742
W_CLANG := -Wno-unused-value -Wno-parentheses -Wno-unknown-warning-option
6418 hendricks2 743
1791 helixhorne 744
 
6418 hendricks2 745
    W_CLANG :=
746
2797 helixhorne 747
 
7743 terminx 748
        W_GCC_9 :=
749
        ifneq (,$(filter 4 5 6 7,$(GCC_MAJOR)))
750
            W_GCC_8 :=
751
            ifneq (,$(filter 4 5 6,$(GCC_MAJOR)))
752
                W_GCC_7 :=
753
                ifneq (,$(filter 4 5,$(GCC_MAJOR)))
754
                    W_GCC_6 :=
755
                endif
756
            endif
757
        endif
758
    endif
7671 terminx 759
760
 
6147 hendricks2 761
        W_GCC_9 :=
7743 terminx 762
        W_GCC_8 :=
7671 terminx 763
        W_GCC_7 :=
764
        W_GCC_6 :=
765
        W_GCC_4_5 :=
5555 hendricks2 766
        W_GCC_4_4 :=
767
        ifeq (0,$(OPTLEVEL))
768
            W_UNINITIALIZED :=
769
        endif
770
        W_GCC_4_2 :=
771
        W_GCC_4_1 :=
772
    endif
773
774
 
6419 hendricks2 775
        ifneq (,$(filter 0 1 2 3 4,$(GCC_MINOR)))
776
            W_GCC_4_5 :=
5555 hendricks2 777
            ifneq (,$(filter 0 1 2 3,$(GCC_MINOR)))
6419 hendricks2 778
                W_GCC_4_4 :=
5555 hendricks2 779
                ifeq (0,$(OPTLEVEL))
780
                    W_UNINITIALIZED :=
781
                endif
782
                ifneq (,$(filter 0 1,$(GCC_MINOR)))
6419 hendricks2 783
                    W_GCC_4_2 :=
5555 hendricks2 784
                    ifeq (0,$(GCC_MINOR))
6419 hendricks2 785
                        W_GCC_4_1 :=
5555 hendricks2 786
                    endif
787
                endif
788
            endif
789
        endif
790
    endif
791
endif
2159 helixhorne 792
793
 
6418 hendricks2 794
4543 hendricks2 795
 
6418 hendricks2 796
    -Wextra \
797
    -Wpointer-arith \
798
    -Wno-char-subscripts \
799
    -Wno-missing-braces \
800
    -Wwrite-strings \
801
    $(W_UNINITIALIZED) \
802
    $(W_GCC_4_1) \
803
    $(W_GCC_4_2) \
804
    $(W_GCC_4_4) \
805
    $(W_GCC_4_5) \
806
    $(W_GCC_6) \
7671 terminx 807
    $(W_GCC_7) \
808
    $(W_GCC_8) \
809
    $(W_GCC_9) \
8049 terminx 810
    $(W_CLANG) \
6418 hendricks2 811
    #-Wstrict-prototypes \
812
    #-Waggregate-return \
813
    #-Wcast-align \
814
    #-Waddress
815
816
 
817
 
6147 hendricks2 818
4543 hendricks2 819
 
6147 hendricks2 820
    COMPILERFLAGS += "-DAPPNAME=\"$(APPNAME)\""
8044 hendricks2 821
endif
3260 helixhorne 822
ifneq (,$(APPBASENAME))
6147 hendricks2 823
    COMPILERFLAGS += "-DAPPBASENAME=\"$(APPBASENAME)\""
8044 hendricks2 824
endif
6147 hendricks2 825
3148 helixhorne 826
 
6147 hendricks2 827
    COMPILERFLAGS += -DNOASM
6418 hendricks2 828
endif
4023 helixhorne 829
ifneq (0,$(USE_ASM64))
6147 hendricks2 830
    COMPILERFLAGS += -DUSE_ASM64
6418 hendricks2 831
endif
6147 hendricks2 832
ifneq (0,$(MEMMAP))
833
    ifeq ($(PLATFORM),DARWIN)
834
        LINKERFLAGS += -Wl,-map -Wl,$@.memmap
6418 hendricks2 835
    else
3148 helixhorne 836
        LINKERFLAGS += -Wl,-Map=$@.memmap
6418 hendricks2 837
    endif
3148 helixhorne 838
endif
839
840
 
6418 hendricks2 841
3148 helixhorne 842
 
6147 hendricks2 843
    COMPILERFLAGS += -DNETCODE_DISABLE
6418 hendricks2 844
endif
3116 hendricks2 845
ifneq (0,$(STARTUP_WINDOW))
5928 terminx 846
    COMPILERFLAGS += -DSTARTUP_WINDOW
6418 hendricks2 847
endif
5928 terminx 848
ifneq (0,$(SIMPLE_MENU))
6013 terminx 849
    COMPILERFLAGS += -DEDUKE32_SIMPLE_MENU
6418 hendricks2 850
endif
6013 terminx 851
ifneq (0,$(STANDALONE))
6009 terminx 852
    COMPILERFLAGS += -DEDUKE32_STANDALONE
6418 hendricks2 853
endif
6009 terminx 854
ifneq (0,$(USE_OPENGL))
6147 hendricks2 855
    COMPILERFLAGS += -DUSE_OPENGL
6418 hendricks2 856
endif
6051 hendricks2 857
ifneq (0,$(POLYMER))
6147 hendricks2 858
    COMPILERFLAGS += -DPOLYMER
6418 hendricks2 859
endif
6051 hendricks2 860
6008 terminx 861
 
4513 hendricks2 862
 
6147 hendricks2 863
4513 hendricks2 864
 
6147 hendricks2 865
    COMPILERFLAGS += -Iplatform/Windows/include
6418 hendricks2 866
    LIBDIRS += -Lplatform/Windows/lib/$(BITS)
867
else ifeq ($(PLATFORM),DARWIN)
6147 hendricks2 868
    ifneq ($(shell port --version &>/dev/null; echo $$?),127)
4644 hendricks2 869
        LIBDIRS += -L/opt/local/lib
6418 hendricks2 870
        COMPILERFLAGS += -I/opt/local/include
871
    endif
4644 hendricks2 872
    ifneq ($(shell brew --version &>/dev/null; echo $$?),127)
873
        LIBDIRS += -L/usr/local/lib
6418 hendricks2 874
        COMPILERFLAGS += -I/usr/local/include
875
    endif
4644 hendricks2 876
    ifneq ($(shell fink --version &>/dev/null; echo $$?),127)
877
        LIBDIRS += -L/sw/lib
6418 hendricks2 878
        COMPILERFLAGS += -I/sw/include
879
    endif
4644 hendricks2 880
else ifeq ($(PLATFORM),BSD)
6147 hendricks2 881
    COMPILERFLAGS += -I/usr/local/include
6418 hendricks2 882
else ifeq ($(PLATFORM),WII)
6147 hendricks2 883
    COMPILERFLAGS += -I$(PORTLIBS)/include -Iplatform/Wii/include
6418 hendricks2 884
    LIBDIRS += -L$(PORTLIBS)/lib -Lplatform/Wii/lib
6147 hendricks2 885
endif
886
4644 hendricks2 887
 
4543 hendricks2 888
 
6147 hendricks2 889
890
 
891
    ifneq ($(USE_LUAJIT_2_1),0)
892
        COMPILERFLAGS += -DUSE_LUAJIT_2_1
6418 hendricks2 893
    endif
4543 hendricks2 894
895
 
6147 hendricks2 896
        LIBS += -lluajit
6418 hendricks2 897
    else
6147 hendricks2 898
        LIBS += -lluajit-5.1
6418 hendricks2 899
    endif
4543 hendricks2 900
endif
901
902
 
6147 hendricks2 903
    COMPILERFLAGS += -DUSE_LIBVPX
6418 hendricks2 904
    LIBS += -lvpx
905
endif
4543 hendricks2 906
6147 hendricks2 907
 
908
    COMPILERFLAGS += -DHAVE_VORBIS
6418 hendricks2 909
endif
4543 hendricks2 910
ifneq (0,$(HAVE_FLAC))
6147 hendricks2 911
    COMPILERFLAGS += -DHAVE_FLAC
6418 hendricks2 912
endif
4543 hendricks2 913
ifneq (0,$(HAVE_XMP))
6147 hendricks2 914
    COMPILERFLAGS += -DHAVE_XMP
6418 hendricks2 915
endif
4543 hendricks2 916
917
 
6147 hendricks2 918
    ifeq ($(SDL_TARGET),2)
5778 hendricks2 919
        SDLCONFIG := sdl2-config
6418 hendricks2 920
        SDLNAME := SDL2
921
    else ifeq ($(SDL_TARGET),1)
6147 hendricks2 922
        SDLCONFIG := sdl-config
6418 hendricks2 923
        SDLNAME := SDL
924
        ifeq (0,$(RELEASE))
5778 hendricks2 925
            COMPILERFLAGS += -DNOSDLPARACHUTE
926
        endif
927
    endif
928
4543 hendricks2 929
 
7372 terminx 930
        SDLCONFIG :=
931
    endif
932
933
 
6418 hendricks2 934
        SDLCONFIG :=
935
    else ifeq ($(PLATFORM),SKYOS)
936
        COMPILERFLAGS += -I/boot/programs/sdk/include/sdl
937
        SDLCONFIG :=
938
    endif
939
940
 
5778 hendricks2 941
        ifeq ($(strip $(shell $(SDLCONFIG) --version $(DONT_PRINT_STDERR))),)
942
            override SDLCONFIG :=
6418 hendricks2 943
        endif
5778 hendricks2 944
    endif
4543 hendricks2 945
946
 
947
948
 
6418 hendricks2 949
    ifneq ($(SDL_FRAMEWORK),0)
5778 hendricks2 950
        ifeq ($(PLATFORM),DARWIN)
951
            APPLE_FRAMEWORKS := /Library/Frameworks
6418 hendricks2 952
            LIBDIRS += -F$(APPLE_FRAMEWORKS)
5778 hendricks2 953
            ifeq ($(MIXERTYPE),SDL)
954
                COMPILERFLAGS += -I$(APPLE_FRAMEWORKS)/$(SDLNAME)_mixer.framework/Headers
955
                LIBS += -Wl,-framework,$(SDLNAME)_mixer
956
            endif
4543 hendricks2 957
            COMPILERFLAGS += -I$(APPLE_FRAMEWORKS)/$(SDLNAME).framework/Headers
5778 hendricks2 958
            LIBS += -Wl,-framework,$(SDLNAME) -Wl,-rpath -Wl,"@loader_path/../Frameworks"
959
        endif
4543 hendricks2 960
    else
961
        ifeq ($(MIXERTYPE),SDL)
5778 hendricks2 962
            LIBS += -l$(SDLNAME)_mixer
963
        endif
964
        ifneq ($(SDLCONFIG),)
965
            SDLCONFIG_CFLAGS := $(strip $(subst -Dmain=SDL_main,,$(shell $(SDLCONFIG) --cflags)))
966
            SDLCONFIG_LIBS := $(strip $(subst -mwindows,,$(shell $(SDLCONFIG) --libs)))
967
968
 
6108 hendricks2 969
            LIBS += $(SDLCONFIG_LIBS)
5778 hendricks2 970
        else
971
            ifeq ($(SDL_TARGET),1)
972
                COMPILERFLAGS += -D_GNU_SOURCE=1
973
            endif
4543 hendricks2 974
            COMPILERFLAGS += -D_REENTRANT -DSDL_USEFOLDER
5778 hendricks2 975
            LIBS += -l$(SDLNAME)
6418 hendricks2 976
        endif
4543 hendricks2 977
    endif
978
endif
6147 hendricks2 979
4543 hendricks2 980
 
6147 hendricks2 981
    ifneq (No,$(shell $(PKG_CONFIG) --exists gtk+-2.0 || echo No))
982
        COMPILERFLAGS += -DHAVE_GTK2 $(shell $(PKG_CONFIG) --cflags gtk+-2.0)
983
    else
4543 hendricks2 984
        override HAVE_GTK2 := 0
6418 hendricks2 985
    endif
4543 hendricks2 986
endif
987
988
 
989
 
6147 hendricks2 990
4543 hendricks2 991
 
992
    ifneq (0,$(GCC_PREREQ_4))
6147 hendricks2 993
        L_SSP := -lssp
994
    endif
4543 hendricks2 995
    LIBS += -lmingwex -lgdi32 -lpthread
6418 hendricks2 996
    ifeq ($(RENDERTYPE),WIN)
6147 hendricks2 997
        LIBS += -ldxguid
998
    else ifeq ($(SDL_TARGET),1)
6939 pogokeen 999
        LIBS += -ldxguid -lmingw32 -limm32 -lole32 -loleaut32 -lversion
1000
    else
4543 hendricks2 1001
        LIBS += -ldxguid_sdl -lmingw32 -limm32 -lole32 -loleaut32 -lversion -lsetupapi
7920 terminx 1002
    endif
4543 hendricks2 1003
    LIBS += -lcomctl32 -lwinmm $(L_SSP) -lwsock32 -lws2_32 -lshlwapi
7318 terminx 1004
    # -lshfolder
6147 hendricks2 1005
else ifeq ($(PLATFORM),SKYOS)
1006
    LIBS += -lnet
6418 hendricks2 1007
else ifeq ($(PLATFORM),QNX)
6147 hendricks2 1008
    LIBS += -lsocket
6418 hendricks2 1009
else ifeq ($(PLATFORM),SUNOS)
6147 hendricks2 1010
    LIBS += -lsocket -lnsl
6418 hendricks2 1011
else ifeq ($(PLATFORM),WII)
6147 hendricks2 1012
    LIBS += -laesnd_tueidj -lfat -lwiiuse -lbte -lwiikeyboard -logc
6418 hendricks2 1013
else ifeq ($(SUBPLATFORM),LINUX)
6147 hendricks2 1014
    LIBS += -lrt
6418 hendricks2 1015
endif
4543 hendricks2 1016
1017
 
6147 hendricks2 1018
    ifneq ($(PLATFORM),BSD)
1019
        LIBS += -ldl
6418 hendricks2 1020
    endif
4543 hendricks2 1021
    ifneq ($(PLATFORM),DARWIN)
6147 hendricks2 1022
        LIBS += -pthread
6418 hendricks2 1023
    endif
6147 hendricks2 1024
endif
4543 hendricks2 1025
1026
 
6147 hendricks2 1027
4543 hendricks2 1028
 
1029
 
6147 hendricks2 1030
1031
 
6419 hendricks2 1032
-include EDUKE32_REVISION.mak
1033
ifeq (,$(VC_REV))
4565 hendricks2 1034
    VC_REV := $(word 2,$(subst :, ,$(filter Revision:%,$(subst : ,:,$(strip $(shell svn info 2>&1))))))
6419 hendricks2 1035
endif
4565 hendricks2 1036
ifeq (,$(VC_REV))
1037
    GIT_SVN_URL := $(strip $(shell git config --local svn-remote.svn.url))
6419 hendricks2 1038
    GIT_SVN_FETCH := $(strip $(shell git config --local svn-remote.svn.fetch))
1039
    VC_REV := $(word 2,$(subst @, ,$(filter git-svn-id:$(GIT_SVN_URL)@%,$(subst : ,:,$(shell git log -1 $(GIT_SVN_FETCH::%=%))))))
1040
endif
4565 hendricks2 1041
ifneq (,$(VC_REV)$(VC_REV_CUSTOM))
1042
    REVFLAG := -DREV="\"r$(VC_REV)$(VC_REV_CUSTOM)\""
6147 hendricks2 1043
endif
4565 hendricks2 1044
1045
 
6147 hendricks2 1046
 
6418 hendricks2 1047
1048
 
1049
    COMMONFLAGS += $(CFLAGS)
1050
endif
1051
ifneq (,$(CXXFLAGS))
1052
    CXXONLYFLAGS += $(CXXFLAGS)
1053
endif
1054
ifneq (,$(LDFLAGS))
1055
    LINKERFLAGS += $(LDFLAGS)
1056
endif
1057
1058
 
1059
 
6147 hendricks2 1060
1061
 
6086 hendricks2 1062
COMPILER_CXX=$(CXX) $(CXXONLYFLAGS) $(COMMONFLAGS) $(CWARNS) $(COMPILERFLAGS) $(CUSTOMOPT)
1063
COMPILER_OBJC=$(COBJC) $(CONLYFLAGS) $(COMMONFLAGS) $(CWARNS) $(CONLYWARNS) $(COMPILERFLAGS) $(CUSTOMOPT)
1064
COMPILER_OBJCXX=$(COBJCXX) $(CXXONLYFLAGS) $(COMMONFLAGS) $(CWARNS) $(COMPILERFLAGS) $(CUSTOMOPT)
1065
LINKER=$(L_CXX) $(CXXONLYFLAGS) $(L_CXXONLYFLAGS) $(COMMONFLAGS) $(LINKERFLAGS) $(CUSTOMOPT)
1066
ifneq ($(CPLUSPLUS),0)
4543 hendricks2 1067
    COMPILER_C=$(COMPILER_CXX)
6056 hendricks2 1068
    COMPILER_OBJC=$(COMPILER_OBJCXX)
1069
endif
4543 hendricks2 1070
1071
 
6147 hendricks2 1072
 
1073
1074
 
4543 hendricks2 1075
RECIPE_IF = if
1076
BUILD_STARTED = printf "\033[K\033[1;36mBuilding: \033[0;36m$(MAKE) $(MAKECMDGOALS) -$(MAKEFLAGS)\033[0m\n"
6148 hendricks2 1077
COMPILE_STATUS = printf "\033[K\033[0mBuilding object \033[1m$@\033[0m...\033[0m\r"
4543 hendricks2 1078
COMPILE_OK = printf "\033[K\033[0;32mBuilt object \033[1;32m$@\033[0;32m \033[0m\n"
1079
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
1080
RECIPE_RESULT_COMPILE = ; then $(COMPILE_OK); else $(COMPILE_FAILED); fi
1081
ONESTEP_STATUS = printf "\033[K\033[0mBuilding \033[1m$@\033[0m...\033[0m\r"
5279 terminx 1082
ONESTEP_OK = printf "\033[K\033[0;32mBuilt \033[1;32m$@\033[0;32m \033[0m\n"
1083
ONESTEP_FAILED = printf "\033[K\033[0;31mFailed building \033[1;31m$@\033[0;31m!\033[0m\n"; exit 1
1084
RECIPE_RESULT_ONESTEP = ; then $(ONESTEP_OK); else $(ONESTEP_FAILED); fi
4543 hendricks2 1085
ARCHIVE_STATUS = printf "\033[K\033[0mCreating library archive \033[1m$@\033[0m...\033[0m\r"
1086
ARCHIVE_OK = printf "\033[K\033[0;32mCreated library archive \033[1;32m$@\033[0;32m \033[0m\n"
1087
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
1088
RECIPE_RESULT_ARCHIVE = ; then $(ARCHIVE_OK); else $(ARCHIVE_FAILED); fi
1089
LINK_STATUS = printf "\033[K\033[0;0mLinking \033[1m$@\033[0;0m...\033[0m\r"
5279 terminx 1090
LINK_OK = printf "\033[K\033[0;32mLinked \033[1;32m$@\033[0;32m \033[0m\n"
1091
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 1092
RECIPE_RESULT_LINK = ; then $(LINK_OK); else $(LINK_FAILED); fi
4543 hendricks2 1093
else
1094
RECIPE_IF =
1095
BUILD_STARTED =
1096
COMPILE_STATUS =
1097
COMPILE_OK = true
1098
COMPILE_FAILED = false; exit 1
1099
RECIPE_RESULT_COMPILE =
1100
ONESTEP_STATUS =
1101
ONESTEP_OK = true
1102
ONESTEP_FAILED = false; exit 1
1103
RECIPE_RESULT_ONESTEP =
1104
ARCHIVE_STATUS =
1105
ARCHIVE_OK = true
1106
ARCHIVE_FAILED = false; exit 1
1107
RECIPE_RESULT_ARCHIVE =
1108
LINK_STATUS =
1109
LINK_OK = true
1110
LINK_FAILED = false; exit 1
1111
RECIPE_RESULT_LINK =
1112
endif
1113