forked from libretro/RetroArch
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.common
1175 lines (994 loc) · 29.8 KB
/
Makefile.common
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
ROOT_DIR := .
DEPS_DIR := $(ROOT_DIR)/deps
LIBRETRO_COMM_DIR := $(ROOT_DIR)/libretro-common
ifeq ($(HAVE_GL_CONTEXT),)
HAVE_GL_CONTEXT=0
ifeq ($(HAVE_OPENGL), 1)
HAVE_GL_CONTEXT=1
endif
ifeq ($(HAVE_OPENGLES), 1)
HAVE_GL_CONTEXT=1
endif
ifeq ($(HAVE_OPENGLES3), 1)
HAVE_GL_CONTEXT=1
endif
endif
ifeq ($(HAVE_LIBRETRODB),)
HAVE_LIBRETRODB = 1
endif
ifeq ($(HAVE_VIDEO_PROCESSOR), 1)
DEFINES += -DHAVE_VIDEO_PROCESSOR
endif
ifeq ($(HAVE_HID), 1)
DEFINES += -DHAVE_HID
endif
ifeq ($(HAVE_LIBRETRODB), 1)
DEFINES += -DHAVE_LIBRETRODB
endif
ifeq ($(HAVE_FBO), 1)
DEFINES += -DHAVE_FBO
endif
ifeq ($(HAVE_DYLIB), 1)
DEFINES += -DHAVE_DYLIB
endif
ifeq ($(SCALER_NO_SIMD), 1)
DEFINES += -DSCALER_NO_SIMD
endif
ifeq ($(HAVE_PRESERVE_DYLIB),1)
DEFINES += -DNO_DLCLOSE
endif
ifeq ($(GL_DEBUG), 1)
CFLAGS += -DGL_DEBUG
CXXFLAGS += -DGL_DEBUG
endif
ifeq ($(VULKAN_DEBUG), 1)
CFLAGS += -DVULKAN_DEBUG
CXXFLAGS += -DVULKAN_DEBUG
endif
ifeq ($(HAVE_HARD_FLOAT), 1)
DEFINES += -mfloat-abi=hard
endif
ifeq ($(TDM_GCC),)
LDCXXFLAGS += -static-libstdc++
endif
ifeq ($(HAVE_FILE_LOGGER), 1)
CFLAGS += -DHAVE_FILE_LOGGER
endif
ifeq ($(HAVE_SHADERPIPELINE), 1)
CFLAGS += -DHAVE_SHADERPIPELINE
endif
CFLAGS += -I$(LIBRETRO_COMM_DIR)/include
# Switches
# System
ifneq ($(findstring BSD,$(OS)),)
BSD_LOCAL_INC += -I/usr/local/include
OBJ += frontend/drivers/platform_bsd.o
endif
ifneq ($(findstring Darwin,$(OS)),)
OSX := 1
LIBS += -framework AppKit
else
OSX := 0
endif
ifneq ($(findstring Linux,$(OS)),)
LIBS += -lrt
OBJ += input/drivers/linuxraw_input.o \
input/common/linux_common.o \
input/common/epoll_common.o \
input/drivers_joypad/linuxraw_joypad.o \
frontend/drivers/platform_linux.o
endif
ifeq ($(findstring Haiku,$(OS)),)
LIBS += -lm
DEBUG_FLAG = -g
else
LIBS += -lroot -lnetwork
# stable and nightly haiku builds are stuck on gdb 6.x but we use gcc4
DEBUG_FLAG = -gdwarf-2
endif
# Git
GIT_VERSION := $(shell git rev-parse --short HEAD 2>/dev/null)
ifneq ($(GIT_VERSION),)
DEFINES += -DHAVE_GIT_VERSION -DGIT_VERSION=$(GIT_VERSION)
OBJ += version_git.o
endif
# General object files
OBJ += frontend/frontend.o \
frontend/frontend_driver.o \
frontend/drivers/platform_null.o \
ui/ui_companion_driver.o \
ui/drivers/ui_null.o \
ui/drivers/null/ui_null_window.o \
ui/drivers/null/ui_null_browser_window.o \
ui/drivers/null/ui_null_msg_window.o \
ui/drivers/null/ui_null_application.o \
core_impl.o \
retroarch.o \
dirs.o \
paths.o \
input/input_keyboard.o \
command.o \
msg_hash.o \
intl/msg_hash_us.o \
runloop.o \
$(LIBRETRO_COMM_DIR)/algorithms/mismatch.o \
$(LIBRETRO_COMM_DIR)/queues/task_queue.o \
tasks/task_content.o \
tasks/task_save.o \
tasks/task_file_transfer.o \
tasks/task_image.o \
$(LIBRETRO_COMM_DIR)/encodings/encoding_utf.o \
$(LIBRETRO_COMM_DIR)/encodings/encoding_crc32.o \
$(LIBRETRO_COMM_DIR)/lists/file_list.o \
$(LIBRETRO_COMM_DIR)/lists/dir_list.o \
$(LIBRETRO_COMM_DIR)/file/retro_dirent.o \
$(LIBRETRO_COMM_DIR)/streams/file_stream.o \
$(LIBRETRO_COMM_DIR)/streams/interface_stream.o \
$(LIBRETRO_COMM_DIR)/streams/memory_stream.o \
$(LIBRETRO_COMM_DIR)/file/retro_stat.o \
$(LIBRETRO_COMM_DIR)/lists/string_list.o \
$(LIBRETRO_COMM_DIR)/string/stdstring.o \
$(LIBRETRO_COMM_DIR)/memmap/memalign.o \
setting_list.o \
list_special.o \
$(LIBRETRO_COMM_DIR)/file/nbio/nbio_stdio.o \
$(LIBRETRO_COMM_DIR)/file/file_path.o \
file_path_special.o \
file_path_str.o \
$(LIBRETRO_COMM_DIR)/hash/rhash.o \
audio/audio_driver.o \
input/input_driver.o \
gfx/video_coord_array.o \
gfx/video_driver.o \
camera/camera_driver.o \
wifi/wifi_driver.o \
location/location_driver.o \
driver.o \
configuration.o \
$(LIBRETRO_COMM_DIR)/dynamic/dylib.o \
dynamic.o \
cores/dynamic_dummy.o \
$(LIBRETRO_COMM_DIR)/queues/message_queue.o \
managers/state_manager.o \
gfx/drivers_font_renderer/bitmapfont.o \
input/input_autodetect.o \
input/input_autodetect_builtin.o \
input/input_joypad_driver.o \
input/input_config.o \
input/input_keymaps.o \
input/input_remapping.o \
tasks/task_overlay.o \
input/input_overlay.o \
patch.o \
$(LIBRETRO_COMM_DIR)/queues/fifo_queue.o \
managers/core_option_manager.o \
$(LIBRETRO_COMM_DIR)/compat/compat_fnmatch.o \
$(LIBRETRO_COMM_DIR)/compat/compat_posix_string.o \
managers/cheat_manager.o \
core_info.o \
$(LIBRETRO_COMM_DIR)/file/config_file.o \
config_file_userdata.o \
tasks/task_screenshot.o \
$(LIBRETRO_COMM_DIR)/gfx/scaler/scaler.o \
gfx/drivers_shader/shader_null.o \
gfx/video_shader_driver.o \
gfx/video_shader_parse.o \
$(LIBRETRO_COMM_DIR)/gfx/scaler/pixconv.o \
$(LIBRETRO_COMM_DIR)/gfx/scaler/scaler_int.o \
$(LIBRETRO_COMM_DIR)/gfx/scaler/scaler_filter.o \
gfx/font_driver.o \
gfx/video_filter.o \
gfx/video_frame.o \
audio/audio_resampler_driver.o \
audio/audio_dsp_filter.o \
audio/drivers_resampler/sinc_resampler.o \
audio/drivers_resampler/nearest_resampler.o \
audio/drivers_resampler/null_resampler.o \
audio/drivers_resampler/cc_resampler.o \
location/drivers/nulllocation.o \
camera/drivers/nullcamera.o \
wifi/drivers/nullwifi.o \
gfx/drivers/nullgfx.o \
audio/drivers/nullaudio.o \
input/drivers/nullinput.o \
input/drivers_hid/null_hid.o \
input/drivers_joypad/null_joypad.o \
playlist.o \
movie.o \
record/record_driver.o \
record/drivers/record_null.o \
$(LIBRETRO_COMM_DIR)/features/features_cpu.o \
performance_counters.o \
verbosity.o
ifeq ($(HAVE_LANGEXTRA), 1)
DEFINES += -DHAVE_LANGEXTRA
DEFINES += -finput-charset=UTF-8
OBJ += intl/msg_hash_de.o \
intl/msg_hash_eo.o \
intl/msg_hash_es.o \
intl/msg_hash_fr.o \
intl/msg_hash_it.o \
intl/msg_hash_jp.o \
intl/msg_hash_nl.o \
intl/msg_hash_pl.o \
intl/msg_hash_pt.o \
intl/msg_hash_ru.o \
intl/msg_hash_vn.o \
intl/msg_hash_chs.o
endif
ifneq ($(HAVE_GETOPT_LONG), 1)
OBJ += $(LIBRETRO_COMM_DIR)/compat/compat_getopt.o
endif
ifneq ($(HAVE_STRCASESTR), 1)
OBJ += $(LIBRETRO_COMM_DIR)/compat/compat_strcasestr.o
endif
ifneq ($(HAVE_STRL), 1)
OBJ += $(LIBRETRO_COMM_DIR)/compat/compat_strl.o
endif
OBJ += $(LIBRETRO_COMM_DIR)/formats/image_texture.o
ifeq ($(HAVE_IMAGEVIEWER), 1)
DEFINES += -DHAVE_IMAGEVIEWER
OBJ += cores/libretro-imageviewer/image_core.o
endif
# Qt
ifeq ($(HAVE_QT), 1)
HAVE_QT_WRAPPER=0
OBJ += ui/drivers/ui_qt.o \
ui/drivers/qt/ui_qt_application.o \
ui/drivers/qt/ui_qt_window.o \
ui/drivers/qt/ui_qt_browser_window.o \
ui/drivers/qt/ui_qt_msg_window.o
ifneq ($(findstring Linux,$(OS)),)
DEFINES += -I/usr/include/qt -fPIC
endif
# TODO/FIXME - figure out which libraries we need to link against
LIBS += -lQt5Quick -lQt5Widgets -lQt5Gui -lQt5Qml -lQt5Network -lQt5Core -L./ui/drivers/qt/wrapper/build/release
ifeq ($(HAVE_QT_WRAPPER), 1)
LIBS += -lwrapper
endif
endif
ifeq ($(HAVE_SSA),1)
LIBS += -lass
endif
# LibretroDB
ifeq ($(HAVE_LIBRETRODB), 1)
OBJ += libretro-db/bintree.o \
libretro-db/libretrodb.o \
libretro-db/query.o \
libretro-db/rmsgpack.o \
libretro-db/rmsgpack_dom.o \
database_info.o \
tasks/task_database.o \
tasks/task_database_cue.o
endif
# Miscellaneous
ifeq ($(HAVE_STDIN_CMD), 1)
DEFINES += -DHAVE_COMMAND -DHAVE_STDIN_CMD
endif
ifeq ($(HAVE_PYTHON), 1)
DEFINES += $(PYTHON_CFLAGS) -Wno-unused-parameter
LIBS += $(PYTHON_LIBS)
OBJ += gfx/drivers_tracker/video_state_python.o
endif
ifeq ($(HAVE_EMSCRIPTEN), 1)
OBJ += frontend/drivers/platform_emscripten.o \
input/drivers/rwebinput_input.o \
audio/drivers/rwebaudio.o \
camera/drivers/rwebcam.o
endif
ifeq ($(HAVE_LAKKA), 1)
OBJ += wifi/drivers/connmanctl.o
endif
# Audio
#
ifeq ($(HAVE_COREAUDIO), 1)
OBJ += audio/drivers/coreaudio.o
LIBS += -framework CoreServices -framework CoreAudio -framework AudioUnit
endif
ifeq ($(HAVE_CORETEXT), 1)
OBJ += gfx/drivers_font_renderer/coretext.o
endif
ifeq ($(HAVE_OSS), 1)
OBJ += audio/drivers/oss.o
endif
ifeq ($(HAVE_OSS_BSD), 1)
OBJ += audio/drivers/oss.o
endif
ifeq ($(HAVE_ALSA), 1)
OBJ += audio/drivers/alsa.o
ifeq ($(HAVE_THREADS), 1)
OBJ += audio/drivers/alsathread.o
endif
LIBS += $(ALSA_LIBS)
DEFINES += $(ALSA_CFLAGS)
endif
ifeq ($(HAVE_ROAR), 1)
OBJ += audio/drivers/roar.o
LIBS += $(ROAR_LIBS)
DEFINES += $(ROAR_CFLAGS)
endif
ifeq ($(HAVE_AL), 1)
OBJ += audio/drivers/openal.o
ifeq ($(OSX),1)
LIBS += -framework OpenAL
else
LIBS += -lopenal
endif
endif
ifneq ($(findstring Darwin,$(OS)),)
OBJ += frontend/drivers/platform_darwin.o
endif
ifeq ($(HAVE_JACK),1)
OBJ += audio/drivers/jack.o
LIBS += $(JACK_LIBS)
DEFINES += $(JACK_CFLAGS)
endif
ifeq ($(HAVE_PULSE), 1)
OBJ += audio/drivers/pulse.o
LIBS += $(PULSE_LIBS)
DEFINES += $(PULSE_CFLAGS)
endif
ifeq ($(HAVE_OSS_LIB), 1)
LIBS += -lossaudio
endif
ifeq ($(HAVE_RSOUND), 1)
OBJ += audio/drivers/rsound.o
DEFINES += $(RSOUND_CFLAGS)
LIBS += $(RSOUND_LIBS)
endif
ifeq ($(HAVE_DSOUND), 1)
HAVE_DIRECTX=1
OBJ += audio/drivers/dsound.o
DEFINES += -DHAVE_DSOUND
LIBS += -ldxguid -ldsound
endif
ifeq ($(HAVE_XAUDIO), 1)
OBJ += audio/drivers/xaudio.o
DEFINES += -DHAVE_XAUDIO
LIBS += -lole32
endif
# Audio Resamplers
ifeq ($(HAVE_NEON),1)
OBJ += audio/drivers_resampler/sinc_resampler_neon.o \
audio/drivers_resampler/cc_resampler_neon.o
# When compiled without this, tries to attempt to compile sinc lerp,
# which will error out
#
# TODO - we need to make quality levels of sinc
# runtime toggleable instead of going by compile-time
# defines
DEFINES += -DSINC_LOWER_QUALITY
endif
OBJ += $(LIBRETRO_COMM_DIR)/conversion/s16_to_float.o \
$(LIBRETRO_COMM_DIR)/conversion/float_to_s16.o
ifeq ($(HAVE_NEON),1)
OBJ += $(LIBRETRO_COMM_DIR)/conversion/s16_to_float_neon.o \
$(LIBRETRO_COMM_DIR)/conversion/float_to_s16_neon.o
endif
ifneq ($(findstring Win32,$(OS)),)
HAVE_VULKAN=1
DEFINES += -DHAVE_VULKAN
endif
HW_CONTEXT_MENU_DRIVERS=$(HAVE_RGUI)
ifeq ($(HW_CONTEXT_MENU_DRIVERS),0)
ifeq ($(HAVE_GL_CONTEXT),1)
HW_CONTEXT_MENU_DRIVERS=1
endif
ifeq ($(HAVE_VULKAN),1)
HW_CONTEXT_MENU_DRIVERS=1
endif
endif
# XMB and MaterialUI are always enabled if supported and not explicitly disabled
ifeq ($(HW_CONTEXT_MENU_DRIVERS), 1)
ifeq ($(HAVE_ZARCH),)
HAVE_ZARCH = 1
endif
ifeq ($(HAVE_MATERIALUI),)
HAVE_MATERIALUI = 1
endif
#ifeq ($(HAVE_NUKLEAR),)
#HAVE_NUKLEAR = 1
#endif
ifeq ($(HAVE_XMB),)
HAVE_XMB = 1
endif
else
HAVE_ZARCH = 0
HAVE_MATERIALUI = 0
#HAVE_NUKLEAR = 0
HAVE_XMB = 0
endif
ifeq ($(HAVE_RGUI), 1)
OBJ += menu/drivers/rgui.o
DEFINES += -DHAVE_MENU -DHAVE_RGUI
HAVE_MENU_COMMON = 1
ifeq ($(HAVE_MATERIALUI), 1)
OBJ += menu/drivers/materialui.o
DEFINES += -DHAVE_MATERIALUI
endif
ifeq ($(HAVE_NUKLEAR), 1)
OBJ += menu/drivers/nuklear/nk_common.o
OBJ += menu/drivers/nuklear/nk_menu.o
OBJ += menu/drivers/nuklear/nk_wnd_main.o
OBJ += menu/drivers/nuklear/nk_wnd_file_picker.o
OBJ += menu/drivers/nuklear/nk_wnd_shader_parameters.o
OBJ += menu/drivers/nuklear/nk_wnd_settings.o
OBJ += menu/drivers/nuklear.o
DEFINES += -DHAVE_NUKLEAR
endif
ifeq ($(HAVE_ZARCH), 1)
OBJ += menu/drivers/zarch.o
DEFINES += -DHAVE_ZARCH
endif
ifeq ($(HAVE_XMB), 1)
OBJ += menu/drivers/xmb.o
DEFINES += -DHAVE_XMB
endif
endif
ifeq ($(HAVE_LAKKA), 1)
DEFINES += -DHAVE_LAKKA
DEFINES += -DLAKKA_PROJECT=$(LAKKA_PROJECT)
endif
ifeq ($(HAVE_MENU_COMMON), 1)
OBJ += menu/menu_driver.o \
menu/menu_content.o \
menu/menu_input.o \
menu/menu_event.o \
menu/menu_entries.o \
menu/menu_navigation.o \
menu/menu_setting.o \
menu/menu_shader.o \
menu/widgets/menu_dialog.o \
menu/widgets/menu_input_dialog.o \
menu/widgets/menu_input_bind_dialog.o \
menu/widgets/menu_entry.o \
menu/widgets/menu_list.o \
menu/menu_cbs.o \
menu/cbs/menu_cbs_ok.o \
menu/cbs/menu_cbs_cancel.o \
menu/cbs/menu_cbs_select.o \
menu/cbs/menu_cbs_start.o \
menu/cbs/menu_cbs_info.o \
menu/cbs/menu_cbs_refresh.o \
menu/cbs/menu_cbs_left.o \
menu/cbs/menu_cbs_right.o \
menu/cbs/menu_cbs_deferred_push.o \
menu/cbs/menu_cbs_scan.o \
menu/cbs/menu_cbs_get_value.o \
menu/cbs/menu_cbs_label.o \
menu/cbs/menu_cbs_sublabel.o \
menu/cbs/menu_cbs_title.o \
menu/cbs/menu_cbs_up.o \
menu/cbs/menu_cbs_down.o \
menu/cbs/menu_cbs_contentlist_switch.o \
menu/menu_display.o \
menu/menu_displaylist.o \
menu/menu_animation.o \
menu/drivers_display/menu_display_null.o \
menu/drivers/menu_generic.o \
menu/drivers/null.o
endif
ifeq ($(HAVE_STB_FONT), 1)
OBJ += gfx/drivers_font_renderer/stb.o
endif
ifeq ($(HAVE_FREETYPE), 1)
OBJ += gfx/drivers_font_renderer/freetype.o
LIBS += $(FREETYPE_LIBS)
DEFINES += $(FREETYPE_CFLAGS)
endif
ifeq ($(HAVE_THREADS), 1)
OBJ += $(LIBRETRO_COMM_DIR)/rthreads/rthreads.o \
$(LIBRETRO_COMM_DIR)/rthreads/rsemaphore.o \
gfx/video_thread_wrapper.o \
audio/audio_thread_wrapper.o
DEFINES += -DHAVE_THREADS
ifeq ($(findstring Haiku,$(OS)),)
LIBS += -lpthread
endif
endif
ifeq ($(HAVE_THREAD_STORAGE), 1)
DEFINES += -DHAVE_THREAD_STORAGE
endif
ifeq ($(HAVE_WAYLAND), 1)
OBJ += gfx/drivers_context/wayland_ctx.o
DEFINES += $(WAYLAND_CFLAGS)
LIBS += $(WAYLAND_LIBS)
endif
#Input
ifeq ($(HAVE_DINPUT), 1)
LIBS += -ldinput8 -ldxguid -lole32
HAVE_DIRECTX=1
DEFINES += -DHAVE_DINPUT
OBJ += input/drivers/dinput.o \
input/drivers_joypad/dinput_joypad.o
endif
ifeq ($(HAVE_XINPUT), 1)
DEFINES += -DHAVE_XINPUT
OBJ += input/drivers_joypad/xinput_joypad.o
endif
ifeq ($(HAVE_OPENDINGUX_FBDEV), 1)
OBJ += gfx/drivers_context/opendingux_fbdev_ctx.o
DEFINES += $(EGL_CFLAGS)
LIBS += $(EGL_LIBS)
endif
ifeq ($(HAVE_X11), 1)
OBJ += input/common/input_x11_common.o \
input/drivers/x11_input.o \
gfx/common/x11_common.o \
input/drivers_keyboard/keyboard_event_x11.o
LIBS += $(X11_LIBS) $(XEXT_LIBS) $(XF86VM_LIBS) $(XINERAMA_LIBS)
DEFINES += $(X11_CFLAGS) $(XEXT_CFLAGS) $(XF86VM_CFLAGS) $(XINERAMA_CFLAGS)
ifeq ($(HAVE_XCB),1)
LIBS += -lX11-xcb
endif
ifneq ($(HAVE_OPENGLES), 1)
OBJ += gfx/drivers_context/x_ctx.o
endif
endif
ifeq ($(HAVE_XCB),1)
DEFINES += $(XCB_CFLAGS)
LIBS += $(XCB_LIBS)
endif
ifeq ($(HAVE_XKBCOMMON), 1)
DEFINES += $(XKBCOMMON_CFLAGS)
OBJ += input/drivers_keyboard/keyboard_event_xkb.o
LIBS += $(XKBCOMMON_LIBS)
endif
ifeq ($(HAVE_DBUS), 1)
LIBS += $(DBUS_LIBS)
CFLAGS += $(DBUS_CFLAGS)
endif
ifeq ($(HAVE_UDEV), 1)
DEFINES += $(UDEV_CFLAGS)
LIBS += $(UDEV_LIBS)
OBJ += input/drivers/udev_input.o \
input/drivers_keyboard/keyboard_event_udev.o \
input/drivers_joypad/udev_joypad.o
endif
ifeq ($(HAVE_LIBUSB), 1)
ifeq ($(HAVE_THREADS), 1)
ifeq ($(HAVE_HID), 1)
DEFINES += -DHAVE_LIBUSB
OBJ += input/drivers_hid/libusb_hid.o
LIBS += -lusb-1.0
endif
endif
endif
ifeq ($(HAVE_IOHIDMANAGER), 1)
ifeq ($(HAVE_HID), 1)
DEFINES += -DHAVE_IOHIDMANAGER
OBJ += input/drivers_hid/iohidmanager_hid.o
LIBS += -framework IOKit
endif
endif
ifeq ($(HAVE_CORELOCATION), 1)
DEFINES += -DHAVE_CORELOCATION
LIBS += -framework CoreLocation
endif
ifeq ($(HAVE_HID), 1)
DEFINES += -DHAVE_HID
OBJ += input/input_hid_driver.o \
input/drivers_joypad/hid_joypad.o \
input/connect/joypad_connection.o \
input/connect/connect_ps2adapter.o \
input/connect/connect_ps3.o \
input/connect/connect_ps4.o \
input/connect/connect_wii.o \
input/connect/connect_nesusb.o \
input/connect/connect_snesusb.o \
input/connect/connect_wiiupro.o \
input/connect/connect_wiiugca.o
endif
ifeq ($(HAVE_PARPORT), 1)
OBJ += input/drivers_joypad/parport_joypad.o
endif
# Companion UI
ifneq ($(findstring Win32,$(OS)),)
OBJ += ui/drivers/ui_win32.o \
ui/drivers/win32/ui_win32_window.o \
ui/drivers/win32/ui_win32_browser_window.o \
ui/drivers/win32/ui_win32_msg_window.o \
ui/drivers/win32/ui_win32_application.o
endif
# Video
OBJ += gfx/video_context_driver.o \
gfx/drivers_context/gfx_null_ctx.o \
gfx/video_state_tracker.o \
$(LIBRETRO_COMM_DIR)/gfx/math/vector_2.o \
$(LIBRETRO_COMM_DIR)/gfx/math/vector_3.o \
$(LIBRETRO_COMM_DIR)/gfx/math/vector_4.o \
$(LIBRETRO_COMM_DIR)/gfx/math/matrix_4x4.o \
$(LIBRETRO_COMM_DIR)/gfx/math/matrix_3x3.o
ifeq ($(HAVE_KMS), 1)
HAVE_AND_WILL_USE_DRM = 1
OBJ += gfx/drivers_context/drm_ctx.o
DEFINES += $(GBM_CFLAGS) $(DRM_CFLAGS) $(EGL_CFLAGS)
LIBS += $(GBM_LIBS) $(DRM_LIBS) $(EGL_LIBS)
endif
ifeq ($(HAVE_PLAIN_DRM), 1)
OBJ += gfx/drivers/drm_gfx.o
CFLAGS += -I/usr/include/libdrm
LIBS += -ldrm
endif
ifeq ($(HAVE_GL_CONTEXT), 1)
DEFINES += -DHAVE_OPENGL -DHAVE_GLSL
OBJ += gfx/drivers/gl.o \
$(LIBRETRO_COMM_DIR)/gfx/gl_capabilities.o \
gfx/drivers/gl_renderchains/render_chain_gl_legacy.o \
gfx/common/gl_common.o \
gfx/drivers_font/gl_raster_font.o \
$(LIBRETRO_COMM_DIR)/glsym/rglgen.o
ifeq ($(HAVE_MENU_COMMON), 1)
OBJ += menu/drivers_display/menu_display_gl.o
endif
ifeq ($(HAVE_VIDEOCORE), 1)
OBJ += gfx/drivers_context/vc_egl_ctx.o
DEFINES += $(EGL_CFLAGS)
LIBS += $(EGL_LIBS)
endif
ifeq ($(HAVE_EMSCRIPTEN), 1)
OBJ += gfx/drivers_context/emscriptenegl_ctx.o
endif
ifeq ($(HAVE_MALI_FBDEV), 1)
OBJ += gfx/drivers_context/mali_fbdev_ctx.o
DEFINES += $(EGL_CFLAGS)
LIBS += $(EGL_LIBS)
endif
ifeq ($(HAVE_VIVANTE_FBDEV), 1)
OBJ += gfx/drivers_context/vivante_fbdev_ctx.o
DEFINES += $(EGL_CFLAGS)
LIBS += $(EGL_LIBS)
endif
ifeq ($(HAVE_X11), 1)
ifeq ($(HAVE_EGL), 1)
OBJ += gfx/drivers_context/xegl_ctx.o
DEFINES += $(EGL_CFLAGS)
LIBS += $(EGL_LIBS)
endif
endif
ifeq ($(HAVE_OSMESA), 1)
OBJ += gfx/drivers_context/osmesa_ctx.o
LIBS += -lOSMesa
endif
ifeq ($(HAVE_FFMPEG), 1)
ifneq ($(C89_BUILD), 1)
ifneq ($(HAVE_OPENGLES), 1)
OBJ += cores/libretro-ffmpeg/fft/fft.o
DEFINES += -I$(DEPS_DIR) -DHAVE_GL_FFT
NEED_CXX_LINKER=1
endif
endif
endif
ifeq ($(HAVE_OPENGLES), 1)
LIBS += $(OPENGLES_LIBS)
DEFINES += $(OPENGLES_CFLAGS) -DHAVE_OPENGLES
ifeq ($(HAVE_OPENGLES3), 1)
DEFINES += -DHAVE_OPENGLES3
else
DEFINES += -DHAVE_OPENGLES2
endif
OBJ += $(LIBRETRO_COMM_DIR)/glsym/glsym_es2.o
else
DEFINES += -DHAVE_GL_SYNC
OBJ += $(LIBRETRO_COMM_DIR)/glsym/glsym_gl.o
GL_LIBS := -lGL
ifeq ($(OSX), 1)
GL_LIBS := -framework OpenGL
OBJ += gfx/drivers_context/cgl_ctx.o
else ifneq ($(findstring Win32,$(OS)),)
GL_LIBS := -lopengl32 -lgdi32 -lcomdlg32 -lcomctl32
OBJ += gfx/drivers_context/wgl_ctx.o
endif
LIBS += $(GL_LIBS)
endif
OBJ += gfx/drivers_shader/shader_glsl.o
DEFINES += -DHAVE_GLSL
endif
ifeq ($(HAVE_EGL), 1)
OBJ += gfx/common/egl_common.o
endif
ifeq ($(HAVE_SDL2), 1)
HAVE_SDL=0
endif
ifeq ($(HAVE_SDL), 1)
OBJ += gfx/drivers/sdl_gfx.o \
input/drivers/sdl_input.o \
input/drivers_joypad/sdl_joypad.o \
audio/drivers/sdl_audio.o
ifeq ($(HAVE_GL_CONTEXT), 1)
OBJ += gfx/drivers_context/sdl_gl_ctx.o
endif
DEFINES += $(SDL_CFLAGS) $(BSD_LOCAL_INC)
LIBS += $(SDL_LIBS)
endif
ifeq ($(HAVE_SDL2), 1)
OBJ += gfx/drivers/sdl2_gfx.o \
input/drivers/sdl_input.o \
input/drivers_joypad/sdl_joypad.o \
audio/drivers/sdl_audio.o
ifeq ($(HAVE_GL_CONTEXT), 1)
OBJ += gfx/drivers_context/sdl_gl_ctx.o
endif
DEFINES += $(SDL2_CFLAGS) $(BSD_LOCAL_INC)
LIBS += $(SDL2_LIBS)
HAVE_SDL = 0
endif
ifeq ($(HAVE_XSHM), 1)
OBJ += gfx/drivers/xshm_gfx.o
endif
ifeq ($(HAVE_VULKAN), 1)
ifneq ($(findstring Win32,$(OS)),)
GLSLANG_PLATFORM := Windows
else
GLSLANG_PLATFORM := Unix
endif
GLSLANG_SOURCES := \
$(wildcard $(DEPS_DIR)/glslang/*.cpp) \
$(wildcard $(DEPS_DIR)/glslang/glslang/SPIRV/*.cpp) \
$(wildcard $(DEPS_DIR)/glslang/glslang/glslang/GenericCodeGen/*.cpp) \
$(wildcard $(DEPS_DIR)/glslang/glslang/OGLCompilersDLL/*.cpp) \
$(wildcard $(DEPS_DIR)/glslang/glslang/glslang/MachineIndependent/*.cpp) \
$(wildcard $(DEPS_DIR)/glslang/glslang/glslang/MachineIndependent/preprocessor/*.cpp) \
$(wildcard $(DEPS_DIR)/glslang/glslang/hlsl/*.cpp) \
$(wildcard $(DEPS_DIR)/glslang/glslang/glslang/OSDependent/$(GLSLANG_PLATFORM)/*.cpp)
SPIRV_CROSS_SOURCES := $(DEPS_DIR)/SPIRV-Cross/spirv_cross.cpp
ifneq ($(findstring Win32,$(OS)),)
# Trivial temporary workaround for MinGW and glslang.
CXXFLAGS += -fpermissive
endif
DEFINES += \
-I$(DEPS_DIR)/glslang/glslang/glslang/OSDependent/$(GLSLANG_PLATFORM) \
-I$(DEPS_DIR)/glslang/glslang/OGLCompilersDLL \
-I$(DEPS_DIR)/glslang/glslang \
-I$(DEPS_DIR)/glslang/glslang/glslang/MachineIndependent \
-I$(DEPS_DIR)/glslang/glslang/glslang/Public \
-I$(DEPS_DIR)/glslang/glslang/SPIRV \
-I$(DEPS_DIR)/glslang \
-I$(DEPS_DIR)/SPIRV-Cross
CXXFLAGS += -Wno-switch -Wno-sign-compare -fno-strict-aliasing -Wno-maybe-uninitialized -Wno-reorder -Wno-parentheses -Igfx/include
CFLAGS += -Igfx/include
GLSLANG_OBJ := $(GLSLANG_SOURCES:.cpp=.o)
SPIRV_CROSS_OBJ := $(SPIRV_CROSS_SOURCES:.cpp=.o)
OBJ += gfx/drivers/vulkan.o \
gfx/common/vulkan_common.o \
$(LIBRETRO_COMM_DIR)/vulkan/vulkan_symbol_wrapper.o \
gfx/drivers_font/vulkan_raster_font.o \
gfx/drivers_shader/shader_vulkan.o \
gfx/drivers_shader/glslang_util.o \
gfx/drivers_shader/slang_reflection.o \
$(GLSLANG_OBJ) \
$(SPIRV_CROSS_OBJ)
ifeq ($(HAVE_VULKAN_DISPLAY), 1)
OBJ += gfx/drivers_context/khr_display_ctx.o
endif
ifeq ($(HAVE_MENU_COMMON), 1)
OBJ += menu/drivers_display/menu_display_vulkan.o
endif
LIBS += -lstdc++
endif
ifeq ($(HAVE_OMAP), 1)
OBJ += gfx/drivers/omap_gfx.o
endif
ifeq ($(HAVE_EXYNOS), 1)
OBJ += gfx/drivers/exynos_gfx.o \
memory/neon/memcpy-neon.o
LIBS += $(DRM_LIBS) $(EXYNOS_LIBS)
DEFINES += $(DRM_CFLAGS) $(EXYNOS_CFLAGS)
HAVE_AND_WILL_USE_DRM = 1
endif
ifeq ($(HAVE_AND_WILL_USE_DRM), 1)
OBJ += gfx/common/drm_common.o
endif
ifeq ($(HAVE_DISPMANX), 1)
OBJ += gfx/drivers/dispmanx_gfx.o
HAVE_VIDEOCORE = 1
LIBS += $(DISPMANX_LIBS)
DEFINES += $(DISPMANX_CFLAGS)
endif
ifeq ($(HAVE_SUNXI), 1)
OBJ += gfx/drivers/sunxi_gfx.o \
gfx/include/pixman/pixman-arm-neon-asm.o
endif
ifeq ($(HAVE_VG), 1)
OBJ += gfx/drivers/vg.o
DEFINES += $(VG_CFLAGS)
LIBS += $(VG_LIBS)
endif
ifeq ($(HAVE_XVIDEO), 1)
OBJ += gfx/drivers/xvideo.o
LIBS += $(XVIDEO_LIBS)
DEFINES += $(XVIDEO_CFLAGS)
endif
ifeq ($(HAVE_CG), 1)
DEFINES += -DHAVE_CG
OBJ += gfx/drivers_shader/shader_gl_cg.o
LIBS += $(CG_LIBS)
endif
ifeq ($(HAVE_D3D9), 1)
OBJ += gfx/drivers/d3d.o \
gfx/drivers/d3d_renderchains/render_chain_null.o \
gfx/drivers/d3d_renderchains/render_chain_driver.o \
gfx/common/d3d_common.o \
gfx/drivers_font/d3d_w32_font.o \
gfx/drivers_context/d3d_ctx.o
HAVE_DIRECTX=1
DEFINES += -DHAVE_D3D -DHAVE_D3D9
LIBS += -ld3d9 -ld3dx9 -ldxguid
ifeq ($(HAVE_MENU_COMMON), 1)
OBJ += menu/drivers_display/menu_display_d3d.o
endif
ifeq ($(HAVE_CG), 1)
LIBS += -lcgD3D9
OBJ += gfx/drivers/d3d_renderchains/render_chain_cg.o
endif
endif
#ifeq ($(HAVE_LIBXML2), 1)
#LIBS += $(LIBXML2_LIBS)
#DEFINES += $(LIBXML2_CFLAGS)
#else
#OBJ += $(LIBRETRO_COMM_DIR)/formats/xml/rxml.o
#endif
# Compression/Archive
OBJ += $(LIBRETRO_COMM_DIR)/file/archive_file.o
ifeq ($(HAVE_7ZIP),1)
CFLAGS += -I$(DEPS_DIR)/7zip
HAVE_COMPRESSION = 1
DEFINES += -DHAVE_7ZIP
7ZOBJ = $(DEPS_DIR)/7zip/7zIn.o \
$(DEPS_DIR)/7zip/7zAlloc.o \
$(DEPS_DIR)/7zip/Bra86.o \
$(DEPS_DIR)/7zip/7zFile.o \
$(DEPS_DIR)/7zip/7zStream.o \
$(DEPS_DIR)/7zip/7zBuf2.o \
$(DEPS_DIR)/7zip/LzmaDec.o \
$(DEPS_DIR)/7zip/7zCrcOpt.o \
$(DEPS_DIR)/7zip/Bra.o \
$(DEPS_DIR)/7zip/7zDec.o \
$(DEPS_DIR)/7zip/Bcj2.o \
$(DEPS_DIR)/7zip/7zCrc.o \
$(DEPS_DIR)/7zip/Lzma2Dec.o \
$(DEPS_DIR)/7zip/7zBuf.o