Subversion Repositories eduke32

Rev

Rev 8569 | 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
RETAIL_MENU ?= 0
8569 terminx 344
POLYMER ?= 1
8044 hendricks2 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
SDL_TARGET := 2
357
USE_PHYSFS := 0
7359 hendricks2 358
4107 helixhorne 359
 
7359 hendricks2 360
    # PhysFS requires this to be off
361
    override CPLUSPLUS := 0
362
endif
363
364
 
1739 helixhorne 365
FORCEDEBUG := 0
6548 terminx 366
KRANDDEBUG := 0
6418 hendricks2 367
PROFILER := 0
368
# Make allocache() a wrapper around malloc()? Useful for debugging
4298 helixhorne 369
# allocache()-allocated memory accesses with e.g. Valgrind.
370
# For debugging with Valgrind + GDB, see
371
# http://valgrind.org/docs/manual/manual-core-adv.html#manual-core-adv.gdbserver
372
ALLOCACHE_AS_MALLOC := 0
6418 hendricks2 373
4298 helixhorne 374
 
6147 hendricks2 375
 
376
377
 
378
    RELEASE := 0
6418 hendricks2 379
endif
3725 helixhorne 380
ifneq (100,$(RELEASE)$(PROFILER)$(ALLOCACHE_AS_MALLOC))
6147 hendricks2 381
    # so that we have debug symbols
382
    FORCEDEBUG := 1
6548 terminx 383
endif
6147 hendricks2 384
3725 helixhorne 385
 
6147 hendricks2 386
    override HAVE_GTK2 := 0
6418 hendricks2 387
else ifeq ($(PLATFORM),DARWIN)
6147 hendricks2 388
    HAVE_GTK2 := 0
6418 hendricks2 389
else ifeq ($(PLATFORM),WII)
6147 hendricks2 390
    override USE_OPENGL := 0
6418 hendricks2 391
    override NETCODE := 0
392
    override HAVE_GTK2 := 0
393
    override HAVE_FLAC := 0
394
    SDL_TARGET := 1
395
else ifeq ($(PLATFORM),$(filter $(PLATFORM),DINGOO GCW QNX SUNOS SYLLABLE))
6147 hendricks2 396
    override USE_OPENGL := 0
6418 hendricks2 397
    override NOASM := 1
398
else ifeq ($(PLATFORM),$(filter $(PLATFORM),BEOS SKYOS))
6147 hendricks2 399
    override NOASM := 1
6418 hendricks2 400
endif
6147 hendricks2 401
402
 
403
    override NOASM := 1
6418 hendricks2 404
endif
6147 hendricks2 405
406
 
407
    override POLYMER := 0
6418 hendricks2 408
    override USE_LIBVPX := 0
409
endif
6147 hendricks2 410
411
 
3422 helixhorne 412
    override STRIP :=
6418 hendricks2 413
endif
3422 helixhorne 414
ifneq ($(FORCEDEBUG),0)
6548 terminx 415
    override STRIP :=
6418 hendricks2 416
endif
3422 helixhorne 417
418
 
8301 hendricks2 419
ifeq ($(RELEASE),0)
6147 hendricks2 420
    OPTLEVEL := 0
6418 hendricks2 421
6631 hendricks2 422
 
423
    ifeq (1,$(APPLE_CLANG))
424
      # Apple clang >= 9.0
425
      ifeq (,$(filter 0 1 2 3 4 5 6 7 8,$(APPLE_CLANG_MAJOR)))
426
        OPTLEVEL := g
427
      endif
428
    else ifeq (1,$(CLANG))
429
      # clang >= 4.0
430
      ifeq (,$(filter 0 1 2 3,$(CLANG_MAJOR)))
431
        OPTLEVEL := g
432
      endif
433
    else
434
      # GCC >= 4.8
435
      ifeq (,$(filter 0 1 2 3 4,$(GCC_MAJOR)))
436
        OPTLEVEL := g
437
      else ifeq (4,$(GCC_MAJOR))
438
        ifeq (,$(filter 0 1 2 3 4 5 6 7,$(GCC_MINOR)))
439
          OPTLEVEL := g
440
        endif
441
      endif
442
    endif
443
444
 
6418 hendricks2 445
else
6147 hendricks2 446
    OPTLEVEL := 2
6418 hendricks2 447
    LTO := 1
448
endif
6147 hendricks2 449
450
 
451
    ifeq ($(PLATFORM),WINDOWS)
452
        LTO := 0
6418 hendricks2 453
    endif
6147 hendricks2 454
endif
455
ifneq ($(LUNATIC),0)
3957 helixhorne 456
    # FIXME: Lunatic builds with LTO don't start up properly as the required
457
    # symbol names are apparently not exported.
458
    override LTO := 0
6418 hendricks2 459
endif
3957 helixhorne 460
ifeq (0,$(CLANG))
6147 hendricks2 461
    ifeq (0,$(GCC_PREREQ_4))
462
        override LTO := 0
6418 hendricks2 463
    endif
6147 hendricks2 464
    ifeq (4,$(GCC_MAJOR))
6419 hendricks2 465
        ifeq ($(PLATFORM),WII)
6147 hendricks2 466
            ifneq (,$(filter 0 1 2 3 4 5 6 7,$(GCC_MINOR)))
6419 hendricks2 467
                override LTO := 0
6418 hendricks2 468
            endif
6147 hendricks2 469
        else
470
            ifneq (,$(filter 0 1 2 3 4 5,$(GCC_MINOR)))
6419 hendricks2 471
                override LTO := 0
6418 hendricks2 472
            endif
6147 hendricks2 473
        endif
3122 hendricks2 474
    endif
475
endif
476
477
 
4543 hendricks2 478
 
6147 hendricks2 479
4543 hendricks2 480
 
481
 
6147 hendricks2 482
4543 hendricks2 483
 
6418 hendricks2 484
COMPILERFLAGS := -funsigned-char
485
6147 hendricks2 486
 
6418 hendricks2 487
CXXSTD := -std=gnu++11
488
ifneq (0,$(CLANG))
6110 hendricks2 489
    CSTD := $(subst gnu,c,$(CSTD))
6418 hendricks2 490
    CXXSTD := $(subst gnu,c,$(CXXSTD))
491
endif
6110 hendricks2 492
CONLYFLAGS := $(CSTD)
6418 hendricks2 493
CXXONLYFLAGS := $(CXXSTD) -fno-exceptions -fno-rtti
494
6110 hendricks2 495
 
6418 hendricks2 496
6147 hendricks2 497
 
498
499
 
6418 hendricks2 500
L_CXXONLYFLAGS :=
501
6147 hendricks2 502
 
6418 hendricks2 503
GUI_LIBS :=
504
LIBDIRS :=
505
4543 hendricks2 506
 
3096 hendricks2 507
 
6147 hendricks2 508
5555 hendricks2 509
 
6418 hendricks2 510
# Options to "luajit -b" for synthesis. Since it runs on Linux, we need to tell
6147 hendricks2 511
# the native LuaJIT to emit PE object files.
512
ifeq ($(PLATFORM),WINDOWS)
3278 hendricks2 513
    LINKERFLAGS += -static-libgcc -static
6418 hendricks2 514
    ifeq (0,$(CLANG))
6147 hendricks2 515
        L_CXXONLYFLAGS += -static-libstdc++
516
    endif
3278 hendricks2 517
518
 
6147 hendricks2 519
        GUI_LIBS += -mwindows
520
    endif
3278 hendricks2 521
522
 
6418 hendricks2 523
    ASFORMAT := win$(BITS)
524
    ASFLAGS += -DUNDERSCORES
525
5762 hendricks2 526
 
8496 hendricks2 527
        ifeq ($(FORCEDEBUG),0)
528
            DYNAMICBASE := ,--dynamicbase
529
        endif
530
    endif
531
    LINKERFLAGS += -Wl,--enable-auto-import,--nxcompat$(DYNAMICBASE)
8093 hendricks2 532
    ifneq ($(findstring x86_64,$(COMPILERTARGET)),x86_64)
6147 hendricks2 533
        LINKERFLAGS += -Wl,--large-address-aware
6418 hendricks2 534
    else
8054 terminx 535
        LINKERFLAGS += -Wl,--high-entropy-va
536
    endif
5762 hendricks2 537
3278 hendricks2 538
 
6147 hendricks2 539
    ifeq (32,$(BITS))
540
        LUAJIT_BCOPTS += -a x86
541
    endif
3278 hendricks2 542
    ifeq (64,$(BITS))
6147 hendricks2 543
        LUAJIT_BCOPTS += -a x64
544
    endif
3096 hendricks2 545
else ifeq ($(PLATFORM),DARWIN)
6147 hendricks2 546
    ifneq ($(ARCH),)
5919 hendricks2 547
        ifneq ($(findstring -arch,$(ARCH)),-arch)
548
            override ARCH := -arch $(ARCH)
549
        endif
550
    endif
551
    COMMONFLAGS += $(ARCH)
6147 hendricks2 552
5919 hendricks2 553
 
6147 hendricks2 554
        LINKERFLAGS += -read_only_relocs suppress
555
    endif
3096 hendricks2 556
5983 hendricks2 557
 
6418 hendricks2 558
    ASFORMAT := macho
559
    ASFLAGS += -DUNDERSCORES
560
3096 hendricks2 561
 
6147 hendricks2 562
        ASFORMAT += 64
6418 hendricks2 563
    endif
4555 hendricks2 564
else ifeq ($(PLATFORM),WII)
6147 hendricks2 565
    LIBOGC_INC := $(DEVKITPRO)/libogc/include
6420 hendricks2 566
    LIBOGC_LIB := $(DEVKITPRO)/libogc/lib/wii
567
568
 
569
    LINKERFLAGS += -Wl,--gc-sections
570
    # -msdata=eabiexport
571
    COMPILERFLAGS += -DGEKKO -D__POWERPC__ -I$(LIBOGC_INC)
6418 hendricks2 572
    LIBDIRS += -L$(LIBOGC_LIB)
6147 hendricks2 573
else ifeq ($(PLATFORM),$(filter $(PLATFORM),DINGOO GCW))
574
    COMPILERFLAGS += -D__OPENDINGUX__
575
else ifeq ($(PLATFORM),SKYOS)
576
    COMPILERFLAGS += -DUNDERSCORES
6418 hendricks2 577
else ifeq ($(SUBPLATFORM),LINUX)
8094 hendricks2 578
    # Locate .so files
579
    LINKERFLAGS += -Wl,-rpath,'$$ORIGIN' -Wl,-z,origin
580
endif
4555 hendricks2 581
ASFLAGS += -f $(ASFORMAT)
6147 hendricks2 582
4555 hendricks2 583
 
6418 hendricks2 584
6147 hendricks2 585
 
586
 
587
588
 
3096 hendricks2 589
    ifeq ($(findstring x86_64, $(IMPLICIT_ARCH)),x86_64)
5766 hendricks2 590
        ifeq ($(findstring x86_64h, $(IMPLICIT_ARCH)),x86_64h)
5776 hendricks2 591
            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 592
            # -mcrc32 -mmovbe
5776 hendricks2 593
        else
594
            ifeq ($(PLATFORM),DARWIN)
595
                OPTOPT := -march=core2 -mmmx -msse -msse2 -msse3 -mssse3
6418 hendricks2 596
            else
8401 terminx 597
                OPTOPT := -march=nocona
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
            USE_SSE2 := 0
8452 hendricks2 606
            ifneq (0,$(USE_SSE2))
607
                OPTOPT := -march=pentium-m
608
            else
609
                OPTOPT := -march=pentium3
610
            endif
611
            ifneq (0,$(GCC_PREREQ_4))
6147 hendricks2 612
                OPTOPT += -mtune=generic
613
                # -mstackrealign
614
            endif
615
            OPTOPT += -mmmx -msse -mfpmath=sse
8420 hendricks2 616
            ifneq (0,$(USE_SSE2))
8452 hendricks2 617
                OPTOPT += -msse2
618
            endif
619
        endif
5763 hendricks2 620
    endif
3096 hendricks2 621
    ifeq ($(PLATFORM),WII)
6147 hendricks2 622
        OPTOPT := -mtune=750
6418 hendricks2 623
    endif
6147 hendricks2 624
endif
3096 hendricks2 625
626
 
6147 hendricks2 627
    COMMONFLAGS += -O$(OPTLEVEL) $(OPTOPT)
628
endif
1739 helixhorne 629
6147 hendricks2 630
 
631
    COMPILERFLAGS += -DUSING_LTO
632
    COMMONFLAGS += -flto
633
endif
1739 helixhorne 634
635
 
636
 
6147 hendricks2 637
2685 hendricks2 638
 
6548 terminx 639
    ifeq ($(PACKAGE_REPOSITORY),0)
6147 hendricks2 640
        COMMONFLAGS += -g$(DBGLEVEL)
8301 hendricks2 641
        ifeq (0,$(CLANG))
6147 hendricks2 642
            ifneq ($(PLATFORM),WII)
643
                COMMONFLAGS += -fno-omit-frame-pointer
644
            endif
645
        endif
646
    endif
647
    ifeq ($(SUBPLATFORM),LINUX)
648
        # This option is needed to allow obtaining backtraces from within a program.
649
        LIBS += -rdynamic
6418 hendricks2 650
    endif
6147 hendricks2 651
endif
1933 helixhorne 652
1852 helixhorne 653
 
4298 helixhorne 654
    COMPILERFLAGS += -DDEBUG_ALLOCACHE_AS_MALLOC
4543 hendricks2 655
endif
4298 helixhorne 656
657
 
6549 terminx 658
# and https://gcc.gnu.org/onlinedocs/gcc/Instrumentation-Options.html
659
# for a list of possible ASan and UBsan options.
660
4020 helixhorne 661
 
6549 terminx 662
ASAN_FLAGS := $(ASAN_FLAGS),signed-integer-overflow,unsigned-integer-overflow
663
ASAN_FLAGS := $(ASAN_FLAGS),undefined,return,null,pointer-overflow,float-divide-by-zero
664
#ASAN_FLAGS := $(ASAN_FLAGS) -fsanitize-undefined-trap-on-error
665
666
 
6548 terminx 667
    COMPILERFLAGS += -DNDEBUG
6147 hendricks2 668
else
1739 helixhorne 669
    COMPILERFLAGS += -DDEBUGGINGAIDS=$(FORCEDEBUG)
6548 terminx 670
6549 terminx 671
 
672
        ifneq (0,$(CLANG))
673
            COMMONFLAGS += $(ASAN_FLAGS)
674
        else ifneq (,$(filter 1 2 3 4 5 6,$(GCC_MAJOR)))
675
            ifneq (,$(filter 0 1,$(GCC_MINOR)))
676
                COMMONFLAGS += $(ASAN_FLAGS)
677
            endif
678
        endif
4756 helixhorne 679
    endif
2270 helixhorne 680
endif
6147 hendricks2 681
2270 helixhorne 682
 
6147 hendricks2 683
    COMPILERFLAGS += -DKRANDDEBUG=1
684
endif
685
686
 
687
    ifneq ($(PLATFORM),DARWIN)
688
        LIBS += -lprofiler
6418 hendricks2 689
    endif
1770 plagman 690
    COMMONFLAGS += -pg
6147 hendricks2 691
endif
692
4756 helixhorne 693
 
6147 hendricks2 694
 
695
696
 
697
    F_NO_STACK_PROTECTOR := -fno-stack-protector
698
    ifeq (0,$(CLANG))
699
        F_JUMP_TABLES := -fjump-tables
700
    endif
1850 terminx 701
endif
6147 hendricks2 702
703
 
704
    ifeq (1,$(DARWIN9))
705
        F_JUMP_TABLES :=
706
    endif
1739 helixhorne 707
    ifeq ($(findstring ppc,$(IMPLICIT_ARCH))$(findstring i386,$(IMPLICIT_ARCH)),)
6147 hendricks2 708
        F_NO_STACK_PROTECTOR :=
709
    endif
1739 helixhorne 710
endif
711
712
 
6147 hendricks2 713
    F_NO_STACK_PROTECTOR :=
714
else
715
    ifeq (0,$(CLANG))
716
        COMMONFLAGS += -funswitch-loops
717
    endif
718
719
 
6548 terminx 720
        COMMONFLAGS += -fomit-frame-pointer
6147 hendricks2 721
    endif
722
endif
723
724
 
725
    COMMONFLAGS += -fno-inline -fno-inline-functions -fno-inline-functions-called-once
726
endif
727
728
 
7297 terminx 729
6147 hendricks2 730
 
731
 
732
733
 
734
735
 
736
    ifneq (0,$(DARWIN9))
737
        W_STRICT_OVERFLOW :=
738
    endif
739
endif
740
741
 
5555 hendricks2 742
W_GCC_4_1 := -Wno-attributes
743
W_GCC_4_2 := $(W_STRICT_OVERFLOW)
744
W_GCC_4_4 := -Wno-unused-result
745
W_GCC_4_5 := -Wlogical-op -Wcast-qual
746
W_GCC_6 := -Wduplicated-cond -Wnull-dereference
7671 terminx 747
W_GCC_7 := -Wduplicated-branches
748
W_GCC_8 := -Warray-bounds=2
7743 terminx 749
W_GCC_9 := -Wmultistatement-macros
8276 hendricks2 750
W_CLANG := -Wno-unused-value -Wno-parentheses -Wno-unknown-warning-option
6418 hendricks2 751
1791 helixhorne 752
 
6418 hendricks2 753
    W_CLANG :=
754
2797 helixhorne 755
 
7743 terminx 756
        W_GCC_9 :=
757
        ifneq (,$(filter 4 5 6 7,$(GCC_MAJOR)))
758
            W_GCC_8 :=
759
            ifneq (,$(filter 4 5 6,$(GCC_MAJOR)))
760
                W_GCC_7 :=
761
                ifneq (,$(filter 4 5,$(GCC_MAJOR)))
762
                    W_GCC_6 :=
763
                endif
764
            endif
765
        endif
766
    endif
7671 terminx 767
768
 
6147 hendricks2 769
        W_GCC_9 :=
7743 terminx 770
        W_GCC_8 :=
7671 terminx 771
        W_GCC_7 :=
772
        W_GCC_6 :=
773
        W_GCC_4_5 :=
5555 hendricks2 774
        W_GCC_4_4 :=
775
        ifeq (0,$(OPTLEVEL))
776
            W_UNINITIALIZED :=
777
        endif
778
        W_GCC_4_2 :=
779
        W_GCC_4_1 :=
780
    endif
781
782
 
6419 hendricks2 783
        ifneq (,$(filter 0 1 2 3 4,$(GCC_MINOR)))
784
            W_GCC_4_5 :=
5555 hendricks2 785
            ifneq (,$(filter 0 1 2 3,$(GCC_MINOR)))
6419 hendricks2 786
                W_GCC_4_4 :=
5555 hendricks2 787
                ifeq (0,$(OPTLEVEL))
788
                    W_UNINITIALIZED :=
789
                endif
790
                ifneq (,$(filter 0 1,$(GCC_MINOR)))
6419 hendricks2 791
                    W_GCC_4_2 :=
5555 hendricks2 792
                    ifeq (0,$(GCC_MINOR))
6419 hendricks2 793
                        W_GCC_4_1 :=
5555 hendricks2 794
                    endif
795
                endif
796
            endif
797
        endif
798
    endif
799
endif
2159 helixhorne 800
801
 
6418 hendricks2 802
4543 hendricks2 803
 
6418 hendricks2 804
    -Wextra \
805
    -Wpointer-arith \
806
    -Wno-char-subscripts \
807
    -Wno-missing-braces \
808
    -Wwrite-strings \
809
    $(W_UNINITIALIZED) \
810
    $(W_GCC_4_1) \
811
    $(W_GCC_4_2) \
812
    $(W_GCC_4_4) \
813
    $(W_GCC_4_5) \
814
    $(W_GCC_6) \
7671 terminx 815
    $(W_GCC_7) \
816
    $(W_GCC_8) \
817
    $(W_GCC_9) \
8049 terminx 818
    $(W_CLANG) \
6418 hendricks2 819
    #-Wstrict-prototypes \
820
    #-Waggregate-return \
821
    #-Wcast-align \
822
    #-Waddress
823
824
 
825
 
6147 hendricks2 826
4543 hendricks2 827
 
6147 hendricks2 828
    COMPILERFLAGS += "-DAPPNAME=\"$(APPNAME)\""
8044 hendricks2 829
endif
3260 helixhorne 830
ifneq (,$(APPBASENAME))
6147 hendricks2 831
    COMPILERFLAGS += "-DAPPBASENAME=\"$(APPBASENAME)\""
8044 hendricks2 832
endif
6147 hendricks2 833
3148 helixhorne 834
 
6147 hendricks2 835
    COMPILERFLAGS += -DNOASM
6418 hendricks2 836
endif
4023 helixhorne 837
ifneq (0,$(USE_ASM64))
6147 hendricks2 838
    COMPILERFLAGS += -DUSE_ASM64
6418 hendricks2 839
endif
6147 hendricks2 840
ifneq (0,$(MEMMAP))
841
    ifeq ($(PLATFORM),DARWIN)
842
        LINKERFLAGS += -Wl,-map -Wl,$@.memmap
6418 hendricks2 843
    else
3148 helixhorne 844
        LINKERFLAGS += -Wl,-Map=$@.memmap
6418 hendricks2 845
    endif
3148 helixhorne 846
endif
847
848
 
8216 terminx 849
3148 helixhorne 850
 
6147 hendricks2 851
    COMPILERFLAGS += -DNETCODE_DISABLE
6418 hendricks2 852
endif
3116 hendricks2 853
ifneq (0,$(STARTUP_WINDOW))
5928 terminx 854
    COMPILERFLAGS += -DSTARTUP_WINDOW
6418 hendricks2 855
endif
5928 terminx 856
ifneq (0,$(RETAIL_MENU))
8569 terminx 857
    COMPILERFLAGS += -DEDUKE32_RETAIL_MENU
858
endif
6013 terminx 859
ifneq (0,$(STANDALONE))
6009 terminx 860
    COMPILERFLAGS += -DEDUKE32_STANDALONE
6418 hendricks2 861
endif
6009 terminx 862
ifneq (0,$(USE_OPENGL))
6147 hendricks2 863
    COMPILERFLAGS += -DUSE_OPENGL
6418 hendricks2 864
endif
6051 hendricks2 865
ifneq (0,$(POLYMER))
6147 hendricks2 866
    COMPILERFLAGS += -DPOLYMER
6418 hendricks2 867
endif
6051 hendricks2 868
6008 terminx 869
 
4513 hendricks2 870
 
6147 hendricks2 871
4513 hendricks2 872
 
6147 hendricks2 873
    COMPILERFLAGS += -Iplatform/Windows/include
6418 hendricks2 874
    LIBDIRS += -Lplatform/Windows/lib/$(BITS)
875
else ifeq ($(PLATFORM),DARWIN)
6147 hendricks2 876
    ifneq ($(shell port --version &>/dev/null; echo $$?),127)
4644 hendricks2 877
        LIBDIRS += -L/opt/local/lib
6418 hendricks2 878
        COMPILERFLAGS += -I/opt/local/include
879
    endif
4644 hendricks2 880
    ifneq ($(shell brew --version &>/dev/null; echo $$?),127)
881
        LIBDIRS += -L/usr/local/lib
6418 hendricks2 882
        COMPILERFLAGS += -I/usr/local/include
883
    endif
4644 hendricks2 884
    ifneq ($(shell fink --version &>/dev/null; echo $$?),127)
885
        LIBDIRS += -L/sw/lib
6418 hendricks2 886
        COMPILERFLAGS += -I/sw/include
887
    endif
4644 hendricks2 888
else ifeq ($(PLATFORM),BSD)
6147 hendricks2 889
    COMPILERFLAGS += -I/usr/local/include
6418 hendricks2 890
else ifeq ($(PLATFORM),WII)
6147 hendricks2 891
    COMPILERFLAGS += -I$(PORTLIBS)/include -Iplatform/Wii/include
6418 hendricks2 892
    LIBDIRS += -L$(PORTLIBS)/lib -Lplatform/Wii/lib
6147 hendricks2 893
endif
894
4644 hendricks2 895
 
4543 hendricks2 896
 
6147 hendricks2 897
898
 
899
    ifneq ($(USE_LUAJIT_2_1),0)
900
        COMPILERFLAGS += -DUSE_LUAJIT_2_1
6418 hendricks2 901
    endif
4543 hendricks2 902
903
 
6147 hendricks2 904
        LIBS += -lluajit
6418 hendricks2 905
    else
6147 hendricks2 906
        LIBS += -lluajit-5.1
6418 hendricks2 907
    endif
4543 hendricks2 908
endif
909
910
 
6147 hendricks2 911
    COMPILERFLAGS += -DUSE_LIBVPX
6418 hendricks2 912
    LIBS += -lvpx
913
endif
4543 hendricks2 914
6147 hendricks2 915
 
916
    COMPILERFLAGS += -DHAVE_VORBIS
6418 hendricks2 917
endif
4543 hendricks2 918
ifneq (0,$(HAVE_FLAC))
6147 hendricks2 919
    COMPILERFLAGS += -DHAVE_FLAC
6418 hendricks2 920
endif
4543 hendricks2 921
ifneq (0,$(HAVE_XMP))
6147 hendricks2 922
    COMPILERFLAGS += -DHAVE_XMP
6418 hendricks2 923
endif
4543 hendricks2 924
925
 
6147 hendricks2 926
    ifeq ($(SDL_TARGET),2)
5778 hendricks2 927
        SDLCONFIG := sdl2-config
6418 hendricks2 928
        SDLNAME := SDL2
929
    else ifeq ($(SDL_TARGET),1)
6147 hendricks2 930
        SDLCONFIG := sdl-config
6418 hendricks2 931
        SDLNAME := SDL
932
        ifeq (0,$(RELEASE))
5778 hendricks2 933
            COMPILERFLAGS += -DNOSDLPARACHUTE
934
        endif
935
    endif
936
4543 hendricks2 937
 
7372 terminx 938
        SDLCONFIG :=
939
    endif
940
941
 
6418 hendricks2 942
        SDLCONFIG :=
943
    else ifeq ($(PLATFORM),SKYOS)
944
        COMPILERFLAGS += -I/boot/programs/sdk/include/sdl
945
        SDLCONFIG :=
946
    endif
947
948
 
5778 hendricks2 949
        ifeq ($(strip $(shell $(SDLCONFIG) --version $(DONT_PRINT_STDERR))),)
950
            override SDLCONFIG :=
6418 hendricks2 951
        endif
5778 hendricks2 952
    endif
4543 hendricks2 953
954
 
955
956
 
6418 hendricks2 957
    ifneq ($(SDL_FRAMEWORK),0)
5778 hendricks2 958
        ifeq ($(PLATFORM),DARWIN)
959
            APPLE_FRAMEWORKS := /Library/Frameworks
6418 hendricks2 960
            LIBDIRS += -F$(APPLE_FRAMEWORKS)
5778 hendricks2 961
            COMPILERFLAGS += -I$(APPLE_FRAMEWORKS)/$(SDLNAME).framework/Headers
962
            LIBS += -Wl,-framework,$(SDLNAME) -Wl,-rpath -Wl,"@loader_path/../Frameworks"
963
        endif
4543 hendricks2 964
    else
965
        ifneq ($(SDLCONFIG),)
5778 hendricks2 966
            SDLCONFIG_CFLAGS := $(strip $(subst -Dmain=SDL_main,,$(shell $(SDLCONFIG) --cflags)))
967
            SDLCONFIG_LIBS := $(strip $(subst -mwindows,,$(shell $(SDLCONFIG) --libs)))
968
969
 
6108 hendricks2 970
            LIBS += $(SDLCONFIG_LIBS)
5778 hendricks2 971
        else
972
            ifeq ($(SDL_TARGET),1)
973
                COMPILERFLAGS += -D_GNU_SOURCE=1
974
            endif
4543 hendricks2 975
            COMPILERFLAGS += -D_REENTRANT -DSDL_USEFOLDER
5778 hendricks2 976
            LIBS += -l$(SDLNAME)
6418 hendricks2 977
        endif
4543 hendricks2 978
    endif
979
endif
6147 hendricks2 980
4543 hendricks2 981
 
6147 hendricks2 982
    ifneq (No,$(shell $(PKG_CONFIG) --exists gtk+-2.0 || echo No))
983
        COMPILERFLAGS += -DHAVE_GTK2 $(shell $(PKG_CONFIG) --cflags gtk+-2.0)
984
    else
4543 hendricks2 985
        override HAVE_GTK2 := 0
6418 hendricks2 986
    endif
4543 hendricks2 987
endif
988
989
 
990
 
6147 hendricks2 991
4543 hendricks2 992
 
993
    ifneq (0,$(GCC_PREREQ_4))
6147 hendricks2 994
        L_SSP := -lssp
995
    endif
4543 hendricks2 996
    LIBS += -lmingwex -lgdi32 -lpthread
6418 hendricks2 997
    ifeq ($(RENDERTYPE),WIN)
6147 hendricks2 998
        LIBS += -ldxguid
999
    else ifeq ($(SDL_TARGET),1)
6939 pogokeen 1000
        LIBS += -ldxguid -lmingw32 -limm32 -lole32 -loleaut32 -lversion
1001
    else
4543 hendricks2 1002
        LIBS += -ldxguid_sdl -lmingw32 -limm32 -lole32 -loleaut32 -lversion -lsetupapi
7920 terminx 1003
    endif
4543 hendricks2 1004
    LIBS += -lcomctl32 -lwinmm $(L_SSP) -lwsock32 -lws2_32 -lshlwapi -luuid
8717 terminx 1005
    # -lshfolder
6147 hendricks2 1006
else ifeq ($(PLATFORM),SKYOS)
1007
    LIBS += -lnet
6418 hendricks2 1008
else ifeq ($(PLATFORM),QNX)
6147 hendricks2 1009
    LIBS += -lsocket
6418 hendricks2 1010
else ifeq ($(PLATFORM),SUNOS)
6147 hendricks2 1011
    LIBS += -lsocket -lnsl
6418 hendricks2 1012
else ifeq ($(PLATFORM),WII)
6147 hendricks2 1013
    LIBS += -laesnd_tueidj -lfat -lwiiuse -lbte -lwiikeyboard -logc
6418 hendricks2 1014
else ifeq ($(SUBPLATFORM),LINUX)
6147 hendricks2 1015
    LIBS += -lrt
6418 hendricks2 1016
endif
4543 hendricks2 1017
1018
 
6147 hendricks2 1019
    ifneq ($(PLATFORM),BSD)
1020
        LIBS += -ldl
6418 hendricks2 1021
    endif
4543 hendricks2 1022
    ifneq ($(PLATFORM),DARWIN)
6147 hendricks2 1023
        LIBS += -pthread
6418 hendricks2 1024
    endif
6147 hendricks2 1025
endif
4543 hendricks2 1026
1027
 
6147 hendricks2 1028
4543 hendricks2 1029
 
1030
 
6147 hendricks2 1031
1032
 
6419 hendricks2 1033
-include EDUKE32_REVISION.mak
1034
ifeq (,$(VC_REV))
4565 hendricks2 1035
    VC_REV := $(word 2,$(subst :, ,$(filter Revision:%,$(subst : ,:,$(strip $(shell svn info 2>&1))))))
6419 hendricks2 1036
endif
4565 hendricks2 1037
ifeq (,$(VC_REV))
1038
    GIT_SVN_URL := $(strip $(shell git config --local svn-remote.svn.url))
6419 hendricks2 1039
    GIT_SVN_FETCH := $(strip $(shell git config --local svn-remote.svn.fetch))
1040
    VC_REV := $(word 2,$(subst @, ,$(filter git-svn-id:$(GIT_SVN_URL)@%,$(subst : ,:,$(shell git log -1 $(GIT_SVN_FETCH::%=%))))))
1041
endif
4565 hendricks2 1042
ifneq (,$(VC_REV)$(VC_REV_CUSTOM))
1043
    REVFLAG := -DREV="r$(VC_REV)$(VC_REV_CUSTOM)"
8365 terminx 1044
endif
4565 hendricks2 1045
1046
 
6147 hendricks2 1047
 
6418 hendricks2 1048
1049
 
1050
    COMMONFLAGS += $(CFLAGS)
1051
endif
1052
ifneq (,$(CXXFLAGS))
1053
    CXXONLYFLAGS += $(CXXFLAGS)
1054
endif
1055
ifneq (,$(LDFLAGS))
1056
    LINKERFLAGS += $(LDFLAGS)
1057
endif
1058
1059
 
1060
 
6147 hendricks2 1061
1062
 
6086 hendricks2 1063
COMPILER_CXX=$(CXX) $(CXXONLYFLAGS) $(COMMONFLAGS) $(CWARNS) $(COMPILERFLAGS) $(CUSTOMOPT)
1064
COMPILER_OBJC=$(COBJC) $(CONLYFLAGS) $(COMMONFLAGS) $(CWARNS) $(CONLYWARNS) $(COMPILERFLAGS) $(CUSTOMOPT)
1065
COMPILER_OBJCXX=$(COBJCXX) $(CXXONLYFLAGS) $(COMMONFLAGS) $(CWARNS) $(COMPILERFLAGS) $(CUSTOMOPT)
1066
LINKER=$(L_CXX) $(CXXONLYFLAGS) $(L_CXXONLYFLAGS) $(COMMONFLAGS) $(LINKERFLAGS) $(CUSTOMOPT)
1067
ifneq ($(CPLUSPLUS),0)
4543 hendricks2 1068
    COMPILER_C=$(COMPILER_CXX)
6056 hendricks2 1069
    COMPILER_OBJC=$(COMPILER_OBJCXX)
1070
endif
4543 hendricks2 1071
1072
 
6147 hendricks2 1073
 
1074
1075
 
4543 hendricks2 1076
RECIPE_IF = if
1077
BUILD_STARTED = printf "\033[K\033[1;36mBuilding: \033[0;36m$(MAKE) $(MAKECMDGOALS) -$(MAKEFLAGS)\033[0m\n"
6148 hendricks2 1078
COMPILE_STATUS = printf "\033[K\033[0mBuilding object \033[1m$@\033[0m...\033[0m\r"
4543 hendricks2 1079
COMPILE_OK = printf "\033[K\033[0;32mBuilt object \033[1;32m$@\033[0;32m \033[0m\n"
1080
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
1081
RECIPE_RESULT_COMPILE = ; then $(COMPILE_OK); else $(COMPILE_FAILED); fi
1082
ONESTEP_STATUS = printf "\033[K\033[0mBuilding \033[1m$@\033[0m...\033[0m\r"
5279 terminx 1083
ONESTEP_OK = printf "\033[K\033[0;32mBuilt \033[1;32m$@\033[0;32m \033[0m\n"
1084
ONESTEP_FAILED = printf "\033[K\033[0;31mFailed building \033[1;31m$@\033[0;31m!\033[0m\n"; exit 1
1085
RECIPE_RESULT_ONESTEP = ; then $(ONESTEP_OK); else $(ONESTEP_FAILED); fi
4543 hendricks2 1086
ARCHIVE_STATUS = printf "\033[K\033[0mCreating library archive \033[1m$@\033[0m...\033[0m\r"
1087
ARCHIVE_OK = printf "\033[K\033[0;32mCreated library archive \033[1;32m$@\033[0;32m \033[0m\n"
1088
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
1089
RECIPE_RESULT_ARCHIVE = ; then $(ARCHIVE_OK); else $(ARCHIVE_FAILED); fi
1090
LINK_STATUS = printf "\033[K\033[0;0mLinking \033[1m$@\033[0;0m...\033[0m\r"
5279 terminx 1091
LINK_OK = printf "\033[K\033[0;32mLinked \033[1;32m$@\033[0;32m \033[0m\n"
1092
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 1093
RECIPE_RESULT_LINK = ; then $(LINK_OK); else $(LINK_FAILED); fi
4543 hendricks2 1094
else
1095
RECIPE_IF =
1096
BUILD_STARTED =
1097
COMPILE_STATUS =
1098
COMPILE_OK = true
1099
COMPILE_FAILED = false; exit 1
1100
RECIPE_RESULT_COMPILE =
1101
ONESTEP_STATUS =
1102
ONESTEP_OK = true
1103
ONESTEP_FAILED = false; exit 1
1104
RECIPE_RESULT_ONESTEP =
1105
ARCHIVE_STATUS =
1106
ARCHIVE_OK = true
1107
ARCHIVE_FAILED = false; exit 1
1108
RECIPE_RESULT_ARCHIVE =
1109
LINK_STATUS =
1110
LINK_OK = true
1111
LINK_FAILED = false; exit 1
1112
RECIPE_RESULT_LINK =
1113
endif
1114