-
-
Notifications
You must be signed in to change notification settings - Fork 24
/
Makefile.generic
1308 lines (1185 loc) · 39 KB
/
Makefile.generic
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
#
# Maverick Model 3D Makefile
#
# GNU Make required
#
# mingw.org's mingw32-make.exe on Windows doesn't have uname
ifdef MINGW32_MAKE
COMPILE_PLATFORM=mingw32
COMPILE_ARCH=x86
else
COMPILE_PLATFORM=$(shell uname|sed -e s/_.*//|tr '[:upper:]' '[:lower:]'|sed -e 's/\//_/g')
COMPILE_ARCH=$(shell uname -m | sed -e s/i.86/x86/)
ifeq ($(COMPILE_PLATFORM),sunos)
# Solaris uname and GNU uname differ
COMPILE_ARCH=$(shell uname -p | sed -e s/i.86/x86/)
endif
endif
#############################################################################
#
# If you require a different configuration from the defaults below, create a
# new file named "Makefile.local" in the same directory as this file and define
# your parameters there. This allows you to change configuration without
# causing problems with keeping up to date with the repository.
#
#############################################################################
-include Makefile.local
ifeq ($(COMPILE_PLATFORM),cygwin)
PLATFORM=mingw32
endif
ifndef PLATFORM
PLATFORM=$(COMPILE_PLATFORM)
endif
export PLATFORM
ifeq ($(PLATFORM),mingw32)
MINGW=1
endif
ifeq ($(PLATFORM),mingw64)
MINGW=1
endif
ifeq ($(COMPILE_ARCH),powerpc)
COMPILE_ARCH=ppc
endif
ifeq ($(COMPILE_ARCH),powerpc64)
COMPILE_ARCH=ppc64
endif
ifndef ARCH
ARCH=$(COMPILE_ARCH)
endif
export ARCH
ifneq ($(PLATFORM),$(COMPILE_PLATFORM))
CROSS_COMPILING=1
else
CROSS_COMPILING=0
ifneq ($(ARCH),$(COMPILE_ARCH))
CROSS_COMPILING=1
endif
endif
export CROSS_COMPILING
ifndef V
V=
endif
ifndef BUILD
BUILD=build
endif
bin_path=$(shell which $(1) 2> /dev/null)
BUILDSUB=${PLATFORM}-${ARCH}
B=${BUILD}/${BUILDSUB}
BUILDSUB_TOOLS=${COMPILE_PLATFORM}-${COMPILE_ARCH}
B_TOOLS=${BUILD}/${BUILDSUB_TOOLS}
INSTALL=install
ifdef MINGW32_MAKE
MKDIR=mkdir
else
MKDIR=mkdir -p
endif
#############################################################################
# SETUP AND BUILD -- MINGW
#############################################################################
ifdef MINGW
ifndef QTDIR
ifneq ($(CROSS_COMPILING),1)
QTDIR=C:/Qt/5.11.1/mingw53_32
ifdef MINGW32_MAKE
CC=C:\Qt\Tools\mingw530_32\bin\i686-w64-mingw32-gcc-5.3.0.exe
CXX=C:\Qt\Tools\mingw530_32\bin\i686-w64-mingw32-g++.exe
endif
endif
endif
ifdef QTDIR
ifndef QT_BIN_DIR
QT_BIN_DIR=${QTDIR}/bin
endif
ifndef QT_INCLUDE_DIR
QT_INCLUDE_DIR=${QTDIR}/include
endif
ifndef QT_LIB_DIR
QT_LIB_DIR=${QTDIR}/lib
endif
ifndef QT_TRANSLATIONS_DIR
QT_TRANSLATIONS_DIR=${QTDIR}/translations
endif
endif
ifndef QT_BIN_DIR
$(error Need to specify QT_BIN_DIR with native Qt5 executables for uic, moc, rcc, and lrelease)
endif
ifndef QT_INCLUDE_DIR
$(error Need to specify QT_INCLUDE_DIR with MinGW Qt5 headers)
endif
ifndef QT_LIB_DIR
$(error Need to specify QT_LIB_DIR with MinGW Qt5 libs)
endif
# not required, it's only used on macOS right now
#ifndef QT_TRANSLATIONS_DIR
# $(error Need to specify QT_TRANSLATIONS_DIR with MinGW Qt5 translations)
#endif
ifeq ($(CROSS_COMPILING),1)
# If CC is already set to something generic, we probably want to use
# something more specific
ifneq ($(findstring $(strip $(CC)),cc gcc),)
CC=
endif
ifneq ($(findstring $(strip $(CXX)),g++),)
CXX=
endif
# We need to figure out the correct gcc and windres
ifeq ($(ARCH),x86_64)
MINGW_PREFIXES=x86_64-w64-mingw32 amd64-mingw32msvc
endif
ifeq ($(ARCH),x86)
MINGW_PREFIXES=i686-w64-mingw32 i586-mingw32msvc i686-pc-mingw32
endif
# Prefer POSIX thread model (as opposed to win32) to use the same
# libgcc and libstdc++ run-time as Qt. Debian has separate binaries
# with -posix and -win32 suffix. "$(MINGW_PREFIX)-gcc" could be either.
ifndef CC
CC=$(strip $(foreach MINGW_PREFIX, $(MINGW_PREFIXES), \
$(call bin_path, $(MINGW_PREFIX)-gcc-posix)))
endif
ifndef CC
CC=$(strip $(foreach MINGW_PREFIX, $(MINGW_PREFIXES), \
$(call bin_path, $(MINGW_PREFIX)-gcc)))
endif
ifndef CXX
CXX=$(strip $(foreach MINGW_PREFIX, $(MINGW_PREFIXES), \
$(call bin_path, $(MINGW_PREFIX)-g++-posix)))
endif
ifndef CXX
CXX=$(strip $(foreach MINGW_PREFIX, $(MINGW_PREFIXES), \
$(call bin_path, $(MINGW_PREFIX)-g++)))
endif
ifndef WINDRES
WINDRES=$(strip $(foreach MINGW_PREFIX, $(MINGW_PREFIXES), \
$(call bin_path, $(MINGW_PREFIX)-windres)))
endif
TOOLS_BINEXT=
else
# Some MinGW installations define CC to cc, but don't actually provide cc,
# so check that CC points to a real binary and use gcc if it doesn't
ifeq ($(call bin_path, $(CC)),)
CC=gcc
endif
ifndef CXX
CXX=g++
endif
ifndef WINDRES
WINDRES=windres
endif
TOOLS_BINEXT=.exe
endif
ifeq ($(CC),)
$(error Cannot find a suitable cross compiler for $(PLATFORM))
endif
ifdef MINGW32_MAKE
# mingw32 windres needs absolute path to compiler for using as a preprocessor
ifeq ("$(wildcard $(CC))","")
# $(error CC must be absolute path to gcc)
endif
endif
ifndef QT_LIBS
QT_LIBS=-lQt5Core -lQt5Gui -lQt5Widgets
endif
LINK=-L${QT_LIB_DIR} ${QT_LIBS} -mwindows -lshlwapi -lole32 -lopengl32 -lglu32
# NOTE: If building using gcc/g++ with win32 thread model or a different
# toolchain than Qt was built with you may want to use static libgcc
# and libstdc++.
#LINK+= -static-libgcc -static-libstdc++
BASE_FLAGS+=-DWIN32
BINEXT=.${ARCH}.exe
else # ifeq mingw
#############################################################################
# SETUP AND BUILD -- MAC OS X
#############################################################################
ifeq ($(PLATFORM),darwin)
ifndef PREFIX
PREFIX=/usr/local
endif
ifndef QTDIR
QTDIR=/usr/local/Cellar/qt/5.11.1
endif
ifndef QT_BIN_DIR
QT_BIN_DIR=${QTDIR}/bin
endif
ifndef QT_INCLUDE_DIR
QT_INCLUDE_DIR=${QTDIR}/include
endif
ifndef QT_LIB_DIR
QT_LIB_DIR=${QTDIR}/lib
endif
ifndef QT_FRAMEWORKS_DIR
QT_FRAMEWORKS_DIR=${QTDIR}/lib
endif
ifndef QT_TRANSLATIONS_DIR
QT_TRANSLATIONS_DIR=${QTDIR}/translations
endif
ifndef QT_LIBS
QT_LIBS=
endif
ifndef QT_FRAMEWORKS
QT_FRAMEWORKS=-framework QtCore -framework QtGui -framework QtWidgets
endif
FRAMEWORKS=${QT_FRAMEWORKS} -framework OpenGL
LINK=-F${QT_FRAMEWORKS_DIR} ${FRAMEWORKS} -L${QT_LIB_DIR} ${QT_LIBS}
# Required for C++11 on macOS
BASE_FLAGS+=-stdlib=libc++
ifeq ($(ARCH),x86)
BASE_FLAGS += -m32
endif
BASE_FLAGS += -DPREFIX="\"$(PREFIX)\"" -DIS_OSX
# Set this to match Qt's minimum macOS deployment target.
ifdef MACOSX_VERSION_MIN
BASE_FLAGS += -mmacosx-version-min=${MACOSX_VERSION_MIN}
endif
MACOSX_DEPLOYMENT_TARGET=$(MACOSX_VERSION_MIN)
BASE_FLAGS += -F${QT_FRAMEWORKS_DIR}
BINEXT=.${ARCH}
TOOLS_BINEXT=
else # ifeq darwin
#############################################################################
# SETUP AND BUILD -- LINUX
#############################################################################
ifndef PREFIX
PREFIX=/usr/local
endif
ifdef QTDIR
ifndef QT_BIN_DIR
QT_BIN_DIR=${QTDIR}/bin
endif
ifndef QT_INCLUDE_DIR
QT_INCLUDE_DIR=${QTDIR}/include
endif
ifndef QT_LIB_DIR
QT_LIB_DIR=${QTDIR}/lib
endif
ifndef QT_TRANSLATIONS_DIR
QT_TRANSLATIONS_DIR=${QTDIR}/translations
endif
else
ifndef QT_BIN_DIR
ifeq ($(ARCH),x86)
QT_BIN_DIR=/usr/lib/i386-linux-gnu/qt5/bin
else
QT_BIN_DIR=/usr/lib/$(ARCH)-linux-gnu/qt5/bin
endif
endif
ifndef QT_INCLUDE_DIR
ifeq ($(ARCH),x86)
QT_INCLUDE_DIR=/usr/include/i386-linux-gnu/qt5
else
QT_INCLUDE_DIR=/usr/include/$(ARCH)-linux-gnu/qt5
endif
endif
ifndef QT_LIB_DIR
ifeq ($(ARCH),x86)
QT_LIB_DIR=/usr/lib/i386-linux-gnu
else
QT_LIB_DIR=/usr/lib/$(ARCH)-linux-gnu
endif
endif
ifndef QT_TRANSLATIONS_DIR
QT_TRANSLATIONS_DIR=/usr/share/qt5/translations/
endif
endif
ifndef QT_LIBS
QT_LIBS=-lQt5Core -lQt5Gui -lQt5Widgets
endif
LINK=-L${QT_LIB_DIR} ${QT_LIBS} -lGLU -lGL -ldl
ifeq ($(ARCH),x86)
# linux32 make ...
BASE_FLAGS += -m32
else
ifeq ($(ARCH),ppc64)
BASE_FLAGS += -m64
endif
endif
BASE_FLAGS += -DPREFIX="\"$(PREFIX)\""
BINEXT=.${ARCH}
TOOLS_BINEXT=
endif # darwin
endif # mingw
ifndef QT_BIN_DIR
$(error QT_BIN_DIR is not set)
endif
ifndef QT_INCLUDE_DIR
$(error QT_INCLUDE_DIR is not set)
endif
ifndef UIC
UIC=${QT_BIN_DIR}/uic${TOOLS_BINEXT}
endif
ifndef MOC
MOC=${QT_BIN_DIR}/moc${TOOLS_BINEXT}
endif
ifndef RCC
RCC=${QT_BIN_DIR}/rcc${TOOLS_BINEXT}
endif
ifndef LRELEASE
LRELEASE=${QT_BIN_DIR}/lrelease${TOOLS_BINEXT}
endif
ifndef LCONVERT
LCONVERT=${QT_BIN_DIR}/lconvert${TOOLS_BINEXT}
endif
ifndef WINDEPLOYQT
WINDEPLOYQT=${QT_BIN_DIR}/windeployqt${TOOLS_BINEXT}
endif
ifndef MACDEPLOYQT
MACDEPLOYQT=${QT_BIN_DIR}/macdeployqt${TOOLS_BINEXT}
endif
ifndef MINGW
# not for mingw because warning: -fPIC ignored for target (all code is position independent)
BASE_FLAGS+=-fPIC
endif
BASE_FLAGS+=-fno-math-errno -I${QT_INCLUDE_DIR} -DMM3D_EDIT -I. -I./src -I./src/libmm3d -I./src/mm3dcore -I./src/depui -I./src/qtui -I./src/implui -I./src/commands -I./src/tools -I${B}/depui -I${B}/qtui -I${B}/implui -I${B}/commands
# Generate dependencies (create .d files by the .o files)
BASE_FLAGS+=-MMD -MP
# Use debug or release cflags
#BUILD_FLAGS+=-Wall -Wextra -Wno-unused-parameter -Wno-format-zero-length -g -ggdb
#STRIP=
BUILD_FLAGS+=-Wall -Wextra -Wno-unused-parameter -Wno-format-zero-length -O2
STRIP=strip
CCFLAGS=-std=c99 ${BUILD_FLAGS} ${BASE_FLAGS}
CXXFLAGS=-std=c++11 ${BUILD_FLAGS} ${BASE_FLAGS}
# Use a native compiler for compiling build tools.
ifeq ($(CROSS_COMPILING),1)
TOOLS_CC=cc
else
TOOLS_CC=${CC}
endif
TOOLS_CCFLAGS=-std=c99 ${BUILD_FLAGS}
DEFS=
BIN=${B}
LIB_OBJ= \
${B}/libmm3d/bsptree.o \
${B}/libmm3d/cal3dfilter.o \
${B}/libmm3d/cmdlinemgr.o \
${B}/libmm3d/cobfilter.o \
${B}/libmm3d/d3dfilter.o \
${B}/libmm3d/datadest.o \
${B}/libmm3d/datasource.o \
${B}/libmm3d/filedatadest.o \
${B}/libmm3d/filedatasource.o \
${B}/libmm3d/memdatadest.o \
${B}/libmm3d/memdatasource.o \
${B}/libmm3d/dxffilter.o \
${B}/libmm3d/filefactory.o \
${B}/libmm3d/filtermgr.o \
${B}/libmm3d/glmath.o \
${B}/libmm3d/iqefilter.o \
${B}/libmm3d/log.o \
${B}/libmm3d/lwofilter.o \
${B}/libmm3d/md2filter.o \
${B}/libmm3d/md3filter.o \
${B}/libmm3d/mesh.o \
${B}/libmm3d/misc.o \
${B}/libmm3d/mlocale.o \
${B}/libmm3d/mm3dfilter.o \
${B}/libmm3d/mm3dport.o \
${B}/libmm3d/mm3dreg.o \
${B}/libmm3d/model.o \
${B}/libmm3d/model_anim.o \
${B}/libmm3d/model_bool.o \
${B}/libmm3d/model_copy.o \
${B}/libmm3d/model_draw.o \
${B}/libmm3d/model_group.o \
${B}/libmm3d/model_influence.o \
${B}/libmm3d/model_inner.o \
${B}/libmm3d/model_insert.o \
${B}/libmm3d/model_meta.o \
${B}/libmm3d/model_ops.o \
${B}/libmm3d/model_print.o \
${B}/libmm3d/model_proj.o \
${B}/libmm3d/model_select.o \
${B}/libmm3d/model_texture.o \
${B}/libmm3d/modelfilter.o \
${B}/libmm3d/modelstatus.o \
${B}/libmm3d/modelundo.o \
${B}/libmm3d/modelutil.o \
${B}/libmm3d/ms3dfilter.o \
${B}/libmm3d/msg.o \
${B}/libmm3d/objfilter.o \
${B}/libmm3d/pcxtex.o \
${B}/libmm3d/rawtex.o \
${B}/libmm3d/smdfilter.o \
${B}/libmm3d/texmgr.o \
${B}/libmm3d/texscale.o \
${B}/libmm3d/texture.o \
${B}/libmm3d/tgatex.o \
${B}/libmm3d/triprim.o \
${B}/libmm3d/txtfilter.o \
${B}/libmm3d/undo.o \
${B}/libmm3d/undomgr.o \
${B}/libmm3d/weld.o \
MM3D_UI= \
${B}/qtui/alignwin.base.h \
${B}/qtui/animconvertwin.base.h \
${B}/qtui/animeditwin.base.h \
${B}/qtui/animexportwin.base.h \
${B}/qtui/animsetwin.base.h \
${B}/qtui/animwidget.base.h \
${B}/qtui/autoassignjointwin.base.h \
${B}/qtui/backgroundselect.base.h \
${B}/qtui/backgroundwin.base.h \
${B}/qtui/boolwin.base.h \
${B}/qtui/contextgroup.base.h \
${B}/qtui/contextinfluences.base.h \
${B}/qtui/contextname.base.h \
${B}/qtui/contextposition.base.h \
${B}/qtui/contextprojection.base.h \
${B}/qtui/contextrotation.base.h \
${B}/qtui/extrudewin.base.h \
${B}/qtui/groupclean.base.h \
${B}/qtui/groupwin.base.h \
${B}/qtui/helpwin.base.h \
${B}/qtui/jointwin.base.h \
${B}/qtui/painttexturewin.base.h \
${B}/qtui/pointwin.base.h \
${B}/qtui/projectionwin.base.h \
${B}/qtui/keyvaluewin.base.h \
${B}/qtui/mapdirection.base.h \
${B}/qtui/mergewin.base.h \
${B}/qtui/metawin.base.h \
${B}/qtui/modelview.base.h \
${B}/qtui/newanim.base.h \
${B}/qtui/cal3dprompt.base.h \
${B}/qtui/iqeprompt.base.h \
${B}/qtui/md3prompt.base.h \
${B}/qtui/ms3dprompt.base.h \
${B}/qtui/objprompt.base.h \
${B}/qtui/smdprompt.base.h \
${B}/qtui/offsetwin.base.h \
${B}/qtui/pluginwin.base.h \
${B}/qtui/statusbar.base.h \
${B}/qtui/texturecoord.base.h \
${B}/qtui/textwin.base.h \
${B}/qtui/texwin.base.h \
${B}/qtui/transformwin.base.h \
${B}/qtui/valuewin.base.h \
${B}/qtui/viewportsettings.base.h \
\
${B}/qtui/resources.cpp
MM3D_MOC= \
${B}/implui/alignwin.moc.cc \
${B}/implui/aboutwin.moc.cc \
${B}/implui/animconvertwin.moc.cc \
${B}/implui/animeditwin.moc.cc \
${B}/implui/animexportwin.moc.cc \
${B}/implui/animsetwin.moc.cc \
${B}/implui/animwidget.moc.cc \
${B}/implui/animwin.moc.cc \
${B}/implui/autoassignjointwin.moc.cc \
${B}/implui/backgroundselect.moc.cc \
${B}/implui/backgroundwin.moc.cc \
${B}/implui/boolpanel.moc.cc \
${B}/implui/boolwin.moc.cc \
${B}/implui/contextinfluences.moc.cc \
${B}/implui/contextname.moc.cc \
${B}/implui/contextpanel.moc.cc \
${B}/implui/contextposition.moc.cc \
${B}/implui/contextprojection.moc.cc \
${B}/implui/contextrotation.moc.cc \
${B}/tools/cubetoolwidget.moc.cc \
${B}/tools/cylindertoolwidget.moc.cc \
${B}/tools/ellipsetoolwidget.moc.cc \
${B}/depui/errorobj.moc.cc \
${B}/implui/extrudewin.moc.cc \
${B}/implui/groupclean.moc.cc \
${B}/implui/groupwin.moc.cc \
${B}/implui/helpwin.moc.cc \
${B}/implui/jointwin.moc.cc \
${B}/implui/painttexturewin.moc.cc \
${B}/implui/pointwin.moc.cc \
${B}/implui/projectionwin.moc.cc \
${B}/implui/keyvaluewin.moc.cc \
${B}/implui/licensewin.moc.cc \
${B}/implui/mergewin.moc.cc \
${B}/implui/metawin.moc.cc \
${B}/implui/mview.moc.cc \
${B}/depui/modelviewport.moc.cc \
${B}/implui/newanim.moc.cc \
${B}/implui/cal3dprompt.moc.cc \
${B}/implui/iqeprompt.moc.cc \
${B}/implui/md3prompt.moc.cc \
${B}/implui/ms3dprompt.moc.cc \
${B}/implui/objprompt.moc.cc \
${B}/implui/smdprompt.moc.cc \
${B}/implui/offsetwin.moc.cc \
${B}/implui/pluginwin.moc.cc \
${B}/tools/polytoolwidget.moc.cc \
${B}/tools/projtoolwidget.moc.cc \
${B}/tools/scaletoolwidget.moc.cc \
${B}/tools/selectfacetoolwidget.moc.cc \
${B}/implui/spherifywin.moc.cc \
${B}/implui/statusbar.moc.cc \
${B}/depui/textureframe.moc.cc \
${B}/implui/texturecoord.moc.cc \
${B}/depui/texwidget.moc.cc \
${B}/implui/texwin.moc.cc \
${B}/implui/transformwin.moc.cc \
${B}/implui/valuewin.moc.cc \
${B}/implui/viewportsettings.moc.cc \
${B}/implui/viewpanel.moc.cc \
${B}/implui/viewwin.moc.cc \
MM3D_MOC_OBJ= \
${B}/implui/alignwin.moc.o \
${B}/implui/aboutwin.moc.o \
${B}/implui/animconvertwin.moc.o \
${B}/implui/animeditwin.moc.o \
${B}/implui/animexportwin.moc.o \
${B}/implui/animsetwin.moc.o \
${B}/implui/animwidget.moc.o \
${B}/implui/animwin.moc.o \
${B}/implui/autoassignjointwin.moc.o \
${B}/implui/backgroundselect.moc.o \
${B}/implui/backgroundwin.moc.o \
${B}/implui/boolpanel.moc.o \
${B}/implui/boolwin.moc.o \
${B}/implui/contextgroup.moc.o \
${B}/implui/contextinfluences.moc.o \
${B}/implui/contextname.moc.o \
${B}/implui/contextpanel.moc.o \
${B}/implui/contextposition.moc.o \
${B}/implui/contextprojection.moc.o \
${B}/implui/contextrotation.moc.o \
${B}/tools/cubetoolwidget.moc.o \
${B}/tools/cylindertoolwidget.moc.o \
${B}/tools/ellipsetoolwidget.moc.o \
${B}/tools/rotatetoolwidget.moc.o \
${B}/tools/torustoolwidget.moc.o \
${B}/tools/toolwidget.moc.o \
${B}/depui/errorobj.moc.o \
${B}/implui/extrudewin.moc.o \
${B}/implui/groupclean.moc.o \
${B}/implui/groupwin.moc.o \
${B}/implui/helpwin.moc.o \
${B}/implui/jointwin.moc.o \
${B}/implui/painttexturewin.moc.o \
${B}/implui/pointwin.moc.o \
${B}/implui/projectionwin.moc.o \
${B}/implui/keyvaluewin.moc.o \
${B}/implui/licensewin.moc.o \
${B}/implui/mapdirection.moc.o \
${B}/implui/mergewin.moc.o \
${B}/implui/metawin.moc.o \
${B}/implui/mview.moc.o \
${B}/depui/modelviewport.moc.o \
${B}/implui/newanim.moc.o \
${B}/implui/cal3dprompt.moc.o \
${B}/implui/iqeprompt.moc.o \
${B}/implui/md3prompt.moc.o \
${B}/implui/ms3dprompt.moc.o \
${B}/implui/objprompt.moc.o \
${B}/implui/smdprompt.moc.o \
${B}/implui/offsetwin.moc.o \
${B}/implui/pluginwin.moc.o \
${B}/tools/polytoolwidget.moc.o \
${B}/tools/projtoolwidget.moc.o \
${B}/tools/scaletoolwidget.moc.o \
${B}/tools/selectfacetoolwidget.moc.o \
${B}/implui/spherifywin.moc.o \
${B}/implui/statusbar.moc.o \
${B}/depui/textureframe.moc.o \
${B}/implui/texturecoord.moc.o \
${B}/depui/texwidget.moc.o \
${B}/implui/texwin.moc.o \
${B}/implui/transformwin.moc.o \
${B}/implui/valuewin.moc.o \
${B}/implui/viewportsettings.moc.o \
${B}/implui/viewpanel.moc.o \
${B}/implui/viewwin.moc.o \
MM3D_OBJ= \
${B}/src/3dm.o \
${B}/mm3dcore/3dmprefs.o \
${B}/implui/aboutwin.o \
${B}/mm3dcore/align.o \
${B}/commands/aligncmd.o \
${B}/implui/alignwin.o \
${B}/mm3dcore/allocstats.o \
${B}/implui/animconvertwin.o \
${B}/implui/animeditwin.o \
${B}/implui/animexportwin.o \
${B}/implui/animsetwin.o \
${B}/implui/animwidget.o \
${B}/implui/animwin.o \
${B}/tools/atrfartool.o \
${B}/tools/atrneartool.o \
${B}/implui/autoassignjointwin.o \
${B}/implui/backgroundselect.o \
${B}/implui/backgroundwin.o \
${B}/implui/boolpanel.o \
${B}/implui/boolwin.o \
${B}/implui/contextgroup.o \
${B}/implui/contextinfluences.o \
${B}/implui/contextname.o \
${B}/implui/contextpanel.o \
${B}/implui/contextposition.o \
${B}/implui/contextprojection.o \
${B}/implui/contextrotation.o \
${B}/mm3dcore/contextwidget.o \
${B}/mm3dcore/contextpanelobserver.o \
${B}/tools/bgmovetool.o \
${B}/tools/bgscaletool.o \
${B}/mm3dcore/bounding.o \
${B}/mm3dcore/cmdline.o \
${B}/mm3dcore/cmdmgr.o \
${B}/mm3dcore/command.o \
${B}/commands/capcmd.o \
${B}/commands/copycmd.o \
${B}/tools/cubetool.o \
${B}/tools/cubetoolwidget.o \
${B}/tools/cylindertool.o \
${B}/tools/cylindertoolwidget.o \
${B}/mm3dcore/decal.o \
${B}/mm3dcore/decalmgr.o \
${B}/commands/deletecmd.o \
${B}/commands/dupcmd.o \
${B}/commands/edgedivcmd.o \
${B}/commands/edgeturncmd.o \
${B}/tools/ellipsetool.o \
${B}/tools/ellipsetoolwidget.o \
${B}/tools/extrudetool.o \
${B}/depui/errorobj.o \
${B}/commands/extrudecmd.o \
${B}/implui/extrudewin.o \
${B}/commands/faceoutcmd.o \
${B}/commands/flattencmd.o \
${B}/commands/flipcmd.o \
${B}/implui/groupclean.o \
${B}/implui/groupwin.o \
${B}/implui/helpwin.o \
${B}/commands/hidecmd.o \
${B}/commands/invertcmd.o \
${B}/commands/invnormalcmd.o \
${B}/tools/jointtool.o \
${B}/tools/pointtool.o \
${B}/tools/projtool.o \
${B}/implui/jointwin.o \
${B}/implui/painttexturewin.o \
${B}/implui/pointwin.o \
${B}/implui/projectionwin.o \
${B}/implui/keycfg.o \
${B}/implui/keyvaluewin.o \
${B}/implui/licensewin.o \
${B}/mm3dcore/luaif.o \
${B}/mm3dcore/luascript.o \
${B}/commands/makefacecmd.o \
${B}/implui/mapdirection.o \
${B}/implui/mergewin.o \
${B}/implui/metawin.o \
${B}/tools/movetool.o \
${B}/implui/msgqt.o \
${B}/implui/mview.o \
${B}/depui/modelviewport.o \
${B}/commands/pastecmd.o \
${B}/mm3dcore/pluginmgr.o \
${B}/implui/newanim.o \
${B}/implui/cal3dprompt.o \
${B}/implui/iqeprompt.o \
${B}/implui/md3prompt.o \
${B}/implui/ms3dprompt.o \
${B}/implui/objprompt.o \
${B}/implui/smdprompt.o \
${B}/implui/pluginwin.o \
${B}/commands/offsetcmd.o \
${B}/implui/offsetwin.o \
${B}/tools/polytool.o \
${B}/tools/polytoolwidget.o \
${B}/tools/projtoolwidget.o \
${B}/mm3dcore/prefparse.o \
${B}/mm3dcore/prefs.o \
${B}/implui/qtmain.o \
${B}/implui/qttex.o \
${B}/tools/rectangletool.o \
${B}/qtui/resources.o \
${B}/mm3dcore/rotatepoint.o \
${B}/commands/rotatetexcmd.o \
${B}/tools/rotatetool.o \
${B}/tools/scaletool.o \
${B}/tools/scaletoolwidget.o \
${B}/tools/selectfacetoolwidget.o \
${B}/mm3dcore/scriptif.o \
${B}/tools/selectbonetool.o \
${B}/tools/selectpointtool.o \
${B}/tools/selectprojtool.o \
${B}/tools/selectconnectedtool.o \
${B}/tools/selectfacetool.o \
${B}/tools/selectgrouptool.o \
${B}/tools/selectvertextool.o \
${B}/tools/sheartool.o \
${B}/commands/selectfreecmd.o \
${B}/commands/simplifycmd.o \
${B}/commands/snapcmd.o \
${B}/commands/spherifycmd.o \
${B}/implui/spherifywin.o \
${B}/implui/statusbar.o \
${B}/src/stdcmds.o \
${B}/src/stdfilters.o \
${B}/src/stdtexfilters.o \
${B}/src/stdtools.o \
${B}/commands/subdividecmd.o \
${B}/mm3dcore/sysconf.o \
${B}/depui/textureframe.o \
${B}/implui/texturecoord.o \
${B}/mm3dcore/texturetest.o \
${B}/depui/texwidget.o \
${B}/implui/texwin.o \
${B}/implui/transformwin.o \
${B}/implui/transimp.o \
${B}/libmm3d/translate.o \
${B}/mm3dcore/tool.o \
${B}/mm3dcore/toolbox.o \
${B}/mm3dcore/toolpoly.o \
${B}/tools/rotatetoolwidget.o \
${B}/tools/torustool.o \
${B}/tools/torustoolwidget.o \
${B}/tools/toolwidget.o \
${B}/commands/unweldcmd.o \
${B}/implui/valuewin.o \
${B}/tools/vertextool.o \
${B}/tools/dragvertextool.o \
${B}/implui/viewportsettings.o \
${B}/implui/viewpanel.o \
${B}/implui/viewwin.o \
${B}/implui/viewwin_influences.o \
${B}/commands/weldcmd.o
QMFILES = \
${B}/translations/mm3d_de.qm \
${B}/translations/mm3d_fr.qm \
${B}/translations/mm3d_sk.qm \
${B}/translations/mm3d_ref.qm \
${B}/translations/mm3d_bork.qm
MM3D_HTML = \
${B}/doc/html/olh_detailsindex.html \
${B}/doc/html/olh_vertexdetails.html \
${B}/doc/html/olh_facedetails.html \
${B}/doc/html/olh_meshdetails.html \
${B}/doc/html/olh_normaldetails.html \
${B}/doc/html/olh_groupdetails.html \
${B}/doc/html/olh_materialdetails.html \
${B}/doc/html/olh_texturecoorddetails.html \
${B}/doc/html/olh_projectiondetails.html \
${B}/doc/html/olh_jointdetails.html \
${B}/doc/html/olh_pointdetails.html \
${B}/doc/html/olh_animationdetails.html \
${B}/doc/html/olh_backgroundimagedetails.html \
${B}/doc/html/olh_alignwin.html \
${B}/doc/html/olh_animconvertwin.html \
${B}/doc/html/olh_animexportwin.html \
${B}/doc/html/olh_animsetwin.html \
${B}/doc/html/olh_animwin.html \
${B}/doc/html/olh_autoassignjointwin.html \
${B}/doc/html/olh_backgroundwin.html \
${B}/doc/html/olh_boolwin.html \
${B}/doc/html/olh_cmdline.html \
${B}/doc/html/olh_commands.html \
${B}/doc/html/olh_develop.html \
${B}/doc/html/olh_quakemd2.html \
${B}/doc/html/olh_quakemd3.html \
${B}/doc/html/olh_cal3d.html \
${B}/doc/html/olh_groupwin.html \
${B}/doc/html/olh_index.html \
${B}/doc/html/olh_influences.html \
${B}/doc/html/olh_jointwin.html \
${B}/doc/html/olh_license.html \
${B}/doc/html/olh_mergewin.html \
${B}/doc/html/olh_metawin.html \
${B}/doc/html/olh_mm3dformat.html \
${B}/doc/html/olh_cal3dprompt.html \
${B}/doc/html/olh_ms3dprompt.html \
${B}/doc/html/olh_objprompt.html \
${B}/doc/html/olh_iqeprompt.html \
${B}/doc/html/olh_quakemd3prompt.html \
${B}/doc/html/olh_smdprompt.html \
${B}/doc/html/olh_offsetwin.html \
${B}/doc/html/olh_painttexturewin.html \
${B}/doc/html/olh_pointwin.html \
${B}/doc/html/olh_pluginwin.html \
${B}/doc/html/olh_projectionwin.html \
${B}/doc/html/olh_properties.html \
${B}/doc/html/olh_spherifywin.html \
${B}/doc/html/olh_texturecoordwin.html \
${B}/doc/html/olh_texturewin.html \
${B}/doc/html/olh_tips.html \
${B}/doc/html/olh_tools.html \
${B}/doc/html/olh_tutorial_index.html \
${B}/doc/html/olh_transformwin.html \
${B}/doc/html/olh_viewportsettings.html \
${B}/doc/html/olh_whatsnew.html \
${B}/doc/html/olh_mainwin.html
ifeq (${V},1)
echo_cmd=@:
Q=
else
echo_cmd=@echo
Q=@
endif
define DO_CC
$(echo_cmd) "CC $<"
$(Q)${CC} ${DEFS} -c $< -o $@ ${CCFLAGS}
endef
define DO_TOOLS_CC
$(echo_cmd) "TOOLS CC $<"
$(Q)${TOOLS_CC} -c $< -o $@ ${TOOLS_CCFLAGS}
endef
define DO_CXX
$(echo_cmd) "CXX $<"
$(Q)${CXX} ${DEFS} -c $< -o $@ ${CXXFLAGS}
endef
define DO_UIC
$(echo_cmd) "UIC $<"
$(Q)${UIC} $< -o $@
endef
define DO_MOC
$(echo_cmd) "MOC $<"
$(Q)${MOC} $< -o $@
endef
define DO_LRELEASE
$(echo_cmd) "LRELEASE $<"
$(Q)${LRELEASE} $< -qm $@
endef
define DO_HTML
$(echo_cmd) "HTML $<"
$(Q)${B_TOOLS}/util/hpagemake${BINEXT} $< > $@
endef
.PHONY: all makedirs mm3d_ui mm3d_moc mm3d qmfiles hpagemake docs install deploy installer clean
all: makedirs mm3d_ui mm3d_moc mm3d qmfiles hpagemake docs
# mingw.org's mingw32-make.exe uses Window's command processing and mkdir
makedirs:
ifdef MINGW32_MAKE
@IF NOT EXIST "${BUILD}\${BUILDSUB}" ${MKDIR} "${BUILD}\${BUILDSUB}"
@IF NOT EXIST "${BUILD}\${BUILDSUB}\src" ${MKDIR} "${BUILD}\${BUILDSUB}\src"
@IF NOT EXIST "${BUILD}\${BUILDSUB}\depui" ${MKDIR} "${BUILD}\${BUILDSUB}\depui"
@IF NOT EXIST "${BUILD}\${BUILDSUB}\implui" ${MKDIR} "${BUILD}\${BUILDSUB}\implui"
@IF NOT EXIST "${BUILD}\${BUILDSUB}\qtui" ${MKDIR} "${BUILD}\${BUILDSUB}\qtui"
@IF NOT EXIST "${BUILD}\${BUILDSUB}\tools" ${MKDIR} "${BUILD}\${BUILDSUB}\tools"
@IF NOT EXIST "${BUILD}\${BUILDSUB}\libmm3d" ${MKDIR} "${BUILD}\${BUILDSUB}\libmm3d"
@IF NOT EXIST "${BUILD}\${BUILDSUB}\mm3dcore" ${MKDIR} "${BUILD}\${BUILDSUB}\mm3dcore"
@IF NOT EXIST "${BUILD}\${BUILDSUB}\commands" ${MKDIR} "${BUILD}\${BUILDSUB}\commands"
@IF NOT EXIST "${BUILD}\${BUILDSUB}\translations" ${MKDIR} "${BUILD}\${BUILDSUB}\translations"
@IF NOT EXIST "${BUILD}\${BUILDSUB}\doc" ${MKDIR} "${BUILD}\${BUILDSUB}\doc"
@IF NOT EXIST "${BUILD}\${BUILDSUB}\doc\html" ${MKDIR} "${BUILD}\${BUILDSUB}\doc\html"
@IF NOT EXIST "${BUILD}\${BUILDSUB_TOOLS}" ${MKDIR} "${BUILD}\${BUILDSUB_TOOLS}"
@IF NOT EXIST "${BUILD}\${BUILDSUB_TOOLS}\util" ${MKDIR} "${BUILD}\${BUILDSUB_TOOLS}\util"
else
@${MKDIR} "${B}"
@${MKDIR} "${B}/src"
@${MKDIR} "${B}/depui"
@${MKDIR} "${B}/implui"
@${MKDIR} "${B}/qtui"
@${MKDIR} "${B}/tools"
@${MKDIR} "${B}/libmm3d"
@${MKDIR} "${B}/mm3dcore"
@${MKDIR} "${B}/commands"
@${MKDIR} "${B}/translations"
@${MKDIR} "${B}/doc"
@${MKDIR} "${B}/doc/html"
@${MKDIR} "${B_TOOLS}"
@${MKDIR} "${B_TOOLS}/util"
endif
mm3d_ui: ${MM3D_UI}
mm3d_moc: ${MM3D_MOC}
qmfiles: ${QMFILES}
${B_TOOLS}/util/hpagemake${BINEXT}: ${B_TOOLS}/util/hpagemake.o
$(Q)${TOOLS_CC} ${TOOLS_CCFLAGS} -o ${B_TOOLS}/util/hpagemake${BINEXT} ${B_TOOLS}/util/hpagemake.o
hpagemake: ${B_TOOLS}/util/hpagemake${BINEXT}
docs: hpagemake ${MM3D_HTML}
$(BIN)/mm3d${BINEXT}: ${MM3D_MOC_OBJ} ${LIB_OBJ} ${MM3D_OBJ}
$(echo_cmd) "LINKING $(BIN)/mm3d${BINEXT}"
ifdef MINGW
ifdef MINGW32_MAKE
$(Q)${WINDRES} --preprocessor="$(CC) -E -xc-header -DRC_INVOKED" src/win_resource.rc ${B}/src/win_resource.o
else
$(Q)${WINDRES} src/win_resource.rc ${B}/src/win_resource.o
endif
$(Q)${CXX} ${CXXFLAGS} ${DEFS} -o $(BIN)/mm3d${BINEXT} ${MM3D_OBJ} ${MM3D_MOC_OBJ} ${LIB_OBJ} ${B}/src/win_resource.o ${LINK}
else
$(Q)${CXX} ${CXXFLAGS} ${DEFS} -o $(BIN)/mm3d${BINEXT} ${MM3D_OBJ} ${MM3D_MOC_OBJ} ${LIB_OBJ} ${LINK}
endif
ifdef STRIP
$(echo_cmd) "STRIP $(BIN)/mm3d${BINEXT}"
$(Q)$(STRIP) $(BIN)/mm3d${BINEXT}
endif
mm3d: $(BIN)/mm3d${BINEXT}
# make install doesn't work for mingw32-make.exe because it's case insenitive and autotools requires INSTALL file.