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