Subversion Repositories eduke32

Rev

Rev 4987 | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 4987 Rev 5037
1
#
1
#
2
# EDuke32 Makefile for GNU Make
2
# EDuke32 Makefile for GNU Make
3
#
3
#
4
4
5
include Makefile.common
5
include Makefile.common
6
6
7
DUKE3D_SRC=source
7
DUKE3D_SRC=source
8
DUKE3D_INC=$(DUKE3D_SRC)
8
DUKE3D_INC=$(DUKE3D_SRC)
9
DUKE3D_RSRC=rsrc
9
DUKE3D_RSRC=rsrc
10
ENGINE_ROOT=build
10
ENGINE_ROOT=build
11
ENGINE_SRC=$(ENGINE_ROOT)/src
11
ENGINE_SRC=$(ENGINE_ROOT)/src
12
ENGINE_INC=$(ENGINE_ROOT)/include
12
ENGINE_INC=$(ENGINE_ROOT)/include
13
o=o
13
o=o
14
asm=nasm
14
asm=nasm
15
obj=obj
15
obj=obj
16
16
17
COMPILERFLAGS += -I$(ENGINE_INC) -I$(DUKE3D_SRC)/jmact -I$(AUDIOLIB_ROOT)/include -I$(ENET_ROOT)/include
17
COMPILERFLAGS += -I$(ENGINE_INC) -I$(DUKE3D_SRC)/jmact -I$(AUDIOLIB_ROOT)/include -I$(ENET_ROOT)/include
18
18
19
19
20
# EBacktrace
20
# EBacktrace
21
21
22
ifndef EBACKTRACEDLL
22
ifndef EBACKTRACEDLL
23
    EBACKTRACEDLL = ebacktrace1.dll
23
    EBACKTRACEDLL = ebacktrace1.dll
24
    ifeq ($(findstring x86_64,$(COMPILERTARGET)),x86_64)
24
    ifeq ($(findstring x86_64,$(COMPILERTARGET)),x86_64)
25
        EBACKTRACEDLL = ebacktrace1-64.dll
25
        EBACKTRACEDLL = ebacktrace1-64.dll
26
    endif
26
    endif
27
endif
27
endif
28
EBACKTRACEDLL_TARGET:=$(EBACKTRACEDLL)
28
EBACKTRACEDLL_TARGET:=$(EBACKTRACEDLL)
29
29
30
30
31
# BUILD Engine
31
# BUILD Engine
32
32
33
ENGINE_CFLAGS=-I$(ENGINE_SRC)
33
ENGINE_CFLAGS=-I$(ENGINE_SRC)
34
UTIL_LIBS= -lm # -lpthread
34
UTIL_LIBS= -lm # -lpthread
35
35
36
ENGINE_OBJ=$(ENGINE_ROOT)/$(obj)
36
ENGINE_OBJ=$(ENGINE_ROOT)/$(obj)
37
37
38
ENGINE_OBJS=baselayer cache1d common compat crc32 defs engine polymost texcache dxtfilter hightile textfont smalltextfont kplib lz4 osd pragmas scriptfile mmulti_null mutex xxhash md4
38
ENGINE_OBJS=baselayer cache1d common compat crc32 defs engine polymost texcache dxtfilter hightile textfont smalltextfont kplib lz4 osd pragmas scriptfile mmulti_null mutex xxhash md4
39
ENGINE_EDITOR_OBJS=build config defs
39
ENGINE_EDITOR_OBJS=build config defs
40
ifeq (0,$(NOASM))
40
ifeq (0,$(NOASM))
41
  ENGINE_OBJS+= a
41
  ENGINE_OBJS+= a
42
else
42
else
43
  ENGINE_OBJS+= a-c
43
  ENGINE_OBJS+= a-c
44
  ifneq (0,$(USE_ASM64))
44
  ifneq (0,$(USE_ASM64))
45
    ENGINE_OBJS+= a64
45
    ENGINE_OBJS+= a64
46
  endif
46
  endif
47
endif
47
endif
48
ifeq (1,$(USE_OPENGL))
48
ifeq (1,$(USE_OPENGL))
49
    ENGINE_OBJS+= glbuild voxmodel mdsprite
49
    ENGINE_OBJS+= glbuild voxmodel mdsprite
50
    ifeq (1,$(POLYMER))
50
    ifeq (1,$(POLYMER))
51
        ENGINE_OBJS+= polymer
51
        ENGINE_OBJS+= polymer
52
    endif
52
    endif
53
endif
53
endif
54
ifneq (0,$(LUNATIC))
54
ifneq (0,$(LUNATIC))
55
    ENGINE_OBJS+= lunatic
55
    ENGINE_OBJS+= lunatic
56
endif
56
endif
57
ifeq ($(PLATFORM),DARWIN)
57
ifeq ($(PLATFORM),DARWIN)
58
    ENGINE_OBJS += osxbits
58
    ENGINE_OBJS += osxbits
59
    ifneq (0,$(OSX_STARTUPWINDOW))
59
    ifneq (0,$(OSX_STARTUPWINDOW))
60
        ENGINE_EDITOR_OBJS += startosx.editor
60
        ENGINE_EDITOR_OBJS += startosx.editor
61
    endif
61
    endif
62
    ifeq (1,$(SDL_FRAMEWORK))
62
    ifeq (1,$(SDL_FRAMEWORK))
63
        ENGINE_OBJS+=SDLMain
63
        ENGINE_OBJS+=SDLMain
64
    endif
64
    endif
65
endif
65
endif
66
ifeq ($(PLATFORM),WINDOWS)
66
ifeq ($(PLATFORM),WINDOWS)
67
    ENGINE_OBJS+= winbits
67
    ENGINE_OBJS+= winbits
68
    ENGINE_EDITOR_OBJS+= startwin.editor
68
    ENGINE_EDITOR_OBJS+= startwin.editor
69
endif
69
endif
70
ifeq ($(PLATFORM),WII)
70
ifeq ($(PLATFORM),WII)
71
    ENGINE_OBJS+= wiibits
71
    ENGINE_OBJS+= wiibits
72
    LINKERFLAGS+= -Wl,-wrap,c_default_exceptionhandler
72
    LINKERFLAGS+= -Wl,-wrap,c_default_exceptionhandler
73
endif
73
endif
74
ifeq ($(RENDERTYPE),SDL)
74
ifeq ($(RENDERTYPE),SDL)
75
    ENGINE_OBJS+= sdlayer
75
    ENGINE_OBJS+= sdlayer
76
76
77
    ifeq (1,$(HAVE_GTK2))
77
    ifeq (1,$(HAVE_GTK2))
78
        ENGINE_OBJS+= gtkbits
78
        ENGINE_OBJS+= gtkbits
79
        ifeq ($(LINKED_GTK),0)
79
        ifeq ($(LINKED_GTK),0)
80
            ENGINE_OBJS+= dynamicgtk
80
            ENGINE_OBJS+= dynamicgtk
81
        endif
81
        endif
82
        ENGINE_EDITOR_OBJS+= startgtk.editor
82
        ENGINE_EDITOR_OBJS+= startgtk.editor
83
    endif
83
    endif
84
endif
84
endif
85
ifeq ($(RENDERTYPE),WIN)
85
ifeq ($(RENDERTYPE),WIN)
86
    ENGINE_OBJS+= winlayer rawinput
86
    ENGINE_OBJS+= winlayer rawinput
87
endif
87
endif
88
88
89
ENGINE_OBJS_EXP:=$(addprefix $(ENGINE_OBJ)/,$(addsuffix .$o,$(ENGINE_OBJS)))
89
ENGINE_OBJS_EXP:=$(addprefix $(ENGINE_OBJ)/,$(addsuffix .$o,$(ENGINE_OBJS)))
90
ENGINE_EDITOR_OBJS_EXP:=$(addprefix $(ENGINE_OBJ)/,$(addsuffix .$o,$(ENGINE_EDITOR_OBJS)))
90
ENGINE_EDITOR_OBJS_EXP:=$(addprefix $(ENGINE_OBJ)/,$(addsuffix .$o,$(ENGINE_EDITOR_OBJS)))
91
91
92
92
93
# MACT
93
# MACT
94
94
95
MACT_OBJ=file_lib control keyboard mouse joystick mathutil scriplib animlib
95
MACT_OBJ=file_lib control keyboard mouse joystick mathutil scriplib animlib
96
96
97
97
98
# AudioLib
98
# AudioLib
99
99
100
AUDIOLIB_OBJS=drivers fx_man multivoc mix mixst pitch formats vorbis flac xa driver_nosound
100
AUDIOLIB_OBJS=drivers fx_man multivoc mix mixst pitch formats vorbis flac xa driver_nosound
101
101
102
AUDIOLIB_ROOT=$(DUKE3D_SRC)/jaudiolib
102
AUDIOLIB_ROOT=$(DUKE3D_SRC)/jaudiolib
103
AUDIOLIB_SRC=$(AUDIOLIB_ROOT)/src
103
AUDIOLIB_SRC=$(AUDIOLIB_ROOT)/src
104
AUDIOLIB_INC=$(AUDIOLIB_ROOT)/include
104
AUDIOLIB_INC=$(AUDIOLIB_ROOT)/include
105
AUDIOLIB_OBJ=$(AUDIOLIB_ROOT)/$(obj)
105
AUDIOLIB_OBJ=$(AUDIOLIB_ROOT)/$(obj)
106
106
107
AUDIOLIB_CFLAGS=-I$(AUDIOLIB_ROOT)/third-party/common/include
107
AUDIOLIB_CFLAGS=-I$(AUDIOLIB_ROOT)/third-party/common/include
108
108
109
ifeq ($(PLATFORM),WINDOWS)
109
ifeq ($(PLATFORM),WINDOWS)
110
    ifeq ($(MIXERTYPE),WIN)
110
    ifeq ($(MIXERTYPE),WIN)
111
        AUDIOLIB_CFLAGS+= -DHAVE_DS
111
        AUDIOLIB_CFLAGS+= -DHAVE_DS
112
        AUDIOLIB_OBJS+= driver_directsound
112
        AUDIOLIB_OBJS+= driver_directsound
113
    endif
113
    endif
114
endif
114
endif
115
115
116
ifeq ($(MIXERTYPE),SDL)
116
ifeq ($(MIXERTYPE),SDL)
117
    AUDIOLIB_CFLAGS+= -DHAVE_SDL
117
    AUDIOLIB_CFLAGS+= -DHAVE_SDL
118
    ifneq ($(PLATFORM),DARWIN)
118
    ifneq ($(PLATFORM),DARWIN)
119
        ifneq ($(PLATFORM),WINDOWS)
119
        ifneq ($(PLATFORM),WINDOWS)
120
            ifneq ($(PLATFORM),WII)
120
            ifneq ($(PLATFORM),WII)
121
                AUDIOLIB_CFLAGS+=`pkg-config --cflags vorbis`
121
                AUDIOLIB_CFLAGS+=`pkg-config --cflags vorbis`
122
            endif
122
            endif
123
        endif
123
        endif
124
    endif
124
    endif
125
    AUDIOLIB_OBJS+= driver_sdl
125
    AUDIOLIB_OBJS+= driver_sdl
126
endif
126
endif
127
127
128
AUDIOLIB_OBJS_EXP:=$(addprefix $(AUDIOLIB_OBJ)/,$(addsuffix .$o,$(AUDIOLIB_OBJS)))
128
AUDIOLIB_OBJS_EXP:=$(addprefix $(AUDIOLIB_OBJ)/,$(addsuffix .$o,$(AUDIOLIB_OBJS)))
129
129
130
130
131
# ENet
131
# ENet
132
132
133
ENET_OBJS=callbacks host list packet peer protocol compress
133
ENET_OBJS=callbacks host list packet peer protocol compress
134
134
135
ENET_ROOT=$(DUKE3D_SRC)/enet
135
ENET_ROOT=$(DUKE3D_SRC)/enet
136
ENET_SRC=$(ENET_ROOT)/src
136
ENET_SRC=$(ENET_ROOT)/src
137
ENET_INC=$(ENET_ROOT)/include
137
ENET_INC=$(ENET_ROOT)/include
138
ENET_OBJ=$(ENET_ROOT)/$(obj)
138
ENET_OBJ=$(ENET_ROOT)/$(obj)
139
139
140
ENET_CFLAGS=
140
ENET_CFLAGS=
141
141
142
ifeq ($(PLATFORM),WINDOWS)
142
ifeq ($(PLATFORM),WINDOWS)
143
    ENET_OBJS += win32
143
    ENET_OBJS += win32
144
else
144
else
145
    ENET_OBJS += unix
145
    ENET_OBJS += unix
146
    ENET_CFLAGS += -DHAS_SOCKLEN_T
146
    ENET_CFLAGS += -DHAS_SOCKLEN_T
147
endif
147
endif
148
148
149
ENET_OBJS_EXP:=$(addprefix $(ENET_OBJ)/,$(addsuffix .$o,$(ENET_OBJS)))
149
ENET_OBJS_EXP:=$(addprefix $(ENET_OBJ)/,$(addsuffix .$o,$(ENET_OBJS)))
150
150
151
ifeq ($(NETCODE),0)
151
ifeq ($(NETCODE),0)
152
    ENET_TARGET=
152
    ENET_TARGET=
153
else
153
else
154
    ENET_TARGET=$(ENET_OBJS_EXP)
154
    ENET_TARGET=$(ENET_OBJS_EXP)
155
endif
155
endif
156
156
157
157
158
# Tools
158
# Tools
159
159
160
UTIL_OBJS=compat pragmas kplib cache1d compat_tools
160
UTIL_OBJS=compat pragmas kplib cache1d compat_tools
161
UTILS=kextract kgroup transpal wad2art wad2map kmd2tool md2tool generateicon cacheinfo arttool givedepth mkpalette unpackssi bsuite
161
UTILS=kextract kgroup transpal wad2art wad2map kmd2tool md2tool generateicon cacheinfo arttool givedepth mkpalette unpackssi bsuite
162
GAMEUTILS=ivfrate
162
GAMEUTILS=ivfrate
163
DXUTILS=enumdisplay getdxdidf
163
DXUTILS=enumdisplay getdxdidf
164
SDLUTILS=makesdlkeytrans
164
SDLUTILS=makesdlkeytrans
165
165
166
UTIL_OBJS_EXP:=$(addprefix $(ENGINE_OBJ)/,$(addsuffix .$o,$(UTIL_OBJS)))
166
UTIL_OBJS_EXP:=$(addprefix $(ENGINE_OBJ)/,$(addsuffix .$o,$(UTIL_OBJS)))
167
167
168
168
169
# KenBuild (Test Game)
169
# KenBuild (Test Game)
170
170
171
TESTGAME_ROOT=$(DUKE3D_SRC)/testgame
171
TESTGAME_ROOT=$(DUKE3D_SRC)/testgame
172
TESTGAME_SRC=$(TESTGAME_ROOT)/src
172
TESTGAME_SRC=$(TESTGAME_ROOT)/src
173
TESTGAME_RSRC=$(TESTGAME_ROOT)/rsrc
173
TESTGAME_RSRC=$(TESTGAME_ROOT)/rsrc
174
TESTGAME_OBJ=$(TESTGAME_ROOT)/$(obj)
174
TESTGAME_OBJ=$(TESTGAME_ROOT)/$(obj)
175
175
176
TEST_CFLAGS=-I$(TESTGAME_SRC)
176
TEST_CFLAGS=-I$(TESTGAME_SRC)
177
177
178
TESTGAME ?= testgame
178
TESTGAME ?= testgame
179
TESTEDITOR ?= testeditor
179
TESTEDITOR ?= testeditor
180
180
181
TESTGAME_TARGET:=$(TESTGAME)$(EXESUFFIX)
181
TESTGAME_TARGET:=$(TESTGAME)$(EXESUFFIX)
182
TESTEDITOR_TARGET:=$(TESTEDITOR)$(EXESUFFIX)
182
TESTEDITOR_TARGET:=$(TESTEDITOR)$(EXESUFFIX)
183
183
184
TESTGAME_OBJS=game sound_stub common config
184
TESTGAME_OBJS=game sound_stub common config
185
TESTEDITOR_OBJS=bstub common
185
TESTEDITOR_OBJS=bstub common
186
186
187
ifeq ($(RENDERTYPE),SDL)
187
ifeq ($(RENDERTYPE),SDL)
188
	ifeq (1,$(HAVE_GTK2))
188
	ifeq (1,$(HAVE_GTK2))
189
		TESTGAME_OBJS+= game_banner startgtk.game
189
		TESTGAME_OBJS+= game_banner startgtk.game
190
		TESTEDITOR_OBJS+= build_banner
190
		TESTEDITOR_OBJS+= build_banner
191
	endif
191
	endif
192
192
193
	TESTGAME_OBJS+= game_icon
193
	TESTGAME_OBJS+= game_icon
194
	TESTEDITOR_OBJS+= build_icon
194
	TESTEDITOR_OBJS+= build_icon
195
endif
195
endif
196
ifeq ($(PLATFORM),WINDOWS)
196
ifeq ($(PLATFORM),WINDOWS)
197
	TESTGAME_OBJS+= gameres startwin.game
197
	TESTGAME_OBJS+= gameres startwin.game
198
	TESTEDITOR_OBJS+= buildres
198
	TESTEDITOR_OBJS+= buildres
199
endif
199
endif
200
200
201
TESTGAME_OBJS_EXP:=$(addprefix $(TESTGAME_OBJ)/,$(addsuffix .$o,$(TESTGAME_OBJS)))
201
TESTGAME_OBJS_EXP:=$(addprefix $(TESTGAME_OBJ)/,$(addsuffix .$o,$(TESTGAME_OBJS)))
202
TESTEDITOR_OBJS_EXP:=$(addprefix $(TESTGAME_OBJ)/,$(addsuffix .$o,$(TESTEDITOR_OBJS)))
202
TESTEDITOR_OBJS_EXP:=$(addprefix $(TESTGAME_OBJ)/,$(addsuffix .$o,$(TESTEDITOR_OBJS)))
203
203
204
204
205
# Duke Nukem 3D
205
# Duke Nukem 3D
206
206
207
DUKE3D_CFLAGS=-I$(DUKE3D_INC)
207
DUKE3D_CFLAGS=-I$(DUKE3D_INC)
208
208
209
DUKE3D_LINKERFLAGS=
209
DUKE3D_LINKERFLAGS=
210
DUKE3D_EDITOR_LINKERFLAGS=
210
DUKE3D_EDITOR_LINKERFLAGS=
211
211
212
DUKE3D_OBJ=$(DUKE3D_SRC)/$(obj)
212
DUKE3D_OBJ=$(DUKE3D_SRC)/$(obj)
213
213
214
EDUKE32 ?= eduke32
214
EDUKE32 ?= eduke32
215
MAPSTER32 ?= mapster32
215
MAPSTER32 ?= mapster32
216
216
217
EDUKE32_TARGET:=$(EDUKE32)$(EXESUFFIX)
217
EDUKE32_TARGET:=$(EDUKE32)$(EXESUFFIX)
218
MAPSTER32_TARGET:=$(MAPSTER32)$(EXESUFFIX)
218
MAPSTER32_TARGET:=$(MAPSTER32)$(EXESUFFIX)
219
219
220
COMMON_OBJS=rev
220
COMMON_OBJS=rev
221
COMMON_EDITOR_OBJS=m32common m32def m32exec m32vars mathutil rev
221
COMMON_EDITOR_OBJS=m32common m32def m32exec m32vars mathutil rev
222
222
223
DUKE3D_OBJS=game global actors gamedef gameexec gamevars player premap sector anim animsounds common config demo input menus namesdyn net savegame rts osdfuncs osdcmds grpscan sounds soundsdyn $(MACT_OBJ)
223
DUKE3D_OBJS=game global actors gamedef gameexec gamevars player premap sector anim animsounds common config demo input menus namesdyn net savegame rts osdfuncs osdcmds grpscan sounds soundsdyn $(MACT_OBJ)
224
DUKE3D_EDITOR_OBJS=astub common grpscan sounds_mapster32
224
DUKE3D_EDITOR_OBJS=astub common grpscan sounds_mapster32
225
225
226
ifneq ($(USE_LIBVPX),0)
226
ifneq ($(USE_LIBVPX),0)
227
    DUKE3D_OBJS+= animvpx
227
    DUKE3D_OBJS+= animvpx
228
endif
228
endif
229
229
230
ifneq (0,$(DISABLEINLINING))
230
ifneq (0,$(DISABLEINLINING))
231
    DUKE3D_OBJS+= game_inline actors_inline sector_inline
231
    DUKE3D_OBJS+= game_inline actors_inline sector_inline
232
endif
232
endif
233
233
234
DUKE3D_MISCDEPS=
234
DUKE3D_MISCDEPS=
235
DUKE3D_EDITOR_MISCDEPS=
235
DUKE3D_EDITOR_MISCDEPS=
236
236
237
# Lunatic object base names. These are not used in targets directly.
237
# Lunatic object base names. These are not used in targets directly.
238
LUNATIC_COMMON_OBJS = luaJIT_BC_defs_common luaJIT_BC_engine_maptext luaJIT_BC_engine luaJIT_BC_bcarray luaJIT_BC_bcheck luaJIT_BC_bitar luaJIT_BC_xmath luaJIT_BC_v luaJIT_BC_dump luaJIT_BC_dis_x86 luaJIT_BC_dis_x64
238
LUNATIC_COMMON_OBJS = luaJIT_BC_defs_common luaJIT_BC_engine_maptext luaJIT_BC_engine luaJIT_BC_bcarray luaJIT_BC_bcheck luaJIT_BC_bitar luaJIT_BC_xmath luaJIT_BC_v luaJIT_BC_dump luaJIT_BC_dis_x86 luaJIT_BC_dis_x64
239
LUNATIC_GAME_OBJS = luaJIT_BC_con_lang luaJIT_BC_lunacon luaJIT_BC_randgen luaJIT_BC_stat luaJIT_BC_control luaJIT_BC_defs luaJIT_BC_savegame luaJIT_BC_fs
239
LUNATIC_GAME_OBJS = luaJIT_BC_con_lang luaJIT_BC_lunacon luaJIT_BC_randgen luaJIT_BC_stat luaJIT_BC_control luaJIT_BC_defs luaJIT_BC_savegame luaJIT_BC_fs
240
240
241
## Lunatic devel
241
## Lunatic devel
242
ifneq (0,$(LUNATIC))
242
ifneq (0,$(LUNATIC))
243
    # TODO: remove debugging modules from release build
243
    # TODO: remove debugging modules from release build
244
244
245
    DUKE3D_EDITOR_OBJS+= lunatic_m32 $(LUNATIC_COMMON_OBJS)
245
    DUKE3D_EDITOR_OBJS+= lunatic_m32 $(LUNATIC_COMMON_OBJS)
246
    DUKE3D_OBJS+= lunatic_game $(LUNATIC_COMMON_OBJS)
246
    DUKE3D_OBJS+= lunatic_game $(LUNATIC_COMMON_OBJS)
247
247
248
    DUKE3D_EDITOR_OBJS+= luaJIT_BC_defs_m32
248
    DUKE3D_EDITOR_OBJS+= luaJIT_BC_defs_m32
249
249
250
    ifneq ($(PLATFORM),WINDOWS)
250
    ifneq ($(PLATFORM),WINDOWS)
251
        # On non-Windows, we expect to have liblpeg.a (or a symlink to it) in source/.
251
        # On non-Windows, we expect to have liblpeg.a (or a symlink to it) in source/.
252
        # On Windows, it will reside in platform/Windows/lib/32/ or lib/64/.
252
        # On Windows, it will reside in platform/Windows/lib/32/ or lib/64/.
253
        LIBDIRS+= -L$(DUKE3D_SRC)
253
        LIBDIRS+= -L$(DUKE3D_SRC)
254
        ifeq ($(realpath $(DUKE3D_SRC)/liblpeg.a),)
254
        ifeq ($(realpath $(DUKE3D_SRC)/liblpeg.a),)
255
            # XXX: This cripples "make clean" etc. too, but IMO it's better than warning.
255
            # XXX: This cripples "make clean" etc. too, but IMO it's better than warning.
256
            $(error "liblpeg.a not found in $(realpath $(DUKE3D_OBJ)/..)")
256
            $(error "liblpeg.a not found in $(realpath $(DUKE3D_OBJ)/..)")
257
        endif
257
        endif
258
    endif
258
    endif
259
    LIBS+= -llpeg
259
    LIBS+= -llpeg
260
    DUKE3D_OBJS+= $(LUNATIC_GAME_OBJS)
260
    DUKE3D_OBJS+= $(LUNATIC_GAME_OBJS)
261
261
262
    # now, take care of having the necessary symbols (sector, wall, etc.) in the
262
    # now, take care of having the necessary symbols (sector, wall, etc.) in the
263
    # executable no matter what the debugging level
263
    # executable no matter what the debugging level
264
264
265
    ifeq ($(PLATFORM),DARWIN)
265
    ifeq ($(PLATFORM),DARWIN)
266
        # strip on OSX says: removing global symbols from a final linked no longer supported.
266
        # strip on OSX says: removing global symbols from a final linked no longer supported.
267
        #                    Use -exported_symbols_list at link time when building
267
        #                    Use -exported_symbols_list at link time when building
268
        # But, following _their_ directions does not give us the symbols! wtf?
268
        # But, following _their_ directions does not give us the symbols! wtf?
269
        ifneq ($(STRIP),0)
269
        ifneq ($(STRIP),0)
270
            STRIP+= -s $(DUKE3D_SRC)/lunatic/dynsymlist_osx
270
            STRIP+= -s $(DUKE3D_SRC)/lunatic/dynsymlist_osx
271
        endif
271
        endif
272
272
273
        DUKE3D_MISCDEPS+= $(DUKE3D_SRC)/lunatic/dynsymlist_osx
273
        DUKE3D_MISCDEPS+= $(DUKE3D_SRC)/lunatic/dynsymlist_osx
274
        LINKERFLAGS+= -pagezero_size 10000 -image_base 100000000 #-Wl,-alias_list -Wl,$(DUKE3D_SRC)/lunatic/aliases_list #-exported_symbols_list $(DUKE3D_SRC)/lunatic/dynsymlist_osx
274
        LINKERFLAGS+= -pagezero_size 10000 -image_base 100000000 #-Wl,-alias_list -Wl,$(DUKE3D_SRC)/lunatic/aliases_list #-exported_symbols_list $(DUKE3D_SRC)/lunatic/dynsymlist_osx
275
    endif
275
    endif
276
    ifeq ($(PLATFORM),WINDOWS)
276
    ifeq ($(PLATFORM),WINDOWS)
277
        override STRIP=
277
        override STRIP=
278
        DUKE3D_MISCDEPS+= $(DUKE3D_SRC)/lunatic/eduke32.def
278
        DUKE3D_MISCDEPS+= $(DUKE3D_SRC)/lunatic/eduke32.def
279
        DUKE3D_LINKERFLAGS+= $(DUKE3D_SRC)/lunatic/eduke32.def
279
        DUKE3D_LINKERFLAGS+= $(DUKE3D_SRC)/lunatic/eduke32.def
280
        DUKE3D_EDITOR_MISCDEPS+= $(DUKE3D_SRC)/lunatic/mapster32.def
280
        DUKE3D_EDITOR_MISCDEPS+= $(DUKE3D_SRC)/lunatic/mapster32.def
281
        DUKE3D_EDITOR_LINKERFLAGS+= $(DUKE3D_SRC)/lunatic/mapster32.def
281
        DUKE3D_EDITOR_LINKERFLAGS+= $(DUKE3D_SRC)/lunatic/mapster32.def
282
    endif
282
    endif
283
    ifeq ($(SUBPLATFORM),LINUX)
283
    ifeq ($(SUBPLATFORM),LINUX)
284
        override STRIP=
284
        override STRIP=
285
        DUKE3D_LINKERFLAGS+= -Wl,--dynamic-list=$(DUKE3D_SRC)/lunatic/dynsymlist
285
        DUKE3D_LINKERFLAGS+= -Wl,--dynamic-list=$(DUKE3D_SRC)/lunatic/dynsymlist
286
        DUKE3D_EDITOR_LINKERFLAGS+= -Wl,--dynamic-list=$(DUKE3D_SRC)/lunatic/dynsymlist_m32
286
        DUKE3D_EDITOR_LINKERFLAGS+= -Wl,--dynamic-list=$(DUKE3D_SRC)/lunatic/dynsymlist_m32
287
    endif
287
    endif
288
endif
288
endif
289
289
290
ifeq ($(SUBPLATFORM),LINUX)
290
ifeq ($(SUBPLATFORM),LINUX)
291
    LIBS		+= -lFLAC -lvorbisfile -lvorbis -logg
291
    LIBS += -lFLAC -lvorbisfile -lvorbis -logg
292
endif
292
endif
-
 
293
-
 
294
ifeq ($(PLATFORM),BSD)
-
 
295
    LIBS += -lFLAC -lvorbisfile -lvorbis -logg -lexecinfo
-
 
296
endif
293
297
294
ifeq ($(PLATFORM),DARWIN)
298
ifeq ($(PLATFORM),DARWIN)
295
    # LIBDIRS += -L$(AUDIOLIB_ROOT)/third-party/Apple/lib
299
    # LIBDIRS += -L$(AUDIOLIB_ROOT)/third-party/Apple/lib
296
300
297
    LIBS += -lFLAC -lvorbisfile -lvorbis -logg -lm \
301
    LIBS += -lFLAC -lvorbisfile -lvorbis -logg -lm \
298
            -Wl,-framework,Cocoa -Wl,-framework,Carbon -Wl,-framework,OpenGL \
302
            -Wl,-framework,Cocoa -Wl,-framework,Carbon -Wl,-framework,OpenGL \
299
            -Wl,-framework,CoreMidi -Wl,-framework,AudioUnit \
303
            -Wl,-framework,CoreMidi -Wl,-framework,AudioUnit \
300
            -Wl,-framework,AudioToolbox -Wl,-framework,IOKit -Wl,-framework,AGL
304
            -Wl,-framework,AudioToolbox -Wl,-framework,IOKit -Wl,-framework,AGL
301
    ifneq (00,$(DARWIN9)$(DARWIN10))
305
    ifneq (00,$(DARWIN9)$(DARWIN10))
302
        LIBS += -Wl,-framework,QuickTime -lm
306
        LIBS += -Wl,-framework,QuickTime -lm
303
    endif
307
    endif
304
308
305
    ifneq (0,$(OSX_STARTUPWINDOW))
309
    ifneq (0,$(OSX_STARTUPWINDOW))
306
        DUKE3D_OBJS += GrpFile.game GameListSource.game startosx.game
310
        DUKE3D_OBJS += GrpFile.game GameListSource.game startosx.game
307
    endif
311
    endif
308
endif
312
endif
309
313
310
ifeq ($(PLATFORM),WINDOWS)
314
ifeq ($(PLATFORM),WINDOWS)
311
    LIBS += -lFLAC -lvorbisfile -lvorbis -logg -lcompat-from-mingw-w64
315
    LIBS += -lFLAC -lvorbisfile -lvorbis -logg -lcompat-from-mingw-w64
312
    LIBDIRS += -L$(AUDIOLIB_ROOT)/third-party/Windows/lib$(WINLIB)
316
    LIBDIRS += -L$(AUDIOLIB_ROOT)/third-party/Windows/lib$(WINLIB)
313
    DUKE3D_OBJS+= gameres winbits startwin.game
317
    DUKE3D_OBJS+= gameres winbits startwin.game
314
    DUKE3D_EDITOR_OBJS+= buildres
318
    DUKE3D_EDITOR_OBJS+= buildres
315
    ifeq ($(MIXERTYPE),WIN)
319
    ifeq ($(MIXERTYPE),WIN)
316
        LIBS+= -ldsound
320
        LIBS+= -ldsound
317
        DUKE3D_OBJS+= music midi mpu401
321
        DUKE3D_OBJS+= music midi mpu401
318
    endif
322
    endif
319
endif
323
endif
320
324
321
ifeq ($(PLATFORM),WII)
325
ifeq ($(PLATFORM),WII)
322
    LIBS += -lvorbisidec
326
    LIBS += -lvorbisidec
323
endif
327
endif
324
328
325
ifeq ($(RENDERTYPE),SDL)
329
ifeq ($(RENDERTYPE),SDL)
326
    ifeq (1,$(HAVE_GTK2))
330
    ifeq (1,$(HAVE_GTK2))
327
        DUKE3D_OBJS+= game_banner startgtk.game
331
        DUKE3D_OBJS+= game_banner startgtk.game
328
        DUKE3D_EDITOR_OBJS+= build_banner
332
        DUKE3D_EDITOR_OBJS+= build_banner
329
    endif
333
    endif
330
334
331
    DUKE3D_OBJS+= game_icon
335
    DUKE3D_OBJS+= game_icon
332
    DUKE3D_EDITOR_OBJS+= build_icon
336
    DUKE3D_EDITOR_OBJS+= build_icon
333
endif
337
endif
334
ifeq ($(MIXERTYPE),SDL)
338
ifeq ($(MIXERTYPE),SDL)
335
    DUKE3D_OBJS+= sdlmusic
339
    DUKE3D_OBJS+= sdlmusic
336
endif
340
endif
337
341
338
## Construct file names of object files
342
## Construct file names of object files
339
343
340
COMMON_OBJS_EXP:=$(addprefix $(DUKE3D_OBJ)/,$(addsuffix .$o,$(COMMON_OBJS)))
344
COMMON_OBJS_EXP:=$(addprefix $(DUKE3D_OBJ)/,$(addsuffix .$o,$(COMMON_OBJS)))
341
COMMON_EDITOR_OBJS_EXP:=$(addprefix $(DUKE3D_OBJ)/,$(addsuffix .$o,$(COMMON_EDITOR_OBJS)))
345
COMMON_EDITOR_OBJS_EXP:=$(addprefix $(DUKE3D_OBJ)/,$(addsuffix .$o,$(COMMON_EDITOR_OBJS)))
342
346
343
DUKE3D_OBJS_EXP:=$(addprefix $(DUKE3D_OBJ)/,$(addsuffix .$o,$(DUKE3D_OBJS)))
347
DUKE3D_OBJS_EXP:=$(addprefix $(DUKE3D_OBJ)/,$(addsuffix .$o,$(DUKE3D_OBJS)))
344
DUKE3D_EDITOR_OBJS_EXP:=$(addprefix $(DUKE3D_OBJ)/,$(addsuffix .$o,$(DUKE3D_EDITOR_OBJS)))
348
DUKE3D_EDITOR_OBJS_EXP:=$(addprefix $(DUKE3D_OBJ)/,$(addsuffix .$o,$(DUKE3D_EDITOR_OBJS)))
345
349
346
350
347
ifeq ($(PRETTY_OUTPUT),1)
351
ifeq ($(PRETTY_OUTPUT),1)
348
.SILENT:
352
.SILENT:
349
endif
353
endif
350
.PHONY: veryclean clean all test cleanutils utils dxutils sdlutils printutils printsdlutils printdxutils rev $(DUKE3D_OBJ)/rev.$o
354
.PHONY: veryclean clean all test cleanutils utils dxutils sdlutils printutils printsdlutils printdxutils rev $(DUKE3D_OBJ)/rev.$o
351
355
352
# TARGETS
356
# TARGETS
353
357
354
all: start $(EDUKE32_TARGET) $(MAPSTER32_TARGET) finish
358
all: start $(EDUKE32_TARGET) $(MAPSTER32_TARGET) finish
355
ifneq (,$(EDUKE32_TARGET))
359
ifneq (,$(EDUKE32_TARGET))
356
	@ls -l $(EDUKE32)$(EXESUFFIX)
360
	@ls -l $(EDUKE32)$(EXESUFFIX)
357
endif
361
endif
358
ifneq (,$(MAPSTER32_TARGET))
362
ifneq (,$(MAPSTER32_TARGET))
359
	@ls -l $(MAPSTER32)$(EXESUFFIX)
363
	@ls -l $(MAPSTER32)$(EXESUFFIX)
360
endif
364
endif
361
365
362
test: start $(TESTGAME_TARGET) $(TESTEDITOR_TARGET) finish
366
test: start $(TESTGAME_TARGET) $(TESTEDITOR_TARGET) finish
363
ifneq (,$(TESTGAME_TARGET))
367
ifneq (,$(TESTGAME_TARGET))
364
	@ls -l $(TESTGAME)$(EXESUFFIX)
368
	@ls -l $(TESTGAME)$(EXESUFFIX)
365
endif
369
endif
366
ifneq (,$(TESTEDITOR_TARGET))
370
ifneq (,$(TESTEDITOR_TARGET))
367
	@ls -l $(TESTEDITOR)$(EXESUFFIX)
371
	@ls -l $(TESTEDITOR)$(EXESUFFIX)
368
endif
372
endif
369
373
370
ebacktrace: start $(EBACKTRACEDLL_TARGET) finish
374
ebacktrace: start $(EBACKTRACEDLL_TARGET) finish
371
ifneq (,$(EBACKTRACEDLL_TARGET))
375
ifneq (,$(EBACKTRACEDLL_TARGET))
372
	@ls -l $(EBACKTRACEDLL)
376
	@ls -l $(EBACKTRACEDLL)
373
endif
377
endif
374
378
375
start:
379
start:
376
	$(BUILD_STARTED)
380
	$(BUILD_STARTED)
377
381
378
finish:
382
finish:
379
	$(BUILD_FINISHED)
383
	$(BUILD_FINISHED)
380
384
381
utils: $(addsuffix $(EXESUFFIX),$(UTILS) $(GAMEUTILS))
385
utils: $(addsuffix $(EXESUFFIX),$(UTILS) $(GAMEUTILS))
382
	@ls -l $^
386
	@ls -l $^
383
387
384
dxutils: $(addsuffix $(EXESUFFIX),$(DXUTILS))
388
dxutils: $(addsuffix $(EXESUFFIX),$(DXUTILS))
385
	@ls -l $^
389
	@ls -l $^
386
390
387
sdlutils: $(addsuffix $(EXESUFFIX),$(SDLUTILS))
391
sdlutils: $(addsuffix $(EXESUFFIX),$(SDLUTILS))
388
	@ls -l $^
392
	@ls -l $^
389
393
390
ifeq ($(PLATFORM),WII)
394
ifeq ($(PLATFORM),WII)
391
ifneq ($(ELF2DOL),)
395
ifneq ($(ELF2DOL),)
392
$(TESTGAME)$(DOLSUFFIX): $(TESTGAME)$(EXESUFFIX)
396
$(TESTGAME)$(DOLSUFFIX): $(TESTGAME)$(EXESUFFIX)
393
$(TESTEDITOR)$(DOLSUFFIX): $(TESTEDITOR)$(EXESUFFIX)
397
$(TESTEDITOR)$(DOLSUFFIX): $(TESTEDITOR)$(EXESUFFIX)
394
$(EDUKE32)$(DOLSUFFIX): $(EDUKE32)$(EXESUFFIX)
398
$(EDUKE32)$(DOLSUFFIX): $(EDUKE32)$(EXESUFFIX)
395
$(MAPSTER32)$(DOLSUFFIX): $(MAPSTER32)$(EXESUFFIX)
399
$(MAPSTER32)$(DOLSUFFIX): $(MAPSTER32)$(EXESUFFIX)
396
endif
400
endif
397
endif
401
endif
398
402
399
$(TESTGAME)$(EXESUFFIX): $(TESTGAME_OBJS_EXP) $(COMMON_OBJS_EXP) $(ENGINE_OBJS_EXP)
403
$(TESTGAME)$(EXESUFFIX): $(TESTGAME_OBJS_EXP) $(COMMON_OBJS_EXP) $(ENGINE_OBJS_EXP)
400
	$(LINK_STATUS)
404
	$(LINK_STATUS)
401
	$(RECIPE_IF) $(LINKER) -o $@ $^ $(COMMONFLAGS) $(LINKERFLAGS) $(LIBDIRS) $(LIBS) $(STATICSTDCPP) $(RECIPE_RESULT_LINK)
405
	$(RECIPE_IF) $(LINKER) -o $@ $^ $(COMMONFLAGS) $(LINKERFLAGS) $(LIBDIRS) $(LIBS) $(STATICSTDCPP) $(RECIPE_RESULT_LINK)
402
ifeq ($(PLATFORM),WII)
406
ifeq ($(PLATFORM),WII)
403
ifneq ($(ELF2DOL),)
407
ifneq ($(ELF2DOL),)
404
	$(ELF2DOL) $(TESTGAME)$(EXESUFFIX) $(TESTGAME)$(DOLSUFFIX)
408
	$(ELF2DOL) $(TESTGAME)$(EXESUFFIX) $(TESTGAME)$(DOLSUFFIX)
405
endif
409
endif
406
endif
410
endif
407
ifneq ($(STRIP),)
411
ifneq ($(STRIP),)
408
	$(STRIP) $(TESTGAME)$(EXESUFFIX)
412
	$(STRIP) $(TESTGAME)$(EXESUFFIX)
409
endif
413
endif
410
414
411
$(TESTEDITOR)$(EXESUFFIX): $(TESTEDITOR_OBJS_EXP) $(COMMON_EDITOR_OBJS_EXP) $(ENGINE_EDITOR_OBJS_EXP) $(ENGINE_OBJS_EXP)
415
$(TESTEDITOR)$(EXESUFFIX): $(TESTEDITOR_OBJS_EXP) $(COMMON_EDITOR_OBJS_EXP) $(ENGINE_EDITOR_OBJS_EXP) $(ENGINE_OBJS_EXP)
412
	$(LINK_STATUS)
416
	$(LINK_STATUS)
413
	$(RECIPE_IF) $(LINKER) -o $@ $^ $(COMMONFLAGS) $(LINKERFLAGS) $(LIBDIRS) $(LIBS) $(STATICSTDCPP) $(RECIPE_RESULT_LINK)
417
	$(RECIPE_IF) $(LINKER) -o $@ $^ $(COMMONFLAGS) $(LINKERFLAGS) $(LIBDIRS) $(LIBS) $(STATICSTDCPP) $(RECIPE_RESULT_LINK)
414
ifeq ($(PLATFORM),WII)
418
ifeq ($(PLATFORM),WII)
415
ifneq ($(ELF2DOL),)
419
ifneq ($(ELF2DOL),)
416
	$(ELF2DOL) $(TESTEDITOR)$(EXESUFFIX) $(TESTEDITOR)$(DOLSUFFIX)
420
	$(ELF2DOL) $(TESTEDITOR)$(EXESUFFIX) $(TESTEDITOR)$(DOLSUFFIX)
417
endif
421
endif
418
endif
422
endif
419
ifneq ($(STRIP),)
423
ifneq ($(STRIP),)
420
	$(STRIP) $(TESTEDITOR)$(EXESUFFIX)
424
	$(STRIP) $(TESTEDITOR)$(EXESUFFIX)
421
endif
425
endif
422
426
423
$(EDUKE32)$(EXESUFFIX): $(DUKE3D_OBJS_EXP) $(COMMON_OBJS_EXP) $(ENGINE_OBJS_EXP) $(AUDIOLIB_OBJS_EXP) $(ENET_TARGET) $(DUKE3D_MISCDEPS)
427
$(EDUKE32)$(EXESUFFIX): $(DUKE3D_OBJS_EXP) $(COMMON_OBJS_EXP) $(ENGINE_OBJS_EXP) $(AUDIOLIB_OBJS_EXP) $(ENET_TARGET) $(DUKE3D_MISCDEPS)
424
	$(LINK_STATUS)
428
	$(LINK_STATUS)
425
	$(RECIPE_IF) $(LINKER) -o $@ $^ $(COMMONFLAGS) $(LINKERFLAGS) $(DUKE3D_LINKERFLAGS) $(LIBDIRS) $(LIBS) $(STATICSTDCPP) $(RECIPE_RESULT_LINK)
429
	$(RECIPE_IF) $(LINKER) -o $@ $^ $(COMMONFLAGS) $(LINKERFLAGS) $(DUKE3D_LINKERFLAGS) $(LIBDIRS) $(LIBS) $(STATICSTDCPP) $(RECIPE_RESULT_LINK)
426
ifeq ($(PLATFORM),WII)
430
ifeq ($(PLATFORM),WII)
427
ifneq ($(ELF2DOL),)
431
ifneq ($(ELF2DOL),)
428
	$(ELF2DOL) $(EDUKE32)$(EXESUFFIX) $(EDUKE32)$(DOLSUFFIX)
432
	$(ELF2DOL) $(EDUKE32)$(EXESUFFIX) $(EDUKE32)$(DOLSUFFIX)
429
endif
433
endif
430
endif
434
endif
431
ifneq ($(STRIP),)
435
ifneq ($(STRIP),)
432
	$(STRIP) $(EDUKE32)$(EXESUFFIX)
436
	$(STRIP) $(EDUKE32)$(EXESUFFIX)
433
endif
437
endif
434
ifeq ($(PLATFORM),DARWIN)
438
ifeq ($(PLATFORM),DARWIN)
435
	cp -RPf "platform/Apple/bundles/EDuke32.app" "./"
439
	cp -RPf "platform/Apple/bundles/EDuke32.app" "./"
436
	mkdir -p "EDuke32.app/Contents/MacOS"
440
	mkdir -p "EDuke32.app/Contents/MacOS"
437
	cp -f "$(EDUKE32)$(EXESUFFIX)" "EDuke32.app/Contents/MacOS/"
441
	cp -f "$(EDUKE32)$(EXESUFFIX)" "EDuke32.app/Contents/MacOS/"
438
endif
442
endif
439
443
440
$(MAPSTER32)$(EXESUFFIX): $(DUKE3D_EDITOR_OBJS_EXP) $(COMMON_EDITOR_OBJS_EXP) $(ENGINE_EDITOR_OBJS_EXP) $(ENGINE_OBJS_EXP) $(AUDIOLIB_OBJS_EXP) $(DUKE3D_EDITOR_MISCDEPS)
444
$(MAPSTER32)$(EXESUFFIX): $(DUKE3D_EDITOR_OBJS_EXP) $(COMMON_EDITOR_OBJS_EXP) $(ENGINE_EDITOR_OBJS_EXP) $(ENGINE_OBJS_EXP) $(AUDIOLIB_OBJS_EXP) $(DUKE3D_EDITOR_MISCDEPS)
441
	$(LINK_STATUS)
445
	$(LINK_STATUS)
442
	$(RECIPE_IF) $(LINKER) -o $@ $^ $(COMMONFLAGS) $(LINKERFLAGS) $(DUKE3D_EDITOR_LINKERFLAGS) $(LIBDIRS) $(LIBS) $(STATICSTDCPP) $(RECIPE_RESULT_LINK)
446
	$(RECIPE_IF) $(LINKER) -o $@ $^ $(COMMONFLAGS) $(LINKERFLAGS) $(DUKE3D_EDITOR_LINKERFLAGS) $(LIBDIRS) $(LIBS) $(STATICSTDCPP) $(RECIPE_RESULT_LINK)
443
ifeq ($(PLATFORM),WII)
447
ifeq ($(PLATFORM),WII)
444
ifneq ($(ELF2DOL),)
448
ifneq ($(ELF2DOL),)
445
	$(ELF2DOL) $(MAPSTER32)$(EXESUFFIX) $(MAPSTER32)$(DOLSUFFIX)
449
	$(ELF2DOL) $(MAPSTER32)$(EXESUFFIX) $(MAPSTER32)$(DOLSUFFIX)
446
endif
450
endif
447
endif
451
endif
448
ifneq ($(STRIP),)
452
ifneq ($(STRIP),)
449
	$(STRIP) $(MAPSTER32)$(EXESUFFIX)
453
	$(STRIP) $(MAPSTER32)$(EXESUFFIX)
450
endif
454
endif
451
ifeq ($(PLATFORM),DARWIN)
455
ifeq ($(PLATFORM),DARWIN)
452
	cp -RPf "platform/Apple/bundles/Mapster32.app" "./"
456
	cp -RPf "platform/Apple/bundles/Mapster32.app" "./"
453
	mkdir -p "Mapster32.app/Contents/MacOS"
457
	mkdir -p "Mapster32.app/Contents/MacOS"
454
	cp -f "$(MAPSTER32)$(EXESUFFIX)" "Mapster32.app/Contents/MacOS/"
458
	cp -f "$(MAPSTER32)$(EXESUFFIX)" "Mapster32.app/Contents/MacOS/"
455
endif
459
endif
456
460
457
include Makefile.deps
461
include Makefile.deps
458
include $(ENGINE_ROOT)/Makefile.deps
462
include $(ENGINE_ROOT)/Makefile.deps
459
463
460
# RULES
464
# RULES
461
465
462
$(EBACKTRACEDLL): platform/Windows/src/backtrace.c
466
$(EBACKTRACEDLL): platform/Windows/src/backtrace.c
463
	$(COMPILE_STATUS)
467
	$(COMPILE_STATUS)
464
	$(RECIPE_IF) $(CC) $(CONLYFLAGS) -O2 -ggdb -shared -Wall -Wextra -static-libgcc -I$(ENGINE_INC) -o $@ $^ -lbfd -liberty -limagehlp $(RECIPE_RESULT_COMPILE)
468
	$(RECIPE_IF) $(CC) $(CONLYFLAGS) -O2 -ggdb -shared -Wall -Wextra -static-libgcc -I$(ENGINE_INC) -o $@ $^ -lbfd -liberty -limagehlp $(RECIPE_RESULT_COMPILE)
465
469
466
libcache1d$(DLLSUFFIX): $(ENGINE_SRC)/cache1d.c
470
libcache1d$(DLLSUFFIX): $(ENGINE_SRC)/cache1d.c
467
	$(COMPILE_STATUS)
471
	$(COMPILE_STATUS)
468
	$(RECIPE_IF) $(COMPILER) -Wall -Wextra -DCACHE1D_COMPRESS_ONLY -shared -fPIC $< -o $@ $(RECIPE_RESULT_COMPILE)
472
	$(RECIPE_IF) $(COMPILER) -Wall -Wextra -DCACHE1D_COMPRESS_ONLY -shared -fPIC $< -o $@ $(RECIPE_RESULT_COMPILE)
469
473
470
%$(EXESUFFIX): $(ENGINE_OBJ)/%.$o $(UTIL_OBJS_EXP)
474
%$(EXESUFFIX): $(ENGINE_OBJ)/%.$o $(UTIL_OBJS_EXP)
471
	$(ONESTEP_STATUS)
475
	$(ONESTEP_STATUS)
472
	$(RECIPE_IF) $(LINKER) -o $@ $^ $(COMMONFLAGS) $(LINKERFLAGS) $(LIBDIRS) $(LIBS) $(UTIL_LIBS) $(RECIPE_RESULT_ONESTEP)
476
	$(RECIPE_IF) $(LINKER) -o $@ $^ $(COMMONFLAGS) $(LINKERFLAGS) $(LIBDIRS) $(LIBS) $(UTIL_LIBS) $(RECIPE_RESULT_ONESTEP)
473
477
474
%$(EXESUFFIX): $(DUKE3D_OBJ)/%.$o
478
%$(EXESUFFIX): $(DUKE3D_OBJ)/%.$o
475
	$(ONESTEP_STATUS)
479
	$(ONESTEP_STATUS)
476
	$(RECIPE_IF) $(LINKER) -o $@ $^ $(COMMONFLAGS) $(LINKERFLAGS) $(LIBDIRS) $(LIBS) $(UTIL_LIBS) $(RECIPE_RESULT_ONESTEP)
480
	$(RECIPE_IF) $(LINKER) -o $@ $^ $(COMMONFLAGS) $(LINKERFLAGS) $(LIBDIRS) $(LIBS) $(UTIL_LIBS) $(RECIPE_RESULT_ONESTEP)
477
481
478
enumdisplay$(EXESUFFIX): $(ENGINE_OBJ)/enumdisplay.$o
482
enumdisplay$(EXESUFFIX): $(ENGINE_OBJ)/enumdisplay.$o
479
	$(ONESTEP_STATUS)
483
	$(ONESTEP_STATUS)
480
	$(RECIPE_IF) $(LINKER) -o $@ $^ $(COMMONFLAGS) $(LINKERFLAGS) $(LIBDIRS) $(LIBS) $(UTIL_LIBS) -lgdi32 $(RECIPE_RESULT_ONESTEP)
484
	$(RECIPE_IF) $(LINKER) -o $@ $^ $(COMMONFLAGS) $(LINKERFLAGS) $(LIBDIRS) $(LIBS) $(UTIL_LIBS) -lgdi32 $(RECIPE_RESULT_ONESTEP)
481
getdxdidf$(EXESUFFIX): $(ENGINE_OBJ)/getdxdidf.$o
485
getdxdidf$(EXESUFFIX): $(ENGINE_OBJ)/getdxdidf.$o
482
	$(ONESTEP_STATUS)
486
	$(ONESTEP_STATUS)
483
	$(RECIPE_IF) $(LINKER) -o $@ $^ $(COMMONFLAGS) $(LINKERFLAGS) $(LIBDIRS) $(LIBS) $(UTIL_LIBS) -ldinput $(RECIPE_RESULT_ONESTEP)
487
	$(RECIPE_IF) $(LINKER) -o $@ $^ $(COMMONFLAGS) $(LINKERFLAGS) $(LIBDIRS) $(LIBS) $(UTIL_LIBS) -ldinput $(RECIPE_RESULT_ONESTEP)
484
makesdlkeytrans$(EXESUFFIX): $(ENGINE_OBJ)/makesdlkeytrans.$o
488
makesdlkeytrans$(EXESUFFIX): $(ENGINE_OBJ)/makesdlkeytrans.$o
485
	$(ONESTEP_STATUS)
489
	$(ONESTEP_STATUS)
486
	$(RECIPE_IF) $(LINKER) -o $@ $^ $(COMMONFLAGS) $(LINKERFLAGS) $(LIBDIRS) $(LIBS) $(UTIL_LIBS) $(SDL_INCLUDES) $(RECIPE_RESULT_ONESTEP)
490
	$(RECIPE_IF) $(LINKER) -o $@ $^ $(COMMONFLAGS) $(LINKERFLAGS) $(LIBDIRS) $(LIBS) $(UTIL_LIBS) $(SDL_INCLUDES) $(RECIPE_RESULT_ONESTEP)
487
arttool$(EXESUFFIX): $(ENGINE_OBJ)/arttool.$o
491
arttool$(EXESUFFIX): $(ENGINE_OBJ)/arttool.$o
488
	$(ONESTEP_STATUS)
492
	$(ONESTEP_STATUS)
489
	$(RECIPE_IF) $(L_CXX) $(CPPONLYFLAGS) -o $@ $^ $(COMMONFLAGS) $(LINKERFLAGS) $(LIBDIRS) $(LIBS) $(STATICSTDCPP) $(STDCPPLIB) $(UTIL_LIBS) $(RECIPE_RESULT_ONESTEP)
493
	$(RECIPE_IF) $(L_CXX) $(CPPONLYFLAGS) -o $@ $^ $(COMMONFLAGS) $(LINKERFLAGS) $(LIBDIRS) $(LIBS) $(STATICSTDCPP) $(STDCPPLIB) $(UTIL_LIBS) $(RECIPE_RESULT_ONESTEP)
490
494
491
#### Lunatic
495
#### Lunatic
492
496
493
# Create object files directly with luajit
497
# Create object files directly with luajit
494
$(DUKE3D_OBJ)/luaJIT_BC_%.$o: source/lunatic/%.lua
498
$(DUKE3D_OBJ)/luaJIT_BC_%.$o: source/lunatic/%.lua
495
	$(COMPILE_STATUS)
499
	$(COMPILE_STATUS)
496
	$(RECIPE_IF) $(LUAJIT) -bg $(LUAJIT_BCOPTS) $< $@ $(RECIPE_RESULT_COMPILE)
500
	$(RECIPE_IF) $(LUAJIT) -bg $(LUAJIT_BCOPTS) $< $@ $(RECIPE_RESULT_COMPILE)
497
501
498
# Same thing for defs*.ilua which I'm too reluctant to rename now:
502
# Same thing for defs*.ilua which I'm too reluctant to rename now:
499
# NOTE: The target path must match EXACTLY with that of the DEFS_BC_SIZE
503
# NOTE: The target path must match EXACTLY with that of the DEFS_BC_SIZE
500
# determination in Makefile.common, because it is embedded into the bytecode as
504
# determination in Makefile.common, because it is embedded into the bytecode as
501
# debugging information.
505
# debugging information.
502
$(DUKE3D_OBJ)/luaJIT_BC_%.$o: source/lunatic/%.ilua
506
$(DUKE3D_OBJ)/luaJIT_BC_%.$o: source/lunatic/%.ilua
503
	$(RECIPE_IF) $(LUAJIT) -bg $(LUAJIT_BCOPTS) $< $@ $(RECIPE_RESULT_COMPILE)
507
	$(RECIPE_IF) $(LUAJIT) -bg $(LUAJIT_BCOPTS) $< $@ $(RECIPE_RESULT_COMPILE)
504
508
505
$(DUKE3D_OBJ)/%.$o: $(DUKE3D_SRC)/lunatic/%.c
509
$(DUKE3D_OBJ)/%.$o: $(DUKE3D_SRC)/lunatic/%.c
506
	$(COMPILE_STATUS)
510
	$(COMPILE_STATUS)
507
	$(RECIPE_IF) $(COMPILER) $(COMMONFLAGS) $(COMPILERFLAGS) $(DUKE3D_CFLAGS) -c $< -o $@ $(RECIPE_RESULT_COMPILE)
511
	$(RECIPE_IF) $(COMPILER) $(COMMONFLAGS) $(COMPILERFLAGS) $(DUKE3D_CFLAGS) -c $< -o $@ $(RECIPE_RESULT_COMPILE)
508
512
509
# TODO: _m32
513
# TODO: _m32
510
# List of exported symbols, OS X
514
# List of exported symbols, OS X
511
$(DUKE3D_SRC)/lunatic/dynsymlist_osx: $(DUKE3D_SRC)/lunatic/dynsymlist
515
$(DUKE3D_SRC)/lunatic/dynsymlist_osx: $(DUKE3D_SRC)/lunatic/dynsymlist
512
	sed 's/[{};]//g;s/[A-Za-z_][A-Za-z_0-9]*/_&/g' $< > $@
516
	sed 's/[{};]//g;s/[A-Za-z_][A-Za-z_0-9]*/_&/g' $< > $@
513
517
514
#$(DUKE3D_SRC)/lunatic/aliases_list: $(DUKE3D_SRC)/lunatic/dynsymlist_osx
518
#$(DUKE3D_SRC)/lunatic/aliases_list: $(DUKE3D_SRC)/lunatic/dynsymlist_osx
515
#	sed 's/_\([A-Za-z_][A-Za-z_0-9]*\)/_\1 \1/g' $< > $@
519
#	sed 's/_\([A-Za-z_][A-Za-z_0-9]*\)/_\1 \1/g' $< > $@
516
520
517
# List of exported symbols, Windows
521
# List of exported symbols, Windows
518
$(DUKE3D_SRC)/lunatic/eduke32.def: $(DUKE3D_SRC)/lunatic/dynsymlist
522
$(DUKE3D_SRC)/lunatic/eduke32.def: $(DUKE3D_SRC)/lunatic/dynsymlist
519
	echo EXPORTS > $@
523
	echo EXPORTS > $@
520
	sed 's/[{};]//g' $< >> $@
524
	sed 's/[{};]//g' $< >> $@
521
525
522
$(DUKE3D_SRC)/lunatic/mapster32.def: $(DUKE3D_SRC)/lunatic/dynsymlist_m32
526
$(DUKE3D_SRC)/lunatic/mapster32.def: $(DUKE3D_SRC)/lunatic/dynsymlist_m32
523
	echo EXPORTS > $@
527
	echo EXPORTS > $@
524
	sed 's/[{};]//g' $< >> $@
528
	sed 's/[{};]//g' $< >> $@
525
529
526
####
530
####
527
531
528
$(ENGINE_OBJ)/%.$o: $(ENGINE_SRC)/%.nasm | $(ENGINE_OBJ)
532
$(ENGINE_OBJ)/%.$o: $(ENGINE_SRC)/%.nasm | $(ENGINE_OBJ)
529
	$(COMPILE_STATUS)
533
	$(COMPILE_STATUS)
530
	$(RECIPE_IF) $(AS) $(ASFLAGS) $< -o $@ $(RECIPE_RESULT_COMPILE)
534
	$(RECIPE_IF) $(AS) $(ASFLAGS) $< -o $@ $(RECIPE_RESULT_COMPILE)
531
535
532
$(ENGINE_OBJ)/%.$o: $(ENGINE_SRC)/%.yasm | $(ENGINE_OBJ)
536
$(ENGINE_OBJ)/%.$o: $(ENGINE_SRC)/%.yasm | $(ENGINE_OBJ)
533
	$(COMPILE_STATUS)
537
	$(COMPILE_STATUS)
534
	$(RECIPE_IF) $(AS) $(ASFLAGS) $< -o $@ $(RECIPE_RESULT_COMPILE)
538
	$(RECIPE_IF) $(AS) $(ASFLAGS) $< -o $@ $(RECIPE_RESULT_COMPILE)
535
539
536
# Comment out the following rule to debug a-c.o
540
# Comment out the following rule to debug a-c.o
537
$(ENGINE_OBJ)/a-c.$o: $(ENGINE_SRC)/a-c.c | $(ENGINE_OBJ)
541
$(ENGINE_OBJ)/a-c.$o: $(ENGINE_SRC)/a-c.c | $(ENGINE_OBJ)
538
	$(COMPILE_STATUS)
542
	$(COMPILE_STATUS)
539
	$(RECIPE_IF) $(COMPILER) $(subst -O$(OPTLEVEL),-O2,$(subst $(CLANG_DEBUG_FLAGS),,$(COMMONFLAGS) $(COMPILERFLAGS))) $(ENGINE_CFLAGS) -c $< -o $@ $(RECIPE_RESULT_COMPILE)
543
	$(RECIPE_IF) $(COMPILER) $(subst -O$(OPTLEVEL),-O2,$(subst $(CLANG_DEBUG_FLAGS),,$(COMMONFLAGS) $(COMPILERFLAGS))) $(ENGINE_CFLAGS) -c $< -o $@ $(RECIPE_RESULT_COMPILE)
540
544
541
$(ENGINE_OBJ)/%.$o: $(ENGINE_SRC)/%.c | $(ENGINE_OBJ)
545
$(ENGINE_OBJ)/%.$o: $(ENGINE_SRC)/%.c | $(ENGINE_OBJ)
542
	$(COMPILE_STATUS)
546
	$(COMPILE_STATUS)
543
	$(RECIPE_IF) $(COMPILER) $(COMMONFLAGS) $(COMPILERFLAGS) $(ENGINE_CFLAGS) -c $< -o $@ $(RECIPE_RESULT_COMPILE)
547
	$(RECIPE_IF) $(COMPILER) $(COMMONFLAGS) $(COMPILERFLAGS) $(ENGINE_CFLAGS) -c $< -o $@ $(RECIPE_RESULT_COMPILE)
544
548
545
$(ENGINE_OBJ)/%.$o: $(ENGINE_SRC)/%.m | $(ENGINE_OBJ)
549
$(ENGINE_OBJ)/%.$o: $(ENGINE_SRC)/%.m | $(ENGINE_OBJ)
546
	$(COMPILE_STATUS)
550
	$(COMPILE_STATUS)
547
	$(RECIPE_IF) $(COMPILER_OBJC) $(COMMONFLAGS) $(COMPILERFLAGS) $(ENGINE_CFLAGS) -c $< -o $@ $(RECIPE_RESULT_COMPILE)
551
	$(RECIPE_IF) $(COMPILER_OBJC) $(COMMONFLAGS) $(COMPILERFLAGS) $(ENGINE_CFLAGS) -c $< -o $@ $(RECIPE_RESULT_COMPILE)
548
552
549
$(ENGINE_OBJ)/%.$o: $(ENGINE_SRC)/%.cpp | $(ENGINE_OBJ)
553
$(ENGINE_OBJ)/%.$o: $(ENGINE_SRC)/%.cpp | $(ENGINE_OBJ)
550
	$(COMPILE_STATUS)
554
	$(COMPILE_STATUS)
551
	$(RECIPE_IF) $(CXX) $(CPPONLYFLAGS) $(COMMONFLAGS) $(COMPILERFLAGS) $(ENGINE_CFLAGS) -c $< -o $@ $(RECIPE_RESULT_COMPILE)
555
	$(RECIPE_IF) $(CXX) $(CPPONLYFLAGS) $(COMMONFLAGS) $(COMPILERFLAGS) $(ENGINE_CFLAGS) -c $< -o $@ $(RECIPE_RESULT_COMPILE)
552
556
553
$(ENGINE_OBJ)/%.$o: $(ENGINE_SRC)/misc/%.c | $(ENGINE_OBJ)
557
$(ENGINE_OBJ)/%.$o: $(ENGINE_SRC)/misc/%.c | $(ENGINE_OBJ)
554
	$(COMPILE_STATUS)
558
	$(COMPILE_STATUS)
555
	$(RECIPE_IF) $(COMPILER) $(COMMONFLAGS) $(COMPILERFLAGS) $(ENGINE_CFLAGS) -c $< -o $@ $(RECIPE_RESULT_COMPILE)
559
	$(RECIPE_IF) $(COMPILER) $(COMMONFLAGS) $(COMPILERFLAGS) $(ENGINE_CFLAGS) -c $< -o $@ $(RECIPE_RESULT_COMPILE)
556
560
557
$(ENGINE_OBJ)/%.$o: $(ENGINE_SRC)/util/%.c | $(ENGINE_OBJ)
561
$(ENGINE_OBJ)/%.$o: $(ENGINE_SRC)/util/%.c | $(ENGINE_OBJ)
558
	$(COMPILE_STATUS)
562
	$(COMPILE_STATUS)
559
	$(RECIPE_IF) $(COMPILER) $(COMMONFLAGS) $(COMPILERFLAGS) $(ENGINE_CFLAGS) -c $< -o $@ $(RECIPE_RESULT_COMPILE)
563
	$(RECIPE_IF) $(COMPILER) $(COMMONFLAGS) $(COMPILERFLAGS) $(ENGINE_CFLAGS) -c $< -o $@ $(RECIPE_RESULT_COMPILE)
560
564
561
$(ENGINE_OBJ)/%.$o: $(ENGINE_SRC)/util/%.cpp | $(ENGINE_OBJ)
565
$(ENGINE_OBJ)/%.$o: $(ENGINE_SRC)/util/%.cpp | $(ENGINE_OBJ)
562
	$(COMPILE_STATUS)
566
	$(COMPILE_STATUS)
563
	$(RECIPE_IF) $(CXX) $(CPPONLYFLAGS) $(COMMONFLAGS) $(COMPILERFLAGS) $(ENGINE_CFLAGS) -c $< -o $@ $(RECIPE_RESULT_COMPILE)
567
	$(RECIPE_IF) $(CXX) $(CPPONLYFLAGS) $(COMMONFLAGS) $(COMPILERFLAGS) $(ENGINE_CFLAGS) -c $< -o $@ $(RECIPE_RESULT_COMPILE)
564
568
565
$(ENGINE_OBJ)/%.$o: $(ENGINE_SRC)/util/%.cc | $(ENGINE_OBJ)
569
$(ENGINE_OBJ)/%.$o: $(ENGINE_SRC)/util/%.cc | $(ENGINE_OBJ)
566
	$(COMPILE_STATUS)
570
	$(COMPILE_STATUS)
567
	$(RECIPE_IF) $(CXX) $(CPPONLYFLAGS) $(COMMONFLAGS) $(COMPILERFLAGS) $(ENGINE_CFLAGS) -c $< -o $@ $(RECIPE_RESULT_COMPILE)
571
	$(RECIPE_IF) $(CXX) $(CPPONLYFLAGS) $(COMMONFLAGS) $(COMPILERFLAGS) $(ENGINE_CFLAGS) -c $< -o $@ $(RECIPE_RESULT_COMPILE)
568
572
569
$(ENGINE_OBJ)/%.$o: $(DUKE3D_RSRC)/%.c | $(ENGINE_OBJ)
573
$(ENGINE_OBJ)/%.$o: $(DUKE3D_RSRC)/%.c | $(ENGINE_OBJ)
570
	$(COMPILE_STATUS)
574
	$(COMPILE_STATUS)
571
	$(RECIPE_IF) $(COMPILER) $(COMMONFLAGS) $(COMPILERFLAGS) -c $< -o $@ $(RECIPE_RESULT_COMPILE)
575
	$(RECIPE_IF) $(COMPILER) $(COMMONFLAGS) $(COMPILERFLAGS) -c $< -o $@ $(RECIPE_RESULT_COMPILE)
572
576
573
$(AUDIOLIB_OBJ)/%.o: $(AUDIOLIB_SRC)/%.c | $(AUDIOLIB_OBJ)
577
$(AUDIOLIB_OBJ)/%.o: $(AUDIOLIB_SRC)/%.c | $(AUDIOLIB_OBJ)
574
	$(COMPILE_STATUS)
578
	$(COMPILE_STATUS)
575
	$(RECIPE_IF) $(COMPILER) $(COMMONFLAGS) $(COMPILERFLAGS) $(AUDIOLIB_CFLAGS) -c $< -o $@ $(RECIPE_RESULT_COMPILE)
579
	$(RECIPE_IF) $(COMPILER) $(COMMONFLAGS) $(COMPILERFLAGS) $(AUDIOLIB_CFLAGS) -c $< -o $@ $(RECIPE_RESULT_COMPILE)
576
580
577
$(ENET_OBJ)/%.o: $(ENET_SRC)/%.c $(ENET_INC)/enet/*.h | $(ENET_OBJ)
581
$(ENET_OBJ)/%.o: $(ENET_SRC)/%.c $(ENET_INC)/enet/*.h | $(ENET_OBJ)
578
	$(COMPILE_STATUS)
582
	$(COMPILE_STATUS)
579
	$(RECIPE_IF) $(COMPILER) $(COMMONFLAGS) $(COMPILERFLAGS) $(ENET_CFLAGS) -c $< -o $@ $(RECIPE_RESULT_COMPILE)
583
	$(RECIPE_IF) $(COMPILER) $(COMMONFLAGS) $(COMPILERFLAGS) $(ENET_CFLAGS) -c $< -o $@ $(RECIPE_RESULT_COMPILE)
580
584
581
$(TESTGAME_OBJ)/%.$o: $(TESTGAME_SRC)/%.c | $(TESTGAME_OBJ)
585
$(TESTGAME_OBJ)/%.$o: $(TESTGAME_SRC)/%.c | $(TESTGAME_OBJ)
582
	$(COMPILE_STATUS)
586
	$(COMPILE_STATUS)
583
	$(RECIPE_IF) $(COMPILER) $(COMMONFLAGS) $(COMPILERFLAGS) $(TESTGAME_CFLAGS) -c $< -o $@ $(RECIPE_RESULT_COMPILE)
587
	$(RECIPE_IF) $(COMPILER) $(COMMONFLAGS) $(COMPILERFLAGS) $(TESTGAME_CFLAGS) -c $< -o $@ $(RECIPE_RESULT_COMPILE)
584
588
585
$(TESTGAME_OBJ)/%.$o: $(TESTGAME_RSRC)/%.rc | $(TESTGAME_OBJ)
589
$(TESTGAME_OBJ)/%.$o: $(TESTGAME_RSRC)/%.rc | $(TESTGAME_OBJ)
586
	$(COMPILE_STATUS)
590
	$(COMPILE_STATUS)
587
	$(RECIPE_IF) $(RC) -i $< -o $@ --include-dir=$(ENGINE_INC) --include-dir=$(TESTGAME_SRC) --include-dir=$(TESTGAME_RSRC) $(RECIPE_RESULT_COMPILE)
591
	$(RECIPE_IF) $(RC) -i $< -o $@ --include-dir=$(ENGINE_INC) --include-dir=$(TESTGAME_SRC) --include-dir=$(TESTGAME_RSRC) $(RECIPE_RESULT_COMPILE)
588
592
589
$(TESTGAME_OBJ)/%.$o: $(TESTGAME_RSRC)/%.c | $(TESTGAME_OBJ)
593
$(TESTGAME_OBJ)/%.$o: $(TESTGAME_RSRC)/%.c | $(TESTGAME_OBJ)
590
	$(COMPILE_STATUS)
594
	$(COMPILE_STATUS)
591
	$(RECIPE_IF) $(COMPILER) $(COMMONFLAGS) $(COMPILERFLAGS) $(TESTGAME_CFLAGS) -c $< -o $@ $(RECIPE_RESULT_COMPILE)
595
	$(RECIPE_IF) $(COMPILER) $(COMMONFLAGS) $(COMPILERFLAGS) $(TESTGAME_CFLAGS) -c $< -o $@ $(RECIPE_RESULT_COMPILE)
592
596
593
$(DUKE3D_OBJ)/%.$o: $(DUKE3D_SRC)/%.c | $(DUKE3D_OBJ)
597
$(DUKE3D_OBJ)/%.$o: $(DUKE3D_SRC)/%.c | $(DUKE3D_OBJ)
594
	$(COMPILE_STATUS)
598
	$(COMPILE_STATUS)
595
	$(RECIPE_IF) $(COMPILER) $(COMMONFLAGS) $(COMPILERFLAGS) $(DUKE3D_CFLAGS) -c $< -o $@ $(RECIPE_RESULT_COMPILE)
599
	$(RECIPE_IF) $(COMPILER) $(COMMONFLAGS) $(COMPILERFLAGS) $(DUKE3D_CFLAGS) -c $< -o $@ $(RECIPE_RESULT_COMPILE)
596
600
597
$(DUKE3D_OBJ)/rev.$o: $(DUKE3D_SRC)/rev.c | $(DUKE3D_OBJ)
601
$(DUKE3D_OBJ)/rev.$o: $(DUKE3D_SRC)/rev.c | $(DUKE3D_OBJ)
598
	$(COMPILE_STATUS)
602
	$(COMPILE_STATUS)
599
	$(RECIPE_IF) $(COMPILER) $(COMMONFLAGS) $(COMPILERFLAGS) $(DUKE3D_CFLAGS) $(REVFLAG) -c $< -o $@ $(RECIPE_RESULT_COMPILE)
603
	$(RECIPE_IF) $(COMPILER) $(COMMONFLAGS) $(COMPILERFLAGS) $(DUKE3D_CFLAGS) $(REVFLAG) -c $< -o $@ $(RECIPE_RESULT_COMPILE)
600
604
601
$(DUKE3D_OBJ)/%.$o: $(DUKE3D_SRC)/util/%.c | $(DUKE3D_OBJ)
605
$(DUKE3D_OBJ)/%.$o: $(DUKE3D_SRC)/util/%.c | $(DUKE3D_OBJ)
602
	$(COMPILE_STATUS)
606
	$(COMPILE_STATUS)
603
	$(RECIPE_IF) $(COMPILER) $(COMMONFLAGS) $(COMPILERFLAGS) $(DUKE3D_CFLAGS) -c $< -o $@ $(RECIPE_RESULT_COMPILE)
607
	$(RECIPE_IF) $(COMPILER) $(COMMONFLAGS) $(COMPILERFLAGS) $(DUKE3D_CFLAGS) -c $< -o $@ $(RECIPE_RESULT_COMPILE)
604
608
605
$(DUKE3D_OBJ)/%.$o: $(DUKE3D_SRC)/%.m | $(DUKE3D_OBJ)
609
$(DUKE3D_OBJ)/%.$o: $(DUKE3D_SRC)/%.m | $(DUKE3D_OBJ)
606
	$(COMPILE_STATUS)
610
	$(COMPILE_STATUS)
607
	$(RECIPE_IF) $(COMPILER_OBJC) $(COMMONFLAGS) $(COMPILERFLAGS) $(DUKE3D_CFLAGS) -c $< -o $@ $(RECIPE_RESULT_COMPILE)
611
	$(RECIPE_IF) $(COMPILER_OBJC) $(COMMONFLAGS) $(COMPILERFLAGS) $(DUKE3D_CFLAGS) -c $< -o $@ $(RECIPE_RESULT_COMPILE)
608
612
609
$(DUKE3D_OBJ)/%.$o: $(DUKE3D_SRC)/%.cpp | $(DUKE3D_OBJ)
613
$(DUKE3D_OBJ)/%.$o: $(DUKE3D_SRC)/%.cpp | $(DUKE3D_OBJ)
610
	$(COMPILE_STATUS)
614
	$(COMPILE_STATUS)
611
	$(RECIPE_IF) $(CXX) $(CPPONLYFLAGS) $(COMMONFLAGS) $(COMPILERFLAGS) $(DUKE3D_CFLAGS) -c $< -o $@ $(RECIPE_RESULT_COMPILE)
615
	$(RECIPE_IF) $(CXX) $(CPPONLYFLAGS) $(COMMONFLAGS) $(COMPILERFLAGS) $(DUKE3D_CFLAGS) -c $< -o $@ $(RECIPE_RESULT_COMPILE)
612
616
613
$(DUKE3D_OBJ)/%.$o: $(DUKE3D_SRC)/jmact/%.c | $(DUKE3D_OBJ)
617
$(DUKE3D_OBJ)/%.$o: $(DUKE3D_SRC)/jmact/%.c | $(DUKE3D_OBJ)
614
	$(COMPILE_STATUS)
618
	$(COMPILE_STATUS)
615
	$(RECIPE_IF) $(COMPILER) $(COMMONFLAGS) $(COMPILERFLAGS) $(DUKE3D_CFLAGS) -c $< -o $@ $(RECIPE_RESULT_COMPILE)
619
	$(RECIPE_IF) $(COMPILER) $(COMMONFLAGS) $(COMPILERFLAGS) $(DUKE3D_CFLAGS) -c $< -o $@ $(RECIPE_RESULT_COMPILE)
616
620
617
$(DUKE3D_OBJ)/%.$o: $(DUKE3D_SRC)/misc/%.rc | $(DUKE3D_OBJ)
621
$(DUKE3D_OBJ)/%.$o: $(DUKE3D_SRC)/misc/%.rc | $(DUKE3D_OBJ)
618
	$(COMPILE_STATUS)
622
	$(COMPILE_STATUS)
619
	$(RECIPE_IF) $(RC) -i $< -o $@ --include-dir=$(ENGINE_INC) --include-dir=$(DUKE3D_SRC) --include-dir=$(DUKE3D_RSRC) -DPOLYMER=$(POLYMER) $(RECIPE_RESULT_COMPILE)
623
	$(RECIPE_IF) $(RC) -i $< -o $@ --include-dir=$(ENGINE_INC) --include-dir=$(DUKE3D_SRC) --include-dir=$(DUKE3D_RSRC) -DPOLYMER=$(POLYMER) $(RECIPE_RESULT_COMPILE)
620
624
621
$(DUKE3D_OBJ)/%.$o: $(DUKE3D_RSRC)/%.c | $(DUKE3D_OBJ)
625
$(DUKE3D_OBJ)/%.$o: $(DUKE3D_RSRC)/%.c | $(DUKE3D_OBJ)
622
	$(COMPILE_STATUS)
626
	$(COMPILE_STATUS)
623
	$(RECIPE_IF) $(COMPILER) $(COMMONFLAGS) $(COMPILERFLAGS) $(DUKE3D_CFLAGS) -c $< -o $@ $(RECIPE_RESULT_COMPILE)
627
	$(RECIPE_IF) $(COMPILER) $(COMMONFLAGS) $(COMPILERFLAGS) $(DUKE3D_CFLAGS) -c $< -o $@ $(RECIPE_RESULT_COMPILE)
624
628
625
$(DUKE3D_RSRC)/%_banner.c: $(DUKE3D_RSRC)/%.bmp
629
$(DUKE3D_RSRC)/%_banner.c: $(DUKE3D_RSRC)/%.bmp
626
	echo "#include \"gtkpixdata_shim.h\"" > $@
630
	echo "#include \"gtkpixdata_shim.h\"" > $@
627
	gdk-pixbuf-csource --extern --struct --raw --name=startbanner_pixdata $^ | sed 's/load_inc//' >> $@
631
	gdk-pixbuf-csource --extern --struct --raw --name=startbanner_pixdata $^ | sed 's/load_inc//' >> $@
628
632
629
$(TESTGAME_RSRC)/%_banner.c: $(TESTGAME_RSRC)/%.bmp
633
$(TESTGAME_RSRC)/%_banner.c: $(TESTGAME_RSRC)/%.bmp
630
	echo "#include \"gtkpixdata_shim.h\"" > $@
634
	echo "#include \"gtkpixdata_shim.h\"" > $@
631
	gdk-pixbuf-csource --extern --struct --raw --name=startbanner_pixdata $^ | sed 's/load_inc//' >> $@
635
	gdk-pixbuf-csource --extern --struct --raw --name=startbanner_pixdata $^ | sed 's/load_inc//' >> $@
632
636
633
$(ENGINE_OBJ) $(AUDIOLIB_OBJ) $(ENET_OBJ) $(DUKE3D_OBJ) $(TESTGAME_OBJ):
637
$(ENGINE_OBJ) $(AUDIOLIB_OBJ) $(ENET_OBJ) $(DUKE3D_OBJ) $(TESTGAME_OBJ):
634
	-mkdir $@ $(DONT_PRINT) $(DONT_FAIL)
638
	-mkdir $@ $(DONT_PRINT) $(DONT_FAIL)
635
639
636
## PHONIES
640
## PHONIES
637
641
638
# Delete executables, object files created from sources in source/, and
642
# Delete executables, object files created from sources in source/, and
639
# miscellaneous generated files related to Lunatic on non-Linux.
643
# miscellaneous generated files related to Lunatic on non-Linux.
640
clean:
644
clean:
641
	echo "rm -f $(EDUKE32)$(EXESUFFIX) $(MAPSTER32)$(EXESUFFIX) $(DUKE3D_OBJ)/*.o $(DUKE3D_MISCDEPS) $(DUKE3D_EDITOR_MISCDEPS)"
645
	echo "rm -f $(EDUKE32)$(EXESUFFIX) $(MAPSTER32)$(EXESUFFIX) $(DUKE3D_OBJ)/*.o $(DUKE3D_MISCDEPS) $(DUKE3D_EDITOR_MISCDEPS)"
642
	-rm -f $(EDUKE32)$(EXESUFFIX) $(MAPSTER32)$(EXESUFFIX) $(DUKE3D_OBJ)/*.o $(DUKE3D_MISCDEPS) $(DUKE3D_EDITOR_MISCDEPS)
646
	-rm -f $(EDUKE32)$(EXESUFFIX) $(MAPSTER32)$(EXESUFFIX) $(DUKE3D_OBJ)/*.o $(DUKE3D_MISCDEPS) $(DUKE3D_EDITOR_MISCDEPS)
643
ifeq ($(PLATFORM),DARWIN)
647
ifeq ($(PLATFORM),DARWIN)
644
	-rm -rf EDuke32.app Mapster32.app
648
	-rm -rf EDuke32.app Mapster32.app
645
endif
649
endif
646
650
647
cleantest:
651
cleantest:
648
	-rm -f $(TESTGAME)$(EXESUFFIX) $(TESTEDITOR)$(EXESUFFIX) $(TESTGAME_OBJS_EXP) $(TESTEDITOR_OBJS_EXP)
652
	-rm -f $(TESTGAME)$(EXESUFFIX) $(TESTEDITOR)$(EXESUFFIX) $(TESTGAME_OBJS_EXP) $(TESTEDITOR_OBJS_EXP)
649
653
650
cleanutils:
654
cleanutils:
651
	-rm -f $(addsuffix $(EXESUFFIX),$(UTILS) $(GAMEUTILS)) $(addprefix $(ENGINE_OBJ)/,$(addsuffix .$o,$(UTILS))) $(addprefix $(DUKE3D_OBJ)/,$(addsuffix .$o,$(GAMEUTILS))) $(addsuffix $(EXESUFFIX),$(DXUTILS)) $(addprefix $(ENGINE_OBJ)/,$(addsuffix .$o,$(DXUTILS))) $(addsuffix $(EXESUFFIX),$(SDLUTILS)) $(addprefix $(ENGINE_OBJ)/,$(addsuffix .$o,$(SDLUTILS))) $(UTIL_OBJS_EXP)
655
	-rm -f $(addsuffix $(EXESUFFIX),$(UTILS) $(GAMEUTILS)) $(addprefix $(ENGINE_OBJ)/,$(addsuffix .$o,$(UTILS))) $(addprefix $(DUKE3D_OBJ)/,$(addsuffix .$o,$(GAMEUTILS))) $(addsuffix $(EXESUFFIX),$(DXUTILS)) $(addprefix $(ENGINE_OBJ)/,$(addsuffix .$o,$(DXUTILS))) $(addsuffix $(EXESUFFIX),$(SDLUTILS)) $(addprefix $(ENGINE_OBJ)/,$(addsuffix .$o,$(SDLUTILS))) $(UTIL_OBJS_EXP)
652
656
653
veryclean: clean cleanutils
657
veryclean: clean cleanutils
654
	echo "Removed test game and utils objects."
658
	echo "Removed test game and utils objects."
655
	echo "rm -f $(ENGINE_OBJ)/*.o $(AUDIOLIB_OBJ)/*.o $(ENET_OBJ)/*.o $(DUKE3D_RSRC)/*banner* $(EBACKTRACEDLL)"
659
	echo "rm -f $(ENGINE_OBJ)/*.o $(AUDIOLIB_OBJ)/*.o $(ENET_OBJ)/*.o $(DUKE3D_RSRC)/*banner* $(EBACKTRACEDLL)"
656
	-rm -f $(ENGINE_OBJ)/*.o $(AUDIOLIB_OBJ)/*.o $(ENET_OBJ)/*.o $(DUKE3D_RSRC)/*banner* $(EBACKTRACEDLL)
660
	-rm -f $(ENGINE_OBJ)/*.o $(AUDIOLIB_OBJ)/*.o $(ENET_OBJ)/*.o $(DUKE3D_RSRC)/*banner* $(EBACKTRACEDLL)
657
661
658
printutils:
662
printutils:
659
	echo "$(addsuffix $(EXESUFFIX),$(UTILS) $(GAMEUTILS))"
663
	echo "$(addsuffix $(EXESUFFIX),$(UTILS) $(GAMEUTILS))"
660
664
661
printdxutils:
665
printdxutils:
662
	echo "$(addsuffix $(EXESUFFIX),$(DXUTILS))"
666
	echo "$(addsuffix $(EXESUFFIX),$(DXUTILS))"
663
667
664
printsdlutils:
668
printsdlutils:
665
	echo "$(addsuffix $(EXESUFFIX),$(SDLUTILS))"
669
	echo "$(addsuffix $(EXESUFFIX),$(SDLUTILS))"
666
670
667
rev: $(DUKE3D_OBJ)/rev.$o
671
rev: $(DUKE3D_OBJ)/rev.$o