-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathMakefile
1501 lines (1350 loc) · 46.6 KB
/
Makefile
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
# >>> START OF MAKE OPTIONS <<<
#
# You can either edit the default values below or (recommended) specify them on
# the 'make' command line (non-string options could alternatively be defined as
# environment variables).
#
# Please don't change anything below the line containing END OF MAKE OPTIONS!
#
# >>> FORCE_MINGW <<<
#
# Enable (1) or disable (0) support for the MinGW (GCC) compiler on Windows.
#
# When this option has not been specified, OS auto-detection will take place,
# forcing the use of MinGW when the OS is found to be 'Windows_NT'.
#
# Notes:
#
# Using this option on any other OS than Windows will make the build fail! Also,
# you'll need a working MinGW GCC installation (incl. Qt and SDL). This option
# will enable some assumptions with regard to these requirements!
#
# This is NOT for users of MS Visual C++ 2010!
#
# For detailed build instructions on Windows, see our Wiki:
# http://wiki.batcom-it.net/index.php?title=The_%27ultimate%27_guide_to_QMC2#Windows
#
ifndef FORCE_MINGW
ifeq ($(OS),Windows_NT)
FORCE_MINGW = 1
else
FORCE_MINGW = 0
endif
endif
# >>> AUDIOEFFECTDIALOGS <<<
#
# Enable (1) or disable (0) support for audio-effect dialogs.
#
ifndef AUDIOEFFECTDIALOGS
ifeq '$(FORCE_MINGW)' '1'
AUDIOEFFECTDIALOGS = 0
else
AUDIOEFFECTDIALOGS = 1
endif
endif
# >>> PREFIX <<<
#
# The prefix directory used by the 'make install' target.
#
ifndef PREFIX
ifeq '$(FORCE_MINGW)' '1'
PREFIX = .
else
PREFIX = /usr/local
endif
endif
# >>> QUIET <<<
#
# Compile and link QMC2 'quietly' (1) or show all command lines completely (0)?
#
ifndef QUIET
QUIET = 0
endif
# >>> DEBUG <<<
#
# Choose debugging options:
#
# 0 .... Generate no debugging code at all (default, recommended)
# 1 .... Add symbols for the debugger, show compiler warnings (ok)
# 2 .... Add symbols for the debugger, show compiler warnings and include QMC2's
# debugging code (not recommended)
#
ifndef DEBUG
DEBUG = 0
endif
# >>> ARCH <<<
#
# Target system's OS name -- this should generally not be changed, only if you
# want to compile a specific OS's code branch or if the 'uname' command doesn't
# tell the correct OS name of your system (see also OSREL and MACHINE!).
#
ifndef ARCH
ifeq '$(FORCE_MINGW)' '1'
ARCH = Windows
else
ARCH = $(shell uname)
endif
endif
# >>> OSREL <<<
#
# Target system's OS-release -- please only change this if you really know what
# you're doing :)!
#
ifndef OSREL
ifeq '$(FORCE_MINGW)' '1'
OSREL = $(shell arch\Windows\osrel.bat)
else
OSREL = $(shell uname -r)
endif
endif
# >>> MACHINE <<<
#
# Target system's machine/CPU type -- please only change this if you really know
# what you're doing :)!
#
ifndef MACHINE
ifeq '$(FORCE_MINGW)' '1'
MACHINE = $(shell gcc -dumpmachine)
else
MACHINE = $(shell uname -m)
endif
endif
# >>> QMC2DATADIR <<<
#
# The data directory used by the 'make install' target.
#
ifndef QMC2DATADIR
ifeq '$(ARCH)' 'Darwin'
QMC2DATADIR = /Library/Application Support
else
ifeq '$(FORCE_MINGW)' '1'
QMC2DATADIR = data
else
QMC2DATADIR = $(PREFIX)/share
endif
endif
endif
# >>> SYSCONFDIR <<<
#
# The system configuration directory used by the 'make install' target.
#
ifndef SYSCONFDIR
ifeq '$(ARCH)' 'Darwin'
SYSCONFDIR = /Library/Application Support
else
ifeq '$(FORCE_MINGW)' '1'
SYSCONFDIR =
else
SYSCONFDIR = /etc
endif
endif
endif
# >>> BINDIR <<<
#
# The directory where binaries / application bundles will be installed to (used
# by the 'make install' target).
#
ifndef BINDIR
ifeq '$(ARCH)' 'Darwin'
BINDIR = /Applications
else
ifeq '$(FORCE_MINGW)' '1'
BINDIR = .
else
BINDIR = $(PREFIX)/bin
endif
endif
endif
# >>> OSCFG <<<
#
# Use the global OS build configuration file (1) or not (0)?
#
ifndef OSCFG
ifeq '$(FORCE_MINGW)' '1'
OSCFG = 0
else
OSCFG = 1
endif
endif
# >>> DISTCFG <<<
#
# Use the distribution-specific build configuration (1) or not (0)?
#
ifndef DISTCFG
DISTCFG = 0
endif
# >>> IMGSET <<<
#
# Select the image set to be used (see data/img/<image-set-dirs>/).
#
ifndef IMGSET
IMGSET = classic
endif
# >>> JOYSTICK <<<
#
# Enable joystick support (1) or not (0).
#
# Requires the SDL (Simple Directmedia Layer) development library!
#
ifndef JOYSTICK
JOYSTICK = 1
endif
# >>> WIP <<<
#
# Enable (1) or disable (0) unfinished 'work in progress' code.
#
# Note that WIP code may be far from complete, may not work as expected, can
# crash easily or probably will not even compile correctly. We try to make WIP
# code 'as clean as possible', but there's no guarantee for nothing :).
#
ifndef WIP
WIP = 0
endif
# >>> PHONON / Qt 4 <<<
#
# Enable Qt 4 Phonon based features (1) or leave them out of the build (0).
#
# Requires libphonon and a working Phonon backend (such as gstreamer or xine on
# Linux, DirectX 9+ on Windows and QuickTime 7+ on Mac OS X). Codecs have to be
# installed separately.
#
# Built-in Phonon features include the MP3 audio player and the YouTube video
# widget.
#
ifndef PHONON
PHONON = 1
endif
# >>> MULTIMEDIA / Qt 5 <<<
#
# Enable Qt 5 Multimedia based features (1) or leave them out of the build (0).
#
# As with Phonon for Qt 4, a working QtMultimedia backend is required. Codecs
# have to be installed separately.
#
# Built-in QtMultimedia features include the MP3 audio player and the YouTube
# video widget.
#
ifndef MULTIMEDIA
MULTIMEDIA = 1
endif
# >>> CCACHE <<<
#
# Enable (1) or disable (0) the use of the 'ccache' compiler cache utility.
#
# See also CCACHE_CC and CCACHE_CXX in arch/*.cfg!
#
ifndef CCACHE
CCACHE = 0
endif
# >>> DISTCC <<<
#
# Enable (1) or disable (0) the use of a distributed compiler.
#
# Distributed compilers we've tested successfully are 'distcc' and 'icecc'.
#
# See also DISTCC_CC and DISTCC_CXX in arch/*.cfg!
#
ifndef DISTCC
DISTCC = 0
endif
# >>> BROWSER_EXTRAS <<<
#
# Enable (1) or disable (0) extra browser features such as QtWebKit's 'Web
# Inspector'.
#
ifndef BROWSER_EXTRAS
BROWSER_EXTRAS = 1
endif
# >>> BROWSER_PLUGINS <<<
#
# Enable (1) or disable (0) Netscape/Mozilla plugins in the 'MiniWebBrowser'
# and the 'HTML editor'?
#
# Caution: browser plugins may be buggy and can cause crashes! However, since
# Qt 4.7, browser plugins work quite nicely so they're enabled now as per
# default.
#
ifndef BROWSER_PLUGINS
BROWSER_PLUGINS = 1
endif
# >>> BROWSER_JAVA <<<
#
# Enable (1) or disable (0) Java in the 'MiniWebBrowser'?
#
ifndef BROWSER_JAVA
BROWSER_JAVA = 1
endif
# >>> BROWSER_JAVASCRIPT <<<
#
# Enable (1) or disable (0) JavaScript in the 'MiniWebBrowser'?
#
ifndef BROWSER_JAVASCRIPT
BROWSER_JAVASCRIPT = 1
endif
# >>> BROWSER_PREFETCH_DNS <<<
#
# Enable (1) or disable (0) prefetching of DNS lookups.
#
# This is only supported for Qt >= 4.6 and will be ignored otherwise.
#
ifndef BROWSER_PREFETCH_DNS
BROWSER_PREFETCH_DNS = 0
endif
# >>> FADER_SPEED <<<
#
# Select the audio fading speed of the MP3 player.
#
# FADER_SPEED = 0 .... Pause/resume instantly (fastest)
# FADER_SPEED > 0 .... Fading pause/resume (slower)
#
ifndef FADER_SPEED
ifeq '$(FORCE_MINGW)' '1'
FADER_SPEED = 2000
else
FADER_SPEED = 500
endif
endif
# >>> LIBARCHIVE <<<
#
# Use libarchive additionally to the built-in zip/7-zip support for accessing
# archived data?
#
# LIBARCHIVE = 0 .... Use only built-in zip/7-zip support (default)
# LIBARCHIVE = 1 .... Additionally use the external libarchive library
#
ifndef LIBARCHIVE
LIBARCHIVE = 0
endif
# >>> SYSTEM_MINIZIP <<<
#
# Build using the system's minizip installation (for distro packagers, 1) or the
# bundled source code (default, 0)?
#
# If set to 1, pkg-config will be used to setup compiler- and linker-flags!
#
ifndef SYSTEM_MINIZIP
SYSTEM_MINIZIP = 0
endif
# >>> SYSTEM_ZLIB <<<
#
# Build using the system's zlib installation (for distro packagers, 1) or the
# bundled source code (default, 0)?
#
# If set to 1, pkg-config will be used to setup compiler- and linker-flags!
#
ifndef SYSTEM_ZLIB
SYSTEM_ZLIB = 0
endif
# >>> CC_FLAGS <<<
#
# Specify additional flags passed to the C compiler.
#
ifndef CC_FLAGS
CC_FLAGS =
endif
# >>> CXX_FLAGS <<<
#
# Specify additional flags passed to the C++ compiler.
#
ifndef CXX_FLAGS
CXX_FLAGS =
endif
# >>> L_FLAGS <<<
#
# Specify additional flags passed to the linker.
#
ifndef L_FLAGS
L_FLAGS =
endif
# >>> L_LIBS <<<
#
# Specify additional libraries passed to the linker.
#
ifndef L_LIBS
L_LIBS =
endif
# >>> L_LIBDIRS <<<
#
# Specify additional library directories passed to the linker.
#
ifndef L_LIBDIRS
L_LIBDIRS =
endif
# >>> L_LIBDIRFLAGS <<<
#
# Specify an optional value for QMAKE_LIBDIR_FLAGS (usually not required).
#
# This option can be useful to solve Qt library version conflicts when you have
# different versions of Qt installed and the linker chooses the wrong one, then
# for example using "L_LIBDIRFLAGS=-L<path-to-qt>/lib" will ensure that the
# given library path will be used before other (system library) paths.
#
ifndef L_LIBDIRFLAGS
L_LIBDIRFLAGS =
endif
# >>> LINKER <<<
#
# Specify (overwrite) the linker to be used (may be useful for cross-compile).
#
ifndef LINKER
LINKER =
endif
# >>> MKSPEC <<<
#
# Specify (overwrite) the Qt mkspec (qmake spec) to be used.
#
ifndef MKSPEC
ifeq '$(FORCE_MINGW)' '1'
MKSPEC = win32-g++
else
ifeq '$(ARCH)' 'Darwin'
MKSPEC = macx-clang
else
MKSPEC =
endif
endif
endif
# >>> MAC_UNIVERSAL <<<
#
# Enable (1) or disable (0) the creation of a Mac OS X universal binary
#
# This is only used on Mac OS X and disabled by default.
#
ifndef MAC_UNIVERSAL
MAC_UNIVERSAL = 0
endif
# >>> LOCAL_QML_IMPORT_PATH <<<
#
# Specifies a local path that's used as an additional path for QML imports. The
# default path is 'imports'.
#
ifndef LOCAL_QML_IMPORT_PATH
LOCAL_QML_IMPORT_PATH = imports
endif
# >>> MAN_DIR <<<
#
# The base-directory used by the 'make doc-install' target to install man-pages.
#
ifneq '$(FORCE_MINGW)' '1'
ifndef MAN_DIR
ifeq '$(ARCH)' 'Darwin'
MAN_DIR = /usr/share/man
else
MAN_DIR = $(PREFIX)/man
endif
endif
endif
# >>> SDL <<<
#
# SDL version to use (1 or 2). Auto-detected if unspecified -- SDL=2 has
# precendence.
#
ifneq '$(FORCE_MINGW)' '1'
ifndef SDL
SDL = $(shell scripts/sdl-version.sh)
else
ifneq '$(SDL)' '1'
ifneq '$(SDL)' '2'
SDL = $(shell scripts/sdl-version.sh)
endif
endif
endif
else
SDL = 2
endif
### BEGIN: PLEASE DON'T CHANGE THIS ###
# commands are platform/distribution-specific
ifneq '$(ARCH)' 'Windows'
include arch/default.cfg
ifeq '$(OSCFG)' '1'
OSCFGFILE = $(shell scripts/os-detect.sh | $(GREP) "System cfg-file" | $(COLRM) 1 30)
ifeq ($(wildcard $(OSCFGFILE)),)
OS = $(shell scripts/os-detect.sh | $(GREP) "Operating System" | $(COLRM) 1 30)
$(info No operating system specific configuration found for '$(OS)')
else
include $(OSCFGFILE)
endif
endif
ifeq '$(DISTCFG)' '1'
DISTCFGFILE = $(shell scripts/os-detect.sh | $(GREP) "Distribution cfg-file" | $(COLRM) 1 30)
ifeq ($(wildcard $(DISTCFGFILE)),)
DIST = $(shell scripts/os-detect.sh | $(GREP) "Distribution / OS version" | $(COLRM) 1 30)
$(info No distribution specific configuration found for '$(DIST)')
else
include $(DISTCFGFILE)
endif
endif
else
include arch/default.cfg
include arch/Windows.cfg
endif
# qmake version check (major release)
ifndef QMAKEV
QMAKEV = $(shell $(QMAKE) -query QMAKE_VERSION | $(COLRM) 2)
endif
### END: PLEASE DON'T CHANGE THIS ###
# >>> YOUTUBE <<<
#
# Enable (1) or disable (0) support for machine 'attached' YouTube videos.
#
# With Qt 4 this feature requires Phonon and will thus be disabled automatically
# when Phonon has been disabled globally (PHONON=0)!
#
# In case of Qt 5 we use the QtMultimedia module. When multi-media features have
# been disabled globally (MULTIMEDIA=0) the YouTube feature will be disabled as
# well.
#
# You'll also need a decent back-end and codecs that supports FLV / MP4 video
# formats. The codecs have to be installed separately.
#
ifndef YOUTUBE
ifeq '$(QMAKEV)' '3'
YOUTUBE = $(MULTIMEDIA)
else
YOUTUBE = $(PHONON)
endif
endif
# >>> END OF MAKE OPTIONS -- PLEASE DO NOT CHANGE ANYTHING AFTER THIS LINE <<<
# project name
PROJECT = qmc2
# version
VERSION_MAJOR = 0
VERSION_MINOR = 244
# complete version string
VERSION = $(VERSION_MAJOR).$(VERSION_MINOR)
ifneq '$(ARCH)' 'Windows'
QMC2_EMULATOR = SDLMAME
else
QMC2_EMULATOR = MAME
endif
# associate icon files
ifeq '$(ARCH)' 'Darwin'
MYAPPICON = mame.icns
endif
# determine the "GIT revision" (if any)
ifndef GIT_REV
GIT_REV=$(shell $(GITVERSION) 2> /dev/null)
endif
ifeq '$(GIT_REV)' ''
GIT_REV=0
endif
ifneq '$(ARCH)' 'Windows'
# global QMC2 configuration file
GLOBAL_QMC2_INI=$(shell $(ECHO) $(DESTDIR)/$(SYSCONFDIR)/$(PROJECT)/$(PROJECT).ini | $(SED) -e "s*//*/*g")
# global data directory
GLOBAL_DATADIR=$(shell $(ECHO) $(DESTDIR)/$(QMC2DATADIR) | $(SED) -e "s*//*/*g")
endif
ifeq '$(QMAKEV)' '3'
PHONON = 0
else
MULTIMEDIA = 0
endif
ifneq '$(QMAKEV)' '1'
QT_LIBVERSION = $(shell $(QMAKE) -v | $(GREP) "Qt version" | $(AWK) '{print $$4}')
ifeq '$(ARCH)' 'Darwin'
QMAKEFILE = Makefile.qmake
QT_LIBTMP = $(shell $(ECHO) $(QT_LIBVERSION) | tr "." " " )
QT_LIBMAJ = $(shell $(ECHO) $(QT_LIBTMP) | $(AWK) '{ print $$1 }')
QT_LIBMIN = $(shell $(ECHO) $(QT_LIBTMP) | $(AWK) '{ print $$2 }')
QT_LIB48PLUS = $(shell (([ $(QT_LIBMAJ) -ge 4 ] && [ $(QT_LIBMIN) -ge 8 ]) || [ $(QT_LIBMAJ) -ge 5 ]) && $(ECHO) true)
ifneq '$(QT_LIB48PLUS)' 'true'
$(error Sorry, Qt 4.8+ not found!)
endif
endif
# work around for qmake's issues with spaces in values
blank =
space = $(blank) $(blank)
# pre-compiler definitions (passed to qmake)
DEFINES = DEFINES+=QMC2_$(QMC2_EMULATOR) QMC2_VERSION=$(VERSION) BUILD_OS_NAME=$(OSNAME) BUILD_OS_RELEASE=$(OSREL) BUILD_MACHINE=$(MACHINE) PREFIX=$(PREFIX) QMC2DATADIR="$(subst $(space),:,$(QMC2DATADIR))" SYSCONFDIR="$(subst $(space),:,$(SYSCONFDIR))" QMC2_JOYSTICK=$(JOYSTICK) QMC2_PHONON=$(PHONON) QMC2_MULTIMEDIA=$(MULTIMEDIA) QMC2_FADER_SPEED=$(FADER_SPEED)
ifneq '$(GIT_REV)' '0'
DEFINES += QMC2_GIT_REV=$(GIT_REV)
endif
# available translations
QMC2_TRANSLATIONS = de es el fr it pl pt pt_BR ro sv us
# process make options
ifeq '$(DEBUG)' '2'
DEFINES += QMC2_DEBUG
endif
ifeq '$(ARCH)' 'Darwin'
DEFINES += QMC2_MAC_UNIVERSAL=$(MAC_UNIVERSAL)
endif
ifeq '$(BROWSER_EXTRAS)' '1'
DEFINES += QMC2_BROWSER_EXTRAS_ENABLED
endif
ifeq '$(BROWSER_PLUGINS)' '1'
DEFINES += QMC2_BROWSER_PLUGINS_ENABLED
endif
ifeq '$(BROWSER_JAVA)' '1'
DEFINES += QMC2_BROWSER_JAVA_ENABLED
endif
ifeq '$(BROWSER_JAVASCRIPT)' '1'
DEFINES += QMC2_BROWSER_JAVASCRIPT_ENABLED
endif
ifeq '$(BROWSER_PREFETCH_DNS)' '1'
DEFINES += QMC2_BROWSER_PREFETCH_DNS_ENABLED
endif
ifeq '$(YOUTUBE)' '1'
DEFINES += QMC2_YOUTUBE_ENABLED
endif
ifeq '$(AUDIOEFFECTDIALOGS)' '0'
DEFINES += QMC2_NOEFFECTDIALOGS
endif
ifeq '$(WIP)' '1'
DEFINES += QMC2_WIP_ENABLED
endif
ifeq '$(LIBARCHIVE)' '1'
DEFINES += QMC2_LIBARCHIVE_ENABLED
endif
ifeq '$(SYSTEM_MINIZIP)' '0'
DEFINES += QMC2_BUNDLED_MINIZIP
endif
ifeq '$(SYSTEM_ZLIB)' '0'
DEFINES += QMC2_BUNDLED_ZLIB
endif
# setup SDL library and include paths
ifneq '$(ARCH)' 'Windows'
ifdef SDL_LIBS
undef SDL_LIBS
endif
ifdef SDL_INCLUDEPATH
undef SDL_INCLUDEPATH
endif
else # '$(ARCH)' 'Windows'
ifeq '$(FORCE_MINGW)' '1'
ifdef SDL_LIBS
undef SDL_LIBS
endif
ifdef SDL_INCLUDEPATH
undef SDL_INCLUDEPATH
endif
endif # '$(FORCE_MINGW)' '1'
endif # '$(ARCH)' 'Windows'
ifneq '$(ARCH)' 'Windows'
ifneq '$(ARCH)' 'Darwin'
ifeq '$(JOYSTICK)' '1'
SDL_LIBS = LIBS+='$(shell scripts/sdl-libs.sh $(SDL))'
SDL_INCLUDEPATH = INCLUDEPATH+='$(shell scripts/sdl-includepath.sh $(SDL))'
DEFINES += $(shell scripts/sdl-defines.sh $(SDL))
endif # '$(JOYSTICK)' '1'
endif # '$(ARCH)' 'Darwin'
endif # '$(ARCH)' 'Windows'
# setup additional qmake features for release or debug builds
ifdef QMAKE_CONF
undef QMAKE_CONF
endif
ifdef ARCADE_QMAKE_CONF
undef ARCADE_QMAKE_CONF
endif
# setup TARGET's application icon and generic name
EMUICO = mame.png
GENERICNAME = M.A.M.E. Catalog / Launcher II
# target name (variant)
ifneq '$(ARCH)' 'Windows'
TARGET_NAME = $(PROJECT)-sdlmame
else
TARGET_NAME = $(PROJECT)-mame
endif
QMAKE_CONF = TARGET=$(TARGET_NAME)
ifeq '$(DEBUG)' '0'
QMAKE_CONF += CONFIG+=warn_off CONFIG+=release
else
QMAKE_CONF += CONFIG+=warn_on CONFIG+=debug
endif
# setup library and include paths for MinGW environment
ifeq '$(ARCH)' 'Windows'
ifeq '$(FORCE_MINGW)' '1'
TEST_FILE=$(shell gcc -print-file-name=libSDL2.a)
MINGW_LIBDIR=$(shell arch\Windows\dirname.bat $(TEST_FILE))
ifeq '$(SDL)' '2'
QMAKE_CONF += QMC2_LIBS+=-L$(MINGW_LIBDIR) QMC2_INCLUDEPATH+=$(MINGW_LIBDIR)../include QMC2_INCLUDEPATH+=$(MINGW_LIBDIR)../include/SDL2
ARCADE_QMAKE_CONF += QMC2_ARCADE_INCLUDEPATH+=$(MINGW_LIBDIR)../include QMC2_ARCADE_INCLUDEPATH+=$(MINGW_LIBDIR)../include/SDL2
else # '$(SDL)' '2'
QMAKE_CONF += QMC2_LIBS+=-L$(MINGW_LIBDIR) QMC2_INCLUDEPATH+=$(MINGW_LIBDIR)../include QMC2_INCLUDEPATH+=$(MINGW_LIBDIR)../include/SDL
ARCADE_QMAKE_CONF += QMC2_ARCADE_INCLUDEPATH+=$(MINGW_LIBDIR)../include QMC2_ARCADE_INCLUDEPATH+=$(MINGW_LIBDIR)../include/SDL
endif # '$(SDL)' '2'
endif # '$(FORCE_MINGW)' '1'
endif # '$(ARCH)' 'Windows'
# optionally setup the qmake spec
ifdef QT_MAKE_SPEC
undef QT_MAKE_SPEC
endif
ifneq '$(MKSPEC)' ''
QT_MAKE_SPEC = -spec $(MKSPEC)
endif
# setup additional Qt configuration options
ifdef QT_CONF
undef QT_CONF
endif
ifneq '$(QMAKEV)' '3'
ifeq '$(PHONON)' '1'
QT_CONF += QT+=phonon
endif
endif
# setup use of CCACHE or DISTCC (if applicable)
ifdef QMAKE_CXX_COMPILER
undef QMAKE_CXX_COMPILER
endif
ifneq '$(CCACHE)$(DISTCC)' '11'
ifeq '$(CCACHE)' '1'
QMAKE_CXX_COMPILER += QMAKE_CXX=$(CCACHE_CXX) QMAKE_CC=$(CCACHE_CC)
endif
ifeq '$(DISTCC)' '1'
QMAKE_CXX_COMPILER += QMAKE_CXX=$(DISTCC_CXX) QMAKE_CC=$(DISTCC_CC)
endif
else
$(warning ### WARNING: you cannot mix DISTCC and CCACHE -- disabling both ###)
CCACHE = 0
DISTCC = 0
endif
# optional C++ compiler flags
ifdef QMAKE_CXX_FLAGS
undef QMAKE_CXX_FLAGS
endif
ifneq '$(CXX_FLAGS)' ''
QMAKE_CXX_FLAGS += QMAKE_CXXFLAGS='$(CXX_FLAGS)'
endif
# optional C compiler flags
ifdef QMAKE_CC_FLAGS
undef QMAKE_CC_FLAGS
endif
ifneq '$(CC_FLAGS)' ''
QMAKE_CC_FLAGS += QMAKE_CFLAGS='$(CC_FLAGS)'
endif
# optional linker flags
ifdef QMAKE_L_FLAGS
undef QMAKE_L_FLAGS
endif
ifneq '$(L_FLAGS)' ''
QMAKE_L_FLAGS += QMAKE_LFLAGS='$(L_FLAGS)'
endif
# optional libraries
ifdef QMAKE_L_LIBS
undef QMAKE_L_LIBS
endif
ifneq '$(L_LIBS)' ''
QMAKE_L_LIBS += QMAKE_LIBS='$(L_LIBS)'
endif
# optional library paths
ifdef QMAKE_L_LIBDIRS
undef QMAKE_L_LIBDIRS
endif
ifneq '$(L_LIBDIRS)' ''
QMAKE_L_LIBDIRS += QMAKE_LIBDIR='$(L_LIBDIRS)'
endif
# optional QMAKE_LIBDIR_FLAGS
ifdef QMAKE_L_LIBDIRFLAGS
undef QMAKE_L_LIBDIRFLAGS
endif
ifneq '$(L_LIBDIRFLAGS)' ''
QMAKE_L_LIBDIRFLAGS += QMAKE_LIBDIR_FLAGS='$(L_LIBDIRFLAGS)'
endif
# optional linker binary overwrite
ifdef QMAKE_LINKER
undef QMAKE_LINKER
endif
ifneq '$(LINKER)' ''
QMAKE_LINKER += QMAKE_LINK=$(LINKER)
endif
# targets/rules
all: $(PROJECT)-bin
bin: $(PROJECT)-bin
$(PROJECT): $(PROJECT)-bin
ifeq '$(ARCH)' 'Darwin'
# put the version, SCM revision and icon resource in Info.plist on Mac OS X
%.plist: %.plist.in
@$(SED) -e 's/@SHORT_VERSION@/$(subst /,\/,$(VERSION))/g' -e 's/@SCM_REVISION@/$(subst /,\/,$(GIT_REV))/g' -e 's/@ICON@/$(MYAPPICON)/g' < $< > $@
endif
# tools
ifeq '$(DEBUG)' '0'
QCHDMAN_CONF += CONFIG+=warn_off CONFIG+=release
QCHDMAN_DEFINES = DEFINES+=QCHDMAN_RELEASE
else
QCHDMAN_CONF += CONFIG+=warn_on CONFIG+=debug
QCHDMAN_DEFINES = DEFINES+=QCHDMAN_DEBUG
endif
ifneq '$(GIT_REV)' '0'
QCHDMAN_DEFINES += QCHDMAN_GIT_REV=$(GIT_REV)
endif
ifeq '$(ARCH)' 'Darwin'
ifeq '$(MAC_UNIVERSAL)' '1'
QCHDMAN_DEFINES += QCHDMAN_MAC_UNIVERSAL
endif
endif
ifeq '$(WIP)' '1'
QCHDMAN_DEFINES += QCHDMAN_WIP_ENABLED
endif
ifeq '$(ARCH)' 'Windows'
src/tools/qchdman/Makefile: src/tools/qchdman/qchdman.pro
@$(CD) src/tools/qchdman && $(QMAKE) -makefile $(QT_MAKE_SPEC) $(QCHDMAN_CONF) $(QMAKE_CXX_COMPILER) $(QMAKE_CXX_FLAGS) $(QMAKE_CC_FLAGS) $(QMAKE_L_FLAGS) $(QMAKE_L_LIBS) $(QMAKE_L_LIBDIRS) $(QMAKE_L_LIBDIRFLAGS) $(QMAKE_LINKER) "$(QCHDMAN_DEFINES)"
qchdman: qchdman-bin
qchdman-bin: src/tools/qchdman/Makefile
@$(CD) src/tools/qchdman && $(MAKE)
qchdman-clean: src/tools/qchdman/Makefile
@$(CD) src/tools/qchdman && $(MAKE) distclean
@$(RMDIR) src/tools/qchdman/release
@$(RMDIR) src/tools/qchdman/debug
@$(RM) src/tools/qchdman/object_script.qchdman.Release src/tools/qchdman/object_script.qchdman.Debug
tools: qchdman
tools-clean: qchdman-clean
else
src/tools/qchdman/Makefile: src/tools/qchdman/qchdman.pro
@$(CD) src/tools/qchdman && $(QMAKE) -makefile $(QT_MAKE_SPEC) $(QCHDMAN_CONF) $(QMAKE_CXX_COMPILER) $(QMAKE_CXX_FLAGS) $(QMAKE_CC_FLAGS) $(QMAKE_L_FLAGS) $(QMAKE_L_LIBS) $(QMAKE_L_LIBDIRS) $(QMAKE_L_LIBDIRFLAGS) $(QMAKE_LINKER) '$(QCHDMAN_DEFINES)'
qchdman: qchdman-bin
qchdman-bin: src/tools/qchdman/Makefile
@$(CD) src/tools/qchdman && $(MAKE)
qchdman-clean: src/tools/qchdman/Makefile
@$(CD) src/tools/qchdman && $(MAKE) distclean
ifeq '$(ARCH)' 'Darwin'
@$(RM) src/tools/qchdman/Info.plist
QCHDMAN_VERSION=$(shell $(GREP) "VERSION =" tools/qchdman/qchdman.pro | $(AWK) '{ print $$3 }')
src/tools/qchdman/Info.plist: src/tools/qchdman/Info.plist.in
@$(SED) -e 's/@SHORT_VERSION@/$(subst /,\/,$(QCHDMAN_VERSION))/g' -e 's/@SCM_REVISION@/$(subst /,\/,$(GIT_REV))/g' -e 's/@ICON@/qchdman.icns/g' < $< > $@
src/tools/qchdman/qchdman.app/Contents/Resources/qt.conf: src/tools/qchdman/Info.plist
@$(MACDEPLOYQT) src/tools/qchdman/qchdman.app
qchdman-macdeployqt: src/tools/qchdman/qchdman.app/Contents/Resources/qt.conf
qchdman-install: qchdman-bin qchdman-macdeployqt
@$(RSYNC) "src/tools/qchdman/qchdman.app" "/Applications"
@$(CHMOD) a+rx "/Applications/qchdman.app"
@$(RSYNC) src/tools/qchdman/images/qchdman.icns /Applications/qchdman.app/Contents/Resources/
@$(RSYNC) src/tools/qchdman/Info.plist /Applications/qchdman.app/Contents/
else
qchdman-install: qchdman-bin
@$(MKDIR) "$(DESTDIR)/$(BINDIR)" "$(DESTDIR)/$(QMC2DATADIR)/$(PROJECT)"
@$(RSYNC) "src/tools/qchdman/qchdman" "$(DESTDIR)/$(BINDIR)"
@$(RSYNC) ./data/img "$(GLOBAL_DATADIR)/$(PROJECT)/"
@$(ECHO) "Installing qchdman.desktop to $(GLOBAL_DATADIR)/applications"
@$(MKDIR) $(GLOBAL_DATADIR)/applications
@$(CHMOD) a+rx $(GLOBAL_DATADIR)/applications
@$(SED) -e "s*DATADIR*$(QMC2DATADIR)*g" < ./inst/qchdman.desktop.template > $(GLOBAL_DATADIR)/applications/qchdman.desktop
endif
tools: qchdman
tools-clean: qchdman-clean
tools-install: qchdman-install
endif
ifeq '$(DEBUG)' '0'
ARCADE_CONF = CONFIG+=warn_off CONFIG+=release
ARCADE_DEFINES = DEFINES+=QMC2_ARCADE_RELEASE
else
ARCADE_CONF = CONFIG+=warn_on CONFIG+=debug
ARCADE_DEFINES = DEFINES+=QMC2_ARCADE_DEBUG
endif
ifneq '$(GIT_REV)' '0'
ARCADE_DEFINES += QMC2_ARCADE_GIT_REV=$(GIT_REV)
endif
ifeq '$(FORCE_MINGW)' '1'
ARCADE_DEFINES += QMC2_ARCADE_MINGW
endif
ifeq '$(ARCH)' 'Darwin'
ifeq '$(MAC_UNIVERSAL)' '1'
ARCADE_DEFINES += QMC2_ARCADE_MAC_UNIVERSAL
endif
endif
ifeq '$(LIBARCHIVE)' '1'
ARCADE_DEFINES += QMC2_ARCADE_LIBARCHIVE_ENABLED
endif
ifeq '$(SYSTEM_MINIZIP)' '0'
ARCADE_DEFINES += QMC2_ARCADE_BUNDLED_MINIZIP
endif
ifeq '$(SYSTEM_ZLIB)' '0'
ARCADE_DEFINES += QMC2_ARCADE_BUNDLED_ZLIB
endif
ARCADE_VERSION=$(shell $(GREP) "VERSION =" arcade/qmc2-arcade.pro | $(AWK) '{ print $$3 }')
ARCADE_QMAKE_DEFS = QMC2_ARCADE_QML_IMPORT_PATH=$(LOCAL_QML_IMPORT_PATH) QMC2_ARCADE_JOYSTICK=$(JOYSTICK) SDL=$(SDL) $(ARCADE_QMAKE_CONF)
src/arcade/Makefile: src/arcade/qmc2-arcade.pro
@$(CD) src/arcade && $(QMAKE) -makefile $(QT_MAKE_SPEC) $(ARCADE_CONF) $(ARCADE_QMAKE_DEFS) $(QMAKE_CXX_COMPILER) $(QMAKE_CXX_FLAGS) $(QMAKE_CC_FLAGS) $(QMAKE_L_FLAGS) $(QMAKE_L_LIBS) $(QMAKE_L_LIBDIRS) $(QMAKE_L_LIBDIRFLAGS) $(QMAKE_LINKER) "$(ARCADE_DEFINES)"
arcade: arcade-bin
arcade-bin: src/arcade/Makefile
@$(CD) src/arcade && $(MAKE)
arcade-clean: src/arcade/Makefile
@$(CD) src/arcade && $(MAKE) distclean
ifeq '$(ARCH)' 'Windows'
@$(RMDIR) src/arcade/release
@$(RMDIR) src/arcade/debug
@$(RM) src/arcade/object_script.qmc2-arcade.Release src/arcade/object_script.qmc2-arcade.Debug
endif
ifeq '$(ARCH)' 'Darwin'
@$(RM) src/arcade/Info.plist
endif
ifeq '$(ARCH)' 'Darwin'
ARCADE_VERSION=$(shell $(GREP) "VERSION =" arcade/qmc2-arcade.pro | $(AWK) '{ print $$3 }')
src/arcade/Info.plist: src/arcade/Info.plist.in
@$(SED) -e 's/@SHORT_VERSION@/$(subst /,\/,$(ARCADE_VERSION))/g' -e 's/@SCM_REVISION@/$(subst /,\/,$(GIT_REV))/g' -e 's/@ICON@/qmc2-arcade.icns/g' < $< > $@
src/arcade/qmc2-arcade.app/Contents/Resources/qt.conf: src/arcade/Info.plist
@$(MACDEPLOYQT) src/arcade/qmc2-arcade.app
@arch/Darwin/arcade_macdeployimports.sh $(QT_LIBMAJ)
arcade-macdeployqt: src/arcade/qmc2-arcade.app/Contents/Resources/qt.conf
endif
ifeq '$(ARCH)' 'Windows'
else
ifeq '$(ARCH)' 'Darwin'
arcade-install: arcade-bin arcade-macdeployqt
@$(RSYNC) "src/arcade/qmc2-arcade.app" "/Applications/qmc2"
@$(CHMOD) a+rx "/Applications/qmc2/qmc2-arcade.app"
@$(RSYNC) src/arcade/images/qmc2-arcade.icns /Applications/qmc2/qmc2-arcade.app/Contents/Resources/
@$(RSYNC) src/arcade/Info.plist /Applications/qmc2/qmc2-arcade.app/Contents/
else
arcade-install: arcade-bin
@$(MKDIR) "$(DESTDIR)/$(BINDIR)" "$(DESTDIR)/$(QMC2DATADIR)/$(PROJECT)"
@$(RSYNC) "src/arcade/qmc2-arcade" "$(DESTDIR)/$(BINDIR)"
@$(RSYNC) ./data/img "$(GLOBAL_DATADIR)/$(PROJECT)/"