x86 configuration removed in the VS 2017 project
[clinton/Virtual-Jaguar-Rx.git] / Makefile
1 # Makefile for Virtual Jaguar
2 #
3 # by James Hammons
4 # (C) 2011 Underground Software
5 #
6 # Note that we control the version information here--uncomment only one set of
7 # echo's from the "prepare" recipe. :-)
8 #
9
10 FIND = find
11
12 ifeq ("$(V)","1")
13 Q :=
14 else
15 Q := @
16 endif
17
18 # Gah
19 OSTYPE := $(shell uname -a)
20
21 # Should catch both 'darwin' and 'darwin7.0'
22 ifeq "$(findstring Darwin,$(OSTYPE))" "Darwin"
23 QMAKE_EXTRA := -spec macx-g++
24 endif
25
26 # Set basic flags, these can be overridden from the environment
27 CFLAGS = -O2
28 CXXFLAGS = -O2
29
30 # Add CPPFLAGS
31 CFLAGS += $(CPPFLAGS)
32 CXXFLAGS += $(CPPFLAGS)
33
34 # Without these flags, Virtual Jaguar will run very slow.
35 CFLAGS += -ffast-math -fomit-frame-pointer
36 CXXFLAGS += -ffast-math -fomit-frame-pointer
37
38 # Flags to pass on to qmake...
39 QMAKE_EXTRA += "QMAKE_CFLAGS_RELEASE=$(CFLAGS)"
40 QMAKE_EXTRA += "QMAKE_CXXFLAGS_RELEASE=$(CXXFLAGS)"
41 QMAKE_EXTRA += "QMAKE_LFLAGS_RELEASE=$(LDFLAGS)"
42
43 QMAKE_EXTRA += "QMAKE_CFLAGS_DEBUG=$(CFLAGS)"
44 QMAKE_EXTRA += "QMAKE_CXXFLAGS_DEBUG=$(CXXFLAGS)"
45 QMAKE_EXTRA += "QMAKE_LFLAGS_DEBUG=$(LDFLAGS)"
46
47
48 all: prepare virtualjaguar
49 @echo -e "\033[01;33m***\033[00;32m Success!\033[00m"
50
51 obj:
52 @mkdir obj
53
54 prepare: obj
55 @echo -e "\033[01;33m***\033[00;32m Preparing to compile Virtual Jaguar...\033[00m"
56 @echo "#define VJ_RELEASE_VERSION \"v2.1.3\"" > src/version.h
57 @echo "#define VJ_RELEASE_SUBVERSION \"Final\"" >> src/version.h
58 @echo "#define VJ_REMOVE_DEV_CODE" >> src/version.h
59 # @echo "#define VJ_RELEASE_VERSION \"GIT `git log -1 --pretty=format:%ci | cut -d ' ' -f 1 | tr -d -`\"" > src/version.h
60 # @echo "#define VJ_RELEASE_SUBVERSION \"2.1.4 Prerelease\"" >> src/version.h
61
62 virtualjaguar: sources libs makefile-qt
63 @echo -e "\033[01;33m***\033[00;32m Making Virtual Jaguar GUI...\033[00m"
64 $(Q)$(MAKE) -f makefile-qt CROSS=$(CROSS) V="$(V)"
65
66 makefile-qt: virtualjaguar.pro
67 @echo -e "\033[01;33m***\033[00;32m Creating Qt makefile...\033[00m"
68 $(Q)$(CROSS)qmake $(QMAKE_EXTRA) virtualjaguar.pro -o makefile-qt
69
70 libs: obj/libm68k.a obj/libjaguarcore.a
71 @echo -e "\033[01;33m***\033[00;32m Libraries successfully made.\033[00m"
72
73 obj/libm68k.a: src/m68000/Makefile sources
74 @echo -e "\033[01;33m***\033[00;32m Making Customized UAE 68K Core...\033[00m"
75 $(Q)$(MAKE) -C src/m68000 CROSS=$(CROSS) CFLAGS="$(CFLAGS)" V="$(V)"
76 $(Q)cp src/m68000/obj/libm68k.a obj/
77
78 obj/libjaguarcore.a: jaguarcore.mak sources
79 @echo -e "\033[01;33m***\033[00;32m Making Virtual Jaguar core...\033[00m"
80 $(Q)$(MAKE) -f jaguarcore.mak CROSS=$(CROSS) CFLAGS="$(CFLAGS)" CXXFLAGS="$(CXXFLAGS)" V="$(V)"
81
82 sources: src/*.h src/*.cpp src/m68000/*.c src/m68000/*.h
83
84 clean:
85 @echo -ne "\033[01;33m***\033[00;32m Cleaning out the garbage...\033[00m"
86 @-rm -rf ./obj
87 @-rm -rf ./src/m68000/obj
88 @-rm -rf makefile-qt
89 @-rm -rf virtualjaguar
90 @-$(FIND) . -name "*~" -exec rm -f {} \;
91 @echo "done!"
92
93 statistics:
94 @echo -n "Lines in source files: "
95 @-$(FIND) ./src -name "*.cpp" | xargs cat | wc -l
96 @echo -n "Lines in header files: "
97 @-$(FIND) ./src -name "*.h" | xargs cat | wc -l
98
99 dist: clean