@@ -35,7 +35,9 @@ DPF_MAKEFILE_BASE_INCLUDED = true
35
35
# ---------------------------------------------------------------------------------------------------------------------
36
36
# Auto-detect target compiler if not defined
37
37
38
- ifeq ($(shell echo '\#test' | grep -- '\#test') ,\# test)
38
+ ifneq ($(shell echo -e escaped-by-default | grep -- '-e escaped-by-default') ,-e escaped-by-default)
39
+ TARGET_COMPILER = $(shell echo -e '#ifdef __clang__\nclang\n#else\ngcc\n#endif' | $(CC ) -E -P -x c - 2>/dev/null)
40
+ else ifeq ($(shell echo '\#escaped-by-default' | grep -- '\#escaped-by-default'),\#escaped-by-default)
39
41
TARGET_COMPILER = $(shell echo '\#ifdef __clang__\nclang\n\#else\ngcc\n\#endif' | $(CC ) -E -P -x c - 2>/dev/null)
40
42
else
41
43
TARGET_COMPILER = $(shell echo '#ifdef __clang__\nclang\n#else\ngcc\n#endif' | $(CC ) -E -P -x c - 2>/dev/null)
@@ -272,7 +274,10 @@ BASE_OPTS = -O2 -ffast-math -fdata-sections -ffunction-sections
272
274
endif
273
275
274
276
ifeq ($(DEBUG ) ,true)
275
- BASE_FLAGS += -DDEBUG -O0 -g -fsanitize=address
277
+ BASE_FLAGS += -DDEBUG -O0 -g
278
+ ifneq ($(HAIKU ) ,true)
279
+ BASE_FLAGS += -fsanitize=address
280
+ endif
276
281
LINK_OPTS =
277
282
ifeq ($(WASM ) ,true)
278
283
LINK_OPTS += -sASSERTIONS=1
@@ -347,9 +352,11 @@ endif
347
352
# ---------------------------------------------------------------------------------------------------------------------
348
353
# Check for required libraries
349
354
350
- HAVE_CAIRO = $(shell $(PKG_CONFIG ) --exists cairo && echo true)
355
+ ifneq ($(HAIKU ) ,true)
356
+ HAVE_CAIRO = $(shell $(PKG_CONFIG ) --exists cairo && echo true)
357
+ endif
351
358
352
- ifeq ($(MACOS_OR_WASM_OR_WINDOWS ) ,true)
359
+ ifeq ($(HAIKU_OR_MACOS_OR_WASM_OR_WINDOWS ) ,true)
353
360
HAVE_OPENGL = true
354
361
else
355
362
HAVE_OPENGL = $(shell $(PKG_CONFIG ) --exists gl && echo true)
@@ -402,18 +409,34 @@ endif
402
409
# Set Generic DGL stuff
403
410
404
411
ifeq ($(HAIKU ) ,true)
412
+
405
413
DGL_SYSTEM_LIBS += -lbe
414
+
406
415
else ifeq ($(MACOS),true)
407
- DGL_SYSTEM_LIBS += -framework Cocoa -framework CoreVideo
416
+
417
+ DGL_SYSTEM_LIBS += -framework Cocoa
418
+ DGL_SYSTEM_LIBS += -framework CoreVideo
419
+
408
420
else ifeq ($(WASM),true)
421
+
422
+ # wasm builds cannot work using regular desktop OpenGL
423
+ ifeq (,$(USE_GLES2 )$(USE_GLES3 ) )
424
+ USE_GLES2 = true
425
+ endif
426
+
409
427
else ifeq ($(WINDOWS),true)
410
- DGL_SYSTEM_LIBS += -lgdi32 -lcomdlg32
411
- # -lole32
428
+
429
+ DGL_SYSTEM_LIBS += -lcomdlg32
430
+ DGL_SYSTEM_LIBS += -lgdi32
431
+ # DGL_SYSTEM_LIBS += -lole32
432
+
412
433
else
434
+
413
435
ifeq ($(HAVE_DBUS ) ,true)
414
436
DGL_FLAGS += $(shell $(PKG_CONFIG ) --cflags dbus-1) -DHAVE_DBUS
415
437
DGL_SYSTEM_LIBS += $(shell $(PKG_CONFIG ) --libs dbus-1)
416
438
endif
439
+
417
440
ifeq ($(HAVE_X11 ) ,true)
418
441
DGL_FLAGS += $(shell $(PKG_CONFIG ) --cflags x11) -DHAVE_X11
419
442
DGL_SYSTEM_LIBS += $(shell $(PKG_CONFIG ) --libs x11)
@@ -429,7 +452,8 @@ ifeq ($(HAVE_XRANDR),true)
429
452
DGL_FLAGS += $(shell $(PKG_CONFIG ) --cflags xrandr) -DHAVE_XRANDR
430
453
DGL_SYSTEM_LIBS += $(shell $(PKG_CONFIG ) --libs xrandr)
431
454
endif
432
- endif
455
+ endif # HAVE_X11
456
+
433
457
endif
434
458
435
459
# ---------------------------------------------------------------------------------------------------------------------
@@ -444,7 +468,7 @@ CAIRO_LIBS = $(shell $(PKG_CONFIG) --libs cairo)
444
468
445
469
HAVE_CAIRO_OR_OPENGL = true
446
470
447
- endif
471
+ endif # HAVE_CAIRO
448
472
449
473
# ---------------------------------------------------------------------------------------------------------------------
450
474
# Set OpenGL specific stuff
@@ -454,8 +478,8 @@ ifeq ($(HAVE_OPENGL),true)
454
478
DGL_FLAGS += -DHAVE_OPENGL
455
479
456
480
ifeq ($(HAIKU ) ,true)
457
- OPENGL_FLAGS = $( shell $( PKG_CONFIG ) --cflags gl)
458
- OPENGL_LIBS = $( shell $( PKG_CONFIG ) --libs gl)
481
+ OPENGL_FLAGS =
482
+ OPENGL_LIBS = -lGL
459
483
else ifeq ($(MACOS),true)
460
484
OPENGL_FLAGS = -DGL_SILENCE_DEPRECATION=1 -Wno-deprecated-declarations
461
485
OPENGL_LIBS = -framework OpenGL
@@ -476,12 +500,12 @@ endif
476
500
477
501
HAVE_CAIRO_OR_OPENGL = true
478
502
479
- endif
503
+ endif # HAVE_OPENGL
480
504
481
505
# ---------------------------------------------------------------------------------------------------------------------
482
506
# Set Stub specific stuff
483
507
484
- ifeq ($(MACOS_OR_WASM_OR_WINDOWS ) ,true)
508
+ ifeq ($(HAIKU_OR_MACOS_OR_WASM_OR_WINDOWS ) ,true)
485
509
HAVE_STUB = true
486
510
else
487
511
HAVE_STUB = $(HAVE_X11 )
@@ -540,7 +564,7 @@ endif
540
564
# ---------------------------------------------------------------------------------------------------------------------
541
565
# Backwards-compatible HAVE_DGL
542
566
543
- ifeq ($(MACOS_OR_WASM_OR_WINDOWS ) ,true)
567
+ ifeq ($(HAIKU_OR_MACOS_OR_WASM_OR_WINDOWS ) ,true)
544
568
HAVE_DGL = true
545
569
else ifeq ($(HAVE_OPENGL),true)
546
570
HAVE_DGL = $(HAVE_X11 )
@@ -633,6 +657,41 @@ else
633
657
SHARED = -shared
634
658
endif
635
659
660
+ # ---------------------------------------------------------------------------------------------------------------------
661
+ # Set CLAP binary directory
662
+
663
+ ifeq ($(MACOS ) ,true)
664
+ CLAP_BINARY_DIR = Contents/MacOS
665
+ else
666
+ CLAP_BINARY_DIR =
667
+ endif
668
+
669
+ # ---------------------------------------------------------------------------------------------------------------------
670
+ # Set VST2 binary directory
671
+
672
+ ifeq ($(MACOS ) ,true)
673
+ VST2_BINARY_DIR = Contents/MacOS
674
+ else
675
+ VST2_BINARY_DIR =
676
+ endif
677
+
678
+ # ---------------------------------------------------------------------------------------------------------------------
679
+ # Set VST3 binary directory, see https://vst3sdk-doc.diatonic.jp/doc/vstinterfaces/vst3loc.html
680
+
681
+ ifeq ($(LINUX ) ,true)
682
+ VST3_BINARY_DIR = Contents/$(TARGET_PROCESSOR ) -linux
683
+ else ifeq ($(MACOS),true)
684
+ VST3_BINARY_DIR = Contents/MacOS
685
+ else ifeq ($(WASM),true)
686
+ VST3_BINARY_DIR = Contents/wasm
687
+ else ifeq ($(WINDOWS)$(CPU_I386),truetrue)
688
+ VST3_BINARY_DIR = Contents/x86-win
689
+ else ifeq ($(WINDOWS)$(CPU_X86_64),truetrue)
690
+ VST3_BINARY_DIR = Contents/x86_64-win
691
+ else
692
+ VST3_BINARY_DIR =
693
+ endif
694
+
636
695
# ---------------------------------------------------------------------------------------------------------------------
637
696
# Handle the verbosity switch
638
697
@@ -713,6 +772,7 @@ MOD_ENVIRONMENT = \
713
772
CXX=${1}/host/usr/bin/${2}-g++ \
714
773
LD=${1}/host/usr/bin/${2}-ld \
715
774
PKG_CONFIG=${1}/host/usr/bin/pkg-config \
775
+ PKG_CONFIG_PATH="${1}/staging/usr/lib/pkgconfig" \
716
776
STRIP=${1}/host/usr/bin/${2}-strip \
717
777
CFLAGS="-I${1}/staging/usr/include $(EXTRA_MOD_FLAGS ) " \
718
778
CPPFLAGS= \
@@ -738,12 +798,12 @@ modpush:
738
798
739
799
ifneq (,$(findstring modduo-,$(MAKECMDGOALS ) ) )
740
800
$(MAKECMDGOALS ) :
741
- $(MAKE ) $(call MOD_ENVIRONMENT,$(MOD_WORKDIR ) /modduo,arm-mod-linux-gnueabihf,arm) $(subst modduo-,,$(MAKECMDGOALS ) )
801
+ $(MAKE ) $(call MOD_ENVIRONMENT,$(MOD_WORKDIR ) /modduo-static ,arm-mod-linux-gnueabihf.static ,arm) $(subst modduo-,,$(MAKECMDGOALS ) )
742
802
endif
743
803
744
804
ifneq (,$(findstring modduox-,$(MAKECMDGOALS ) ) )
745
805
$(MAKECMDGOALS ) :
746
- $(MAKE ) $(call MOD_ENVIRONMENT,$(MOD_WORKDIR ) /modduox,aarch64-mod-linux-gnueabi,aarch64) $(subst modduox-,,$(MAKECMDGOALS ) )
806
+ $(MAKE ) $(call MOD_ENVIRONMENT,$(MOD_WORKDIR ) /modduox-static ,aarch64-mod-linux-gnueabi.static ,aarch64) $(subst modduox-,,$(MAKECMDGOALS ) )
747
807
endif
748
808
749
809
ifneq (,$(findstring moddwarf-,$(MAKECMDGOALS ) ) )
0 commit comments