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