rnd-20040619-1-src
[rocksndiamonds.git] / Makefile
1 # =============================================================================
2 # Rocks'n'Diamonds Makefile
3 # -----------------------------------------------------------------------------
4 # (c) 1995-2003 Holger Schemel <info@artsoft.org>
5 # =============================================================================
6
7 # -----------------------------------------------------------------------------
8 # configuration
9 # -----------------------------------------------------------------------------
10
11 # command name of your favorite ANSI C compiler
12 # (this must be set to "cc" for some systems)
13 CC = gcc
14
15 # command name of GNU make on your system
16 # (this must be set to "gmake" for some systems)
17 MAKE = make
18
19 # path to X11 on your system
20 X11_PATH = /usr/X11R6
21
22 # directory for read-only game data (like graphics, sounds, levels)
23 # default is '.' to be able to run program without installation
24 # RO_GAME_DIR = /usr/games
25
26 # directory for writable game data (like highscore files)
27 # default is '.' to be able to run program without installation
28 # RW_GAME_DIR = /var/games
29
30 # uncomment if system has no joystick include file
31 # JOYSTICK = -DNO_JOYSTICK
32
33 # choose if more than one global score file entry for one player is allowed
34 # (default: MANY_PER_NAME)
35 # uncomment to install game in multi-user environment
36 # SCORE_ENTRIES = ONE_PER_NAME
37 # uncomment to install game in single-user environment (default)
38 # SCORE_ENTRIES = MANY_PER_NAME
39
40 # paths for cross-compiling (only needed for non-native MS-DOS and Win32 build)
41 CROSS_PATH_MSDOS=/usr/local/cross-msdos/i386-msdosdjgpp
42 CROSS_PATH_WIN32=/usr/local/cross-tools/i386-mingw32msvc
43
44 # -----------------------------------------------------------------------------
45 # there should be no need to change anything below
46 # -----------------------------------------------------------------------------
47
48 .EXPORT_ALL_VARIABLES:
49
50 SRC_DIR = src
51 MAKE_CMD = $(MAKE) -C $(SRC_DIR)
52
53 # DEFAULT_TARGET = x11
54 DEFAULT_TARGET = sdl
55
56
57 # -----------------------------------------------------------------------------
58 # build targets
59 # -----------------------------------------------------------------------------
60
61 all:
62         @$(MAKE_CMD) TARGET=$(DEFAULT_TARGET)
63
64 x11:
65         @$(MAKE_CMD) TARGET=x11
66
67 sdl:
68         @$(MAKE_CMD) TARGET=sdl
69
70 solaris:
71         @$(MAKE_CMD) PLATFORM=solaris TARGET=x11
72
73 solaris-sdl:
74         @$(MAKE_CMD) PLATFORM=solaris TARGET=sdl
75
76 mac:
77         @$(MAKE_CMD) PLATFORM=macosx
78
79 msdos:
80         @$(MAKE_CMD) PLATFORM=msdos
81
82 os2:
83         @$(MAKE_CMD) PLATFORM=os2
84
85 cross-msdos:
86         @PATH=$(CROSS_PATH_MSDOS)/bin:${PATH} $(MAKE_CMD) PLATFORM=cross-msdos
87
88 cross-win32:
89         @PATH=$(CROSS_PATH_WIN32)/bin:${PATH} $(MAKE_CMD) PLATFORM=cross-win32
90
91 clean:
92         @$(MAKE_CMD) clean
93
94
95 # -----------------------------------------------------------------------------
96 # development only
97 # -----------------------------------------------------------------------------
98
99 auto-conf:
100         @$(MAKE_CMD) auto-conf
101
102 run: all
103         @./rocksndiamonds --verbose
104
105 gdb: all
106         @gdb ./rocksndiamonds
107
108 valgrind: all
109         @valgrind -v --leak-check=yes ./rocksndiamonds 2> valgrind.out
110
111 enginetest: all
112         ./Scripts/make_enginetest.sh
113
114 enginetestcustom: all
115         ./Scripts/make_enginetest.sh custom
116
117 enginetestfast: all
118         ./Scripts/make_enginetest.sh fast
119
120 enginetestnew: all
121         ./Scripts/make_enginetest.sh new
122
123 backup:
124         ./Scripts/make_backup.sh src
125
126 backup_lev:
127         ./Scripts/make_backup.sh lev
128
129 backup_gfx:
130         ./Scripts/make_backup.sh gfx
131
132 dist-unix:
133         ./Scripts/make_dist.sh unix .
134
135 dist-msdos:
136         ./Scripts/make_dist.sh dos .
137
138 dist-win32:
139         ./Scripts/make_dist.sh win .
140
141 dist-macosx:
142         ./Scripts/make_dist.sh mac . $(MAKE)
143
144 upload-unix:
145         ./Scripts/make_dist.sh unix . upload
146
147 upload-msdos:
148         ./Scripts/make_dist.sh dos . upload
149
150 upload-win32:
151         ./Scripts/make_dist.sh win . upload
152
153 upload-macosx:
154         ./Scripts/make_dist.sh mac . upload
155
156 dist-clean:
157         @$(MAKE_CMD) dist-clean
158
159 dist-build-unix:
160         @BUILD_DIST=TRUE $(MAKE) x11
161
162 dist-build-win32:
163         @BUILD_DIST=TRUE $(MAKE) cross-win32
164
165 dist-build-msdos:
166         @BUILD_DIST=TRUE $(MAKE) cross-msdos
167
168 dist-build-all:
169         $(MAKE) clean
170         $(MAKE) dist-build-unix         ; $(MAKE) dist-clean
171         $(MAKE) dist-build-win32        ; $(MAKE) dist-clean
172         $(MAKE) dist-build-msdos        ; $(MAKE) dist-clean
173
174 dist-all: dist-build-all dist-unix dist-msdos dist-win32 dist-macosx
175
176 upload-all: upload-unix upload-msdos upload-win32 upload-macosx
177
178 depend dep:
179         $(MAKE_CMD) depend