]> Shamusworld >> Repos - virtualjaguar/blob - Makefile
Virtual Jaguar 2.0.0 release.
[virtualjaguar] / 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 # Gah
13 OSTYPE := $(shell uname -a)
14
15 # Should catch both 'darwin' and 'darwin7.0'
16 ifeq "$(findstring Darwin,$(OSTYPE))" "Darwin"
17 QMAKE_EXTRA := -spec macx-g++
18 endif
19
20
21 all: prepare virtualjaguar
22         @echo -e "\033[01;33m***\033[00;32m Success!\033[00m"
23
24 prepare:
25         @echo -e "\033[01;33m***\033[00;32m Preparing to compile Virtual Jaguar...\033[00m"
26         @echo "#define VJ_RELEASE_VERSION \"v2.0.0\"" > src/version.h
27         @echo "#define VJ_RELEASE_SUBVERSION \"Final\"" >> src/version.h
28 #       @echo "#define VJ_RELEASE_VERSION \"SVN `svn info | grep -i revision`\"" > src/version.h
29 #       @echo "#define VJ_RELEASE_SUBVERSION \"2.0.0 Prerelease\"" >> src/version.h
30
31 virtualjaguar: sources libs makefile-qt
32         @echo -e "\033[01;33m***\033[00;32m Making Virtual Jaguar GUI...\033[00m"
33         $(MAKE) -f makefile-qt
34
35 makefile-qt: virtualjaguar.pro
36         @echo -e "\033[01;33m***\033[00;32m Creating Qt makefile...\033[00m"
37         qmake $(QMAKE_EXTRA) virtualjaguar.pro -o makefile-qt
38
39 libs: obj/libmusashi.a obj/libjaguarcore.a
40         @echo -e "\033[01;33m***\033[00;32m Libraries successfully made.\033[00m"
41
42 obj/libmusashi.a: musashi.mak sources
43         @echo -e "\033[01;33m***\033[00;32m Making Musashi...\033[00m"
44         $(MAKE) -f musashi.mak
45
46 obj/libjaguarcore.a: jaguarcore.mak sources
47         @echo -e "\033[01;33m***\033[00;32m Making Virtual Jaguar core...\033[00m"
48         $(MAKE) -f jaguarcore.mak
49
50 sources: src/*.h src/*.cpp src/*.c
51
52 clean:
53         @echo -ne "\033[01;33m***\033[00;32m Cleaning out the garbage...\033[00m"
54         @-rm -rf ./obj
55         @-rm -rf makefile-qt
56         @-rm -rf virtualjaguar
57         @-$(FIND) . -name "*~" -exec rm -f {} \;
58         @echo "done!"
59
60 statistics:
61         @echo -n "Lines in source files: "
62         @-$(FIND) ./src -name "*.cpp" | xargs cat | wc -l
63         @echo -n "Lines in header files: "
64         @-$(FIND) ./src -name "*.h" | xargs cat | wc -l
65
66 dist:   clean