Subversion Repositories eduke32

Rev

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

Rev 4319 Rev 4343
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
7
8
# Build locations
8
# Build locations
9
#
9
#
10
SRC=source
10
SRC=source
11
RSRC=rsrc
11
RSRC=rsrc
12
ESRC=$(EROOT)/src
12
ESRC=$(EROOT)/src
13
EINC=$(EROOT)/include
13
EINC=$(EROOT)/include
14
INC=$(SRC)
14
INC=$(SRC)
15
o=o
15
o=o
16
# ENETROOT=$(ESRC)/enet
16
# ENETROOT=$(ESRC)/enet
17
17
18
ifneq (0,$(RELEASE))
18
ifneq (0,$(RELEASE))
19
    # Debugging disabled
19
    # Debugging disabled
20
    debug+= $(F_NO_STACK_PROTECTOR)
20
    debug+= $(F_NO_STACK_PROTECTOR)
21
else
21
else
22
    # Debugging enabled
22
    # Debugging enabled
23
    ifneq (0,$(KRANDDEBUG))
23
    ifneq (0,$(KRANDDEBUG))
24
        debug+= -fno-inline -fno-inline-functions -fno-inline-functions-called-once
24
        debug+= -fno-inline -fno-inline-functions -fno-inline-functions-called-once
25
    endif
25
    endif
26
endif
26
endif
27
27
28
OURCOMMONFLAGS=$(BASECOMMONFLAGS) \
28
OURCOMMONFLAGS=$(BASECOMMONFLAGS) \
29
    -I$(INC) -I$(EINC) -I$(SRC)/jmact -I$(JAUDIOLIBDIR)/include -I$(ENETDIR)/include 
29
    -I$(INC) -I$(EINC) -I$(SRC)/jmact -I$(JAUDIOLIBDIR)/include -I$(ENETDIR)/include 
30
OURCFLAGS=$(OURCOMMONFLAGS) $(BASECFLAGS)
30
OURCFLAGS=$(OURCOMMONFLAGS) $(BASECFLAGS)
31
OURCXXFLAGS=$(BASECXXFLAGS)
31
OURCXXFLAGS=$(BASECXXFLAGS)
32
OURCONLYFLAGS=$(BASECONLYFLAGS)
32
OURCONLYFLAGS=$(BASECONLYFLAGS)
33
OURASFLAGS=$(BASEASFLAGS)
33
OURASFLAGS=$(BASEASFLAGS)
34
PRINTLDFLAGS=$(BASELDFLAGS)
34
PRINTLDFLAGS=$(BASELDFLAGS)
35
OURLDFLAGS=$(OURCOMMONFLAGS) $(PRINTLDFLAGS)
35
OURLDFLAGS=$(OURCOMMONFLAGS) $(PRINTLDFLAGS)
36
36
37
# Game/editor-specific linker options
37
# Game/editor-specific linker options
38
GAMELDFLAGS=
38
GAMELDFLAGS=
39
EDITORLDFLAGS=
39
EDITORLDFLAGS=
40
40
41
LIBS=
41
LIBS=
42
LIBDIRS=
42
LIBDIRS=
43
43
44
JAUDIOLIBDIR=$(SRC)/jaudiolib
44
JAUDIOLIBDIR=$(SRC)/jaudiolib
45
JAUDIOLIB=libjfaudiolib.a
45
JAUDIOLIB=libjfaudiolib.a
46
46
47
ENETDIR=$(SRC)/enet
47
ENETDIR=$(SRC)/enet
48
ENETLIB=libenet.a
48
ENETLIB=libenet.a
49
49
50
ifeq ($(NETCODE),0)
50
ifeq ($(NETCODE),0)
51
    ENET_TARGET=
51
    ENET_TARGET=
52
else
52
else
53
    ENET_TARGET=$(ENETDIR)/$(ENETLIB)
53
    ENET_TARGET=$(ENETDIR)/$(ENETLIB)
54
endif
54
endif
55
55
56
56
57
include $(EROOT)/Makefile.shared
57
include $(EROOT)/Makefile.shared
58
58
59
# The reasoning for this order is so SDL_mixer can link to SDL, etc.
59
# The reasoning for this order is so SDL_mixer can link to SDL, etc.
60
OURLIBS=$(LIBDIRS) $(BASELIBDIRS) $(BUILDLIBDIRS) $(LIBS) $(BASELIBS) $(BUILDLIBS)
60
OURLIBS=$(LIBDIRS) $(BASELIBDIRS) $(BUILDLIBDIRS) $(LIBS) $(BASELIBS) $(BUILDLIBS)
61
61
62
62
63
EDUKE32 ?= eduke32$(EXESUFFIX)
63
EDUKE32 ?= eduke32$(EXESUFFIX)
64
MAPSTER32 ?= mapster32$(EXESUFFIX)
64
MAPSTER32 ?= mapster32$(EXESUFFIX)
65
65
66
EDUKE32_TARGET:=$(EDUKE32)
66
EDUKE32_TARGET:=$(EDUKE32)
67
MAPSTER32_TARGET:=$(MAPSTER32)
67
MAPSTER32_TARGET:=$(MAPSTER32)
68
68
69
ifndef EBACKTRACEDLL
69
ifndef EBACKTRACEDLL
70
    EBACKTRACEDLL = ebacktrace1.dll
70
    EBACKTRACEDLL = ebacktrace1.dll
71
    ifeq ($(findstring x86_64,$(COMPILERTARGET)),x86_64)
71
    ifeq ($(findstring x86_64,$(COMPILERTARGET)),x86_64)
72
        EBACKTRACEDLL = ebacktrace1-64.dll
72
        EBACKTRACEDLL = ebacktrace1-64.dll
73
    endif
73
    endif
74
endif
74
endif
75
EBACKTRACEDLL_TARGET:=$(EBACKTRACEDLL)
75
EBACKTRACEDLL_TARGET:=$(EBACKTRACEDLL)
76
76
77
ifeq ($(PLATFORM),WINDOWS)
77
ifeq ($(PLATFORM),WINDOWS)
78
    OBJ=$(SRC)/obj_win
78
    OBJ=$(SRC)/obj_win
79
    EOBJ=$(SRC)/eobj_win
79
    EOBJ=$(SRC)/eobj_win
80
else
80
else
81
    ifeq ($(SUBPLATFORM),LINUX)
81
    ifeq ($(SUBPLATFORM),LINUX)
82
        LIBS+= -lrt
82
        LIBS+= -lrt
83
    endif
83
    endif
84
    OBJ=$(SRC)/obj
84
    OBJ=$(SRC)/obj
85
    EOBJ=$(SRC)/eobj
85
    EOBJ=$(SRC)/eobj
86
endif
86
endif
87
87
88
JMACTOBJ=$(OBJ)/file_lib.$o \
88
JMACTOBJ=$(OBJ)/file_lib.$o \
89
	$(OBJ)/control.$o \
89
	$(OBJ)/control.$o \
90
	$(OBJ)/keyboard.$o \
90
	$(OBJ)/keyboard.$o \
91
	$(OBJ)/mouse.$o \
91
	$(OBJ)/mouse.$o \
92
	$(OBJ)/joystick.$o \
92
	$(OBJ)/joystick.$o \
93
	$(OBJ)/mathutil.$o \
93
	$(OBJ)/mathutil.$o \
94
	$(OBJ)/scriplib.$o \
94
	$(OBJ)/scriplib.$o \
95
	$(OBJ)/animlib.$o
95
	$(OBJ)/animlib.$o
96
96
97
GAMEOBJS=$(OBJ)/game.$o \
97
GAMEOBJS=$(OBJ)/game.$o \
98
	$(OBJ)/actors.$o \
98
	$(OBJ)/actors.$o \
99
	$(OBJ)/anim.$o \
99
	$(OBJ)/anim.$o \
100
	$(OBJ)/common.$o \
100
	$(OBJ)/common.$o \
101
	$(OBJ)/config.$o \
101
	$(OBJ)/config.$o \
102
	$(OBJ)/demo.$o \
102
	$(OBJ)/demo.$o \
103
	$(OBJ)/gamedef.$o \
103
	$(OBJ)/gamedef.$o \
104
	$(OBJ)/gameexec.$o \
104
	$(OBJ)/gameexec.$o \
105
	$(OBJ)/gamevars.$o \
105
	$(OBJ)/gamevars.$o \
106
	$(OBJ)/global.$o \
106
	$(OBJ)/global.$o \
107
	$(OBJ)/input.$o \
107
	$(OBJ)/input.$o \
108
	$(OBJ)/menus.$o \
108
	$(OBJ)/menus.$o \
109
	$(OBJ)/namesdyn.$o \
109
	$(OBJ)/namesdyn.$o \
110
	$(OBJ)/net.$o \
110
	$(OBJ)/net.$o \
111
	$(OBJ)/player.$o \
111
	$(OBJ)/player.$o \
112
	$(OBJ)/premap.$o \
112
	$(OBJ)/premap.$o \
113
	$(OBJ)/savegame.$o \
113
	$(OBJ)/savegame.$o \
114
	$(OBJ)/sector.$o \
114
	$(OBJ)/sector.$o \
115
	$(OBJ)/rts.$o \
115
	$(OBJ)/rts.$o \
116
	$(OBJ)/osdfuncs.$o \
116
	$(OBJ)/osdfuncs.$o \
117
	$(OBJ)/osdcmds.$o \
117
	$(OBJ)/osdcmds.$o \
118
	$(OBJ)/grpscan.$o \
118
	$(OBJ)/grpscan.$o \
119
	$(OBJ)/sounds.$o \
119
	$(OBJ)/sounds.$o \
120
	$(OBJ)/soundsdyn.$o \
120
	$(OBJ)/soundsdyn.$o \
121
	$(JMACTOBJ)
121
	$(JMACTOBJ)
122
122
123
EDITOROBJS=$(OBJ)/astub.$o \
123
EDITOROBJS=$(OBJ)/astub.$o \
124
	$(OBJ)/common.$o \
124
	$(OBJ)/common.$o \
125
	$(OBJ)/m32def.$o \
125
	$(OBJ)/m32def.$o \
126
	$(OBJ)/m32exec.$o \
126
	$(OBJ)/m32exec.$o \
127
	$(OBJ)/m32vars.$o \
127
	$(OBJ)/m32vars.$o \
128
	$(OBJ)/mathutil.$o \
128
	$(OBJ)/mathutil.$o \
129
	$(OBJ)/sounds_mapster32.$o
129
	$(OBJ)/sounds_mapster32.$o
130
130
131
ifneq ($(USE_LIBVPX),0)
131
ifneq ($(USE_LIBVPX),0)
132
    GAMEOBJS+= $(OBJ)/animvpx.$o
132
    GAMEOBJS+= $(OBJ)/animvpx.$o
133
endif
133
endif
134
134
135
ifneq (0,$(DISABLEINLINING))
135
ifneq (0,$(DISABLEINLINING))
136
    GAMEOBJS+= $(OBJ)/game_inline.$o \
136
    GAMEOBJS+= $(OBJ)/game_inline.$o \
137
	$(OBJ)/actors_inline.$o \
137
	$(OBJ)/actors_inline.$o \
138
	$(OBJ)/sector_inline.$o
138
	$(OBJ)/sector_inline.$o
139
endif
139
endif
140
140
141
MISCGAMEDEPS=
141
MISCGAMEDEPS=
142
MISCEDITORDEPS=
142
MISCEDITORDEPS=
143
143
144
144
145
## Lunatic devel
145
## Lunatic devel
146
ifneq (0,$(LUNATIC))
146
ifneq (0,$(LUNATIC))
147
    LUNATIC_COMMON_OBJS = \
147
    LUNATIC_COMMON_OBJS = \
148
        $(OBJ)/luaJIT_BC_defs_common.$o \
148
        $(OBJ)/luaJIT_BC_defs_common.$o \
149
        $(OBJ)/luaJIT_BC_engine_maptext.$o \
149
        $(OBJ)/luaJIT_BC_engine_maptext.$o \
150
        $(OBJ)/luaJIT_BC_engine.$o \
150
        $(OBJ)/luaJIT_BC_engine.$o \
151
        $(OBJ)/luaJIT_BC_bcarray.$o \
151
        $(OBJ)/luaJIT_BC_bcarray.$o \
152
        $(OBJ)/luaJIT_BC_bcheck.$o \
152
        $(OBJ)/luaJIT_BC_bcheck.$o \
153
        $(OBJ)/luaJIT_BC_bitar.$o \
153
        $(OBJ)/luaJIT_BC_bitar.$o \
154
        $(OBJ)/luaJIT_BC_xmath.$o \
154
        $(OBJ)/luaJIT_BC_xmath.$o \
155
        $(OBJ)/luaJIT_BC_v.$o \
155
        $(OBJ)/luaJIT_BC_v.$o \
156
        $(OBJ)/luaJIT_BC_dump.$o \
156
        $(OBJ)/luaJIT_BC_dump.$o \
157
        $(OBJ)/luaJIT_BC_dis_x86.$o \
157
        $(OBJ)/luaJIT_BC_dis_x86.$o \
158
        $(OBJ)/luaJIT_BC_dis_x64.$o \
158
        $(OBJ)/luaJIT_BC_dis_x64.$o \
159
159
160
    # TODO: remove debugging modules from release build
160
    # TODO: remove debugging modules from release build
161
161
162
    EDITOROBJS+= $(OBJ)/lunatic_m32.$o $(LUNATIC_COMMON_OBJS)
162
    EDITOROBJS+= $(OBJ)/lunatic_m32.$o $(LUNATIC_COMMON_OBJS)
163
    GAMEOBJS+= $(OBJ)/lunatic_game.$o $(LUNATIC_COMMON_OBJS)
163
    GAMEOBJS+= $(OBJ)/lunatic_game.$o $(LUNATIC_COMMON_OBJS)
164
164
165
    EDITOROBJS+= $(OBJ)/luaJIT_BC_defs_m32.$o
165
    EDITOROBJS+= $(OBJ)/luaJIT_BC_defs_m32.$o
166
166
167
    ifneq ($(PLATFORM),WINDOWS)
167
    ifneq ($(PLATFORM),WINDOWS)
168
        # On non-Windows, we expect to have liblpeg.a (or a symlink to it) in source/.
168
        # On non-Windows, we expect to have liblpeg.a (or a symlink to it) in source/.
169
        # On Windows, it will reside in platform/Windows/lib/32/ or lib/64/.
169
        # On Windows, it will reside in platform/Windows/lib/32/ or lib/64/.
170
        LIBDIRS+= -L$(OBJ)/..
170
        LIBDIRS+= -L$(OBJ)/..
171
        ifeq ($(realpath $(OBJ)/../liblpeg.a),)
171
        ifeq ($(realpath $(OBJ)/../liblpeg.a),)
172
            # XXX: This cripples "make clean" etc. too, but IMO it's better than warning.
172
            # XXX: This cripples "make clean" etc. too, but IMO it's better than warning.
173
            $(error "liblpeg.a not found in $(realpath $(OBJ)/..)")
173
            $(error "liblpeg.a not found in $(realpath $(OBJ)/..)")
174
        endif
174
        endif
175
    endif
175
    endif
176
    LIBS+= -llpeg
176
    LIBS+= -llpeg
177
    GAMEOBJS+= $(OBJ)/luaJIT_BC_con_lang.$o \
177
    GAMEOBJS+= $(OBJ)/luaJIT_BC_con_lang.$o \
178
               $(OBJ)/luaJIT_BC_lunacon.$o \
178
               $(OBJ)/luaJIT_BC_lunacon.$o \
179
               $(OBJ)/luaJIT_BC_randgen.$o \
179
               $(OBJ)/luaJIT_BC_randgen.$o \
180
               $(OBJ)/luaJIT_BC_stat.$o \
180
               $(OBJ)/luaJIT_BC_stat.$o \
181
               $(OBJ)/luaJIT_BC_control.$o \
181
               $(OBJ)/luaJIT_BC_control.$o \
182
               $(OBJ)/luaJIT_BC_defs.$o \
182
               $(OBJ)/luaJIT_BC_defs.$o \
183
               $(OBJ)/luaJIT_BC_savegame.$o \
183
               $(OBJ)/luaJIT_BC_savegame.$o \
184
               $(OBJ)/luaJIT_BC_fs.$o \
184
               $(OBJ)/luaJIT_BC_fs.$o \
185
185
186
    # now, take care of having the necessary symbols (sector, wall, etc.) in the
186
    # now, take care of having the necessary symbols (sector, wall, etc.) in the
187
    # executable no matter what the debugging level
187
    # executable no matter what the debugging level
188
188
189
    ifeq ($(PLATFORM),DARWIN)
189
    ifeq ($(PLATFORM),DARWIN)
190
        # strip on OSX says: removing global symbols from a final linked no longer supported.
190
        # strip on OSX says: removing global symbols from a final linked no longer supported.
191
        #                    Use -exported_symbols_list at link time when building
191
        #                    Use -exported_symbols_list at link time when building
192
        # But, following _their_ directions does not give us the symbols! wtf?
192
        # But, following _their_ directions does not give us the symbols! wtf?
193
        ifneq ($(STRIP),0)
193
        ifneq ($(STRIP),0)
194
            STRIP+= -s $(SRC)/lunatic/dynsymlist_osx
194
            STRIP+= -s $(SRC)/lunatic/dynsymlist_osx
195
        endif
195
        endif
196
196
197
        MISCGAMEDEPS+= $(SRC)/lunatic/dynsymlist_osx
197
        MISCGAMEDEPS+= $(SRC)/lunatic/dynsymlist_osx
198
        PRINTLDFLAGS+= -pagezero_size 10000 -image_base 100000000 #-Wl,-alias_list -Wl,$(SRC)/lunatic/aliases_list #-exported_symbols_list $(SRC)/lunatic/dynsymlist_osx
198
        PRINTLDFLAGS+= -pagezero_size 10000 -image_base 100000000 #-Wl,-alias_list -Wl,$(SRC)/lunatic/aliases_list #-exported_symbols_list $(SRC)/lunatic/dynsymlist_osx
199
    endif
199
    endif
200
    ifeq ($(PLATFORM),WINDOWS)
200
    ifeq ($(PLATFORM),WINDOWS)
201
        override STRIP=
201
        override STRIP=
202
        MISCGAMEDEPS+= $(SRC)/lunatic/eduke32.def
202
        MISCGAMEDEPS+= $(SRC)/lunatic/eduke32.def
203
        GAMELDFLAGS+= $(SRC)/lunatic/eduke32.def
203
        GAMELDFLAGS+= $(SRC)/lunatic/eduke32.def
204
        MISCEDITORDEPS+= $(SRC)/lunatic/mapster32.def
204
        MISCEDITORDEPS+= $(SRC)/lunatic/mapster32.def
205
        EDITORLDFLAGS+= $(SRC)/lunatic/mapster32.def
205
        EDITORLDFLAGS+= $(SRC)/lunatic/mapster32.def
206
    endif
206
    endif
207
    ifeq ($(SUBPLATFORM),LINUX)
207
    ifeq ($(SUBPLATFORM),LINUX)
208
        override STRIP=
208
        override STRIP=
209
        GAMELDFLAGS+= -Wl,--dynamic-list=$(SRC)/lunatic/dynsymlist
209
        GAMELDFLAGS+= -Wl,--dynamic-list=$(SRC)/lunatic/dynsymlist
210
        EDITORLDFLAGS+= -Wl,--dynamic-list=$(SRC)/lunatic/dynsymlist_m32
210
        EDITORLDFLAGS+= -Wl,--dynamic-list=$(SRC)/lunatic/dynsymlist_m32
211
    endif
211
    endif
212
endif
212
endif
213
213
214
214
215
# PLATFORM SPECIFIC SETTINGS
215
# PLATFORM SPECIFIC SETTINGS
216
216
217
ifeq ($(SUBPLATFORM),LINUX)
217
ifeq ($(SUBPLATFORM),LINUX)
218
    ifeq (0,$(CLANG))
218
    ifeq (0,$(CLANG))
219
        OURCOMMONFLAGS	+= -fno-pic
219
        OURCOMMONFLAGS	+= -fno-pic
220
    endif
220
    endif
221
    OURASFLAGS	+= -f elf
221
    OURASFLAGS	+= -f elf
222
    LIBS		+= -lFLAC -lvorbisfile -lvorbis -logg
222
    LIBS		+= -lFLAC -lvorbisfile -lvorbis -logg
223
endif
223
endif
224
224
225
ifeq ($(PLATFORM),DARWIN)
225
ifeq ($(PLATFORM),DARWIN)
226
    OURCOMMONFLAGS += -fno-pic
226
    OURCOMMONFLAGS += -fno-pic
227
    LIBDIRS += -L$(abspath $(JAUDIOLIBDIR)/third-party/Apple/lib)
227
    LIBDIRS += -L$(abspath $(JAUDIOLIBDIR)/third-party/Apple/lib)
228
228
229
    ifneq ($(findstring x86_64,$(ARCH)),x86_64)
229
    ifneq ($(findstring x86_64,$(ARCH)),x86_64)
230
        ifeq (,$(ARCH))
230
        ifeq (,$(ARCH))
231
            ifneq ($(findstring x86_64,$(SYSARCH)),x86_64)
231
            ifneq ($(findstring x86_64,$(SYSARCH)),x86_64)
232
                LIBS += -read_only_relocs suppress
232
                LIBS += -read_only_relocs suppress
233
            endif
233
            endif
234
        else
234
        else
235
            LIBS += -read_only_relocs suppress
235
            LIBS += -read_only_relocs suppress
236
        endif
236
        endif
237
    endif
237
    endif
238
238
239
    ifeq (1,$(SDL_FRAMEWORK))
239
    ifeq (1,$(SDL_FRAMEWORK))
240
        OURCOMMONFLAGS += -I$(APPLE_FRAMEWORKS)/SDL.framework/Headers \
240
        OURCOMMONFLAGS += -I$(APPLE_FRAMEWORKS)/SDL.framework/Headers \
241
                -I$(APPLE_FRAMEWORKS)/SDL_mixer.framework/Headers
241
                -I$(APPLE_FRAMEWORKS)/SDL_mixer.framework/Headers
242
242
243
        LIBS += -lFLAC -lvorbisfile -lvorbis -logg -lm \
243
        LIBS += -lFLAC -lvorbisfile -lvorbis -logg -lm \
244
                -Wl,-framework,SDL -Wl,-framework,SDL_mixer platform/Apple/lib/libSDLmain.a \
244
                -Wl,-framework,SDL -Wl,-framework,SDL_mixer platform/Apple/lib/libSDLmain.a \
245
                -Wl,-framework,Cocoa -Wl,-framework,Carbon -Wl,-framework,OpenGL \
245
                -Wl,-framework,Cocoa -Wl,-framework,Carbon -Wl,-framework,OpenGL \
246
                -Wl,-framework,CoreMidi -Wl,-framework,AudioUnit \
246
                -Wl,-framework,CoreMidi -Wl,-framework,AudioUnit \
247
                -Wl,-framework,AudioToolbox -Wl,-framework,IOKit -Wl,-framework,AGL \
247
                -Wl,-framework,AudioToolbox -Wl,-framework,IOKit -Wl,-framework,AGL \
248
                -Wl,-framework,QuickTime -lm \
248
                -Wl,-framework,QuickTime -lm \
249
                -Wl,-rpath -Wl,"@loader_path/../Frameworks"
249
                -Wl,-rpath -Wl,"@loader_path/../Frameworks"
250
        # We have SDLMain.m from the OSX SDL package in the Apple/ subdir:
250
        # We have SDLMain.m from the OSX SDL package in the Apple/ subdir:
251
        EDITOROBJS+=$(OBJ)/SDLMain.$o
251
        EDITOROBJS+=$(OBJ)/SDLMain.$o
252
        GAMEOBJS+=$(OBJ)/SDLMain.$o
252
        GAMEOBJS+=$(OBJ)/SDLMain.$o
253
    else
253
    else
254
        OURCOMMONFLAGS += -I$(SDLROOT)/include -I$(SDLROOT)/include/SDL
254
        OURCOMMONFLAGS += -I$(SDLROOT)/include -I$(SDLROOT)/include/SDL
255
        LIBS += -lFLAC -lvorbisfile -lvorbis -logg -lm -lSDL_mixer \
255
        LIBS += -lFLAC -lvorbisfile -lvorbis -logg -lm -lSDL_mixer \
256
                -Wl,-framework,Cocoa -Wl,-framework,Carbon -Wl,-framework,OpenGL \
256
                -Wl,-framework,Cocoa -Wl,-framework,Carbon -Wl,-framework,OpenGL \
257
                -Wl,-framework,CoreMidi -Wl,-framework,AudioUnit \
257
                -Wl,-framework,CoreMidi -Wl,-framework,AudioUnit \
258
                -Wl,-framework,AudioToolbox -Wl,-framework,IOKit -Wl,-framework,AGL \
258
                -Wl,-framework,AudioToolbox -Wl,-framework,IOKit -Wl,-framework,AGL \
259
                -Wl,-framework,QuickTime -lm
259
                -Wl,-framework,QuickTime -lm
260
    endif
260
    endif
261
261
262
    ifneq (0,$(OSX_STARTUPWINDOW))
262
    ifneq (0,$(OSX_STARTUPWINDOW))
263
        GAMEOBJS+=$(OBJ)/GrpFile.game.$o $(OBJ)/GameListSource.game.$o $(OBJ)/startosx.game.$o
263
        GAMEOBJS+=$(OBJ)/GrpFile.game.$o $(OBJ)/GameListSource.game.$o $(OBJ)/startosx.game.$o
264
    endif
264
    endif
265
265
266
    OURASFLAGS += -f macho
266
    OURASFLAGS += -f macho
267
endif
267
endif
268
268
269
ifeq ($(PLATFORM),WINDOWS)
269
ifeq ($(PLATFORM),WINDOWS)
270
    OURCOMMONFLAGS	+= -fno-pic -DUNDERSCORES
270
    OURCOMMONFLAGS	+= -fno-pic -DUNDERSCORES
271
    OURASFLAGS+= -DUNDERSCORES -f win32
271
    OURASFLAGS+= -DUNDERSCORES -f win32
272
    LIBS += -lFLAC -lvorbisfile -lvorbis -logg
272
    LIBS += -lFLAC -lvorbisfile -lvorbis -logg
273
    LIBDIRS += -L$(abspath $(JAUDIOLIBDIR)/third-party/Windows/lib$(WINLIB))
273
    LIBDIRS += -L$(abspath $(JAUDIOLIBDIR)/third-party/Windows/lib$(WINLIB))
274
    GAMEOBJS+= $(OBJ)/gameres.$o $(OBJ)/winbits.$o $(OBJ)/startwin.game.$o
274
    GAMEOBJS+= $(OBJ)/gameres.$o $(OBJ)/winbits.$o $(OBJ)/startwin.game.$o
275
    EDITOROBJS+= $(OBJ)/buildres.$o
275
    EDITOROBJS+= $(OBJ)/buildres.$o
276
    JAUDIOLIB=libjfaudiolib_win32.a
276
    JAUDIOLIB=libjfaudiolib_win32.a
277
    ENETLIB=libenet_win32.a
277
    ENETLIB=libenet_win32.a
278
    OURCOMMONFLAGS += -I$(DXROOT) -I$(DXROOT)/include
278
    OURCOMMONFLAGS += -I$(DXROOT) -I$(DXROOT)/include
279
    ifeq ($(MIXERTYPE),WIN)
279
    ifeq ($(MIXERTYPE),WIN)
280
        LIBS+= -ldsound
280
        LIBS+= -ldsound
281
        GAMEOBJS+= $(OBJ)/music.$o $(OBJ)/midi.$o $(OBJ)/mpu401.$o
281
        GAMEOBJS+= $(OBJ)/music.$o $(OBJ)/midi.$o $(OBJ)/mpu401.$o
282
    endif
282
    endif
283
endif
283
endif
284
# -lGLU to build with gluBuild2DMipmaps
284
# -lGLU to build with gluBuild2DMipmaps
285
ifeq ($(RENDERTYPE),SDL)
285
ifeq ($(RENDERTYPE),SDL)
286
    ifeq (1,$(HAVE_GTK2))
286
    ifeq (1,$(HAVE_GTK2))
287
        OURCOMMONFLAGS+= -DHAVE_GTK2 $(shell pkg-config --cflags gtk+-2.0)
287
        OURCOMMONFLAGS+= -DHAVE_GTK2 $(shell pkg-config --cflags gtk+-2.0)
288
        GAMEOBJS+= $(OBJ)/game_banner.$o $(OBJ)/startgtk.game.$o
288
        GAMEOBJS+= $(OBJ)/game_banner.$o $(OBJ)/startgtk.game.$o
289
        EDITOROBJS+= $(OBJ)/editor_banner.$o
289
        EDITOROBJS+= $(OBJ)/editor_banner.$o
290
    endif
290
    endif
291
291
292
    GAMEOBJS+= $(OBJ)/game_icon.$o
292
    GAMEOBJS+= $(OBJ)/game_icon.$o
293
    EDITOROBJS+= $(OBJ)/build_icon.$o
293
    EDITOROBJS+= $(OBJ)/build_icon.$o
294
endif
294
endif
295
ifeq ($(MIXERTYPE),SDL)
295
ifeq ($(MIXERTYPE),SDL)
296
    ifeq ($(PLATFORM),WINDOWS)
296
    ifeq ($(PLATFORM),WINDOWS)
297
        OURCOMMONFLAGS += -I$(SDLROOT)/include -I$(SDLROOT)/include/SDL
297
        OURCOMMONFLAGS += -I$(SDLROOT)/include -I$(SDLROOT)/include/SDL
298
        ifeq ($(SDL_TARGET),1)
298
        ifeq ($(SDL_TARGET),1)
299
            LIBS+= platform/Windows/lib$(WINLIB)/SDL_mixer.lib
299
            LIBS+= platform/Windows/lib$(WINLIB)/SDL_mixer.lib
300
        else
300
        else
301
            LIBS+= -l$(SDLNAME)_mixer
301
            LIBS+= -l$(SDLNAME)_mixer
302
        endif
302
        endif
303
        LIBDIRS+= -L$(SDLROOT)/lib
303
        LIBDIRS+= -L$(SDLROOT)/lib
304
    else
304
    else
305
        ifneq ($(PLATFORM),DARWIN)
305
        ifneq ($(PLATFORM),DARWIN)
306
            LIBS+= -l$(SDLNAME)_mixer
306
            LIBS+= -l$(SDLNAME)_mixer
307
        endif
307
        endif
308
    endif
308
    endif
309
309
310
    GAMEOBJS+= $(OBJ)/sdlmusic.$o
310
    GAMEOBJS+= $(OBJ)/sdlmusic.$o
311
endif
311
endif
312
312
313
313
314
OURCOMMONFLAGS+= $(BUILDCOMMONFLAGS)
314
OURCOMMONFLAGS+= $(BUILDCOMMONFLAGS)
315
315
316
ifeq ($(PLATFORM),WINDOWS)
316
ifeq ($(PLATFORM),WINDOWS)
317
    ifneq ($(findstring x86_64,$(COMPILERTARGET)),x86_64)
317
    ifneq ($(findstring x86_64,$(COMPILERTARGET)),x86_64)
318
        PRINTLDFLAGS+= -Wl,--large-address-aware
318
        PRINTLDFLAGS+= -Wl,--large-address-aware
319
    endif
319
    endif
320
endif
320
endif
321
#ifneq (0,$(KRANDDEBUG))
321
#ifneq (0,$(KRANDDEBUG))
322
ifeq ($(PLATFORM),DARWIN)
322
ifeq ($(PLATFORM),DARWIN)
323
    PRINTLDFLAGS+=-Wl,-map -Wl,$@.memmap
323
    PRINTLDFLAGS+=-Wl,-map -Wl,$@.memmap
324
else
324
else
325
    PRINTLDFLAGS+=-Wl,-Map=$@.memmap
325
    PRINTLDFLAGS+=-Wl,-Map=$@.memmap
326
endif
326
endif
327
#endif
327
#endif
328
ifneq (0,$(PROFILER))
328
ifneq (0,$(PROFILER))
329
    PRINTLDFLAGS+=-pg
329
    PRINTLDFLAGS+=-pg
330
endif
330
endif
331
ifeq ($(PLATFORM),WII)
331
ifeq ($(PLATFORM),WII)
332
    PRINTLDFLAGS+= -mrvl -meabi -mhard-float -Wl,--gc-sections -Wl,-Map,$(notdir $@).map
332
    PRINTLDFLAGS+= -mrvl -meabi -mhard-float -Wl,--gc-sections -Wl,-Map,$(notdir $@).map
333
    # -msdata=eabi
333
    # -msdata=eabi
334
endif
334
endif
335
335
336
COMPILER=$(CC) $(OURCONLYFLAGS)
336
COMPILER=$(CC) $(OURCONLYFLAGS)
337
LINKER=$(L_CC)
337
LINKER=$(L_CC)
338
ifneq ($(CPLUSPLUS),0)
338
ifneq ($(CPLUSPLUS),0)
339
    COMPILER=$(CXX) $(OURCXXFLAGS)
339
    COMPILER=$(CXX) $(OURCXXFLAGS)
340
    LINKER=$(L_CXX)
340
    LINKER=$(L_CXX)
341
endif
341
endif
342
342
343
ifeq ($(PRETTY_OUTPUT),1)
343
ifeq ($(PRETTY_OUTPUT),1)
344
.SILENT:
344
.SILENT:
345
endif
345
endif
346
.PHONY: clean all engine $(EOBJ)/$(ENGINELIB) $(EOBJ)/$(EDITORLIB) $(JAUDIOLIBDIR)/$(JAUDIOLIB) $(ENETDIR)/$(ENETLIB)
346
.PHONY: clean all engine $(EOBJ)/$(ENGINELIB) $(EOBJ)/$(EDITORLIB) $(JAUDIOLIBDIR)/$(JAUDIOLIB) $(ENETDIR)/$(ENETLIB)
347
347
348
# TARGETS
348
# TARGETS
349
349
350
UTILOBJS=$(OBJ)/ivfrate.$o
350
UTILOBJS=$(OBJ)/ivfrate.$o
351
UTILS=ivfrate$(EXESUFFIX)
351
UTILS=ivfrate$(EXESUFFIX)
352
352
353
all: start $(EDUKE32_TARGET) $(MAPSTER32_TARGET) finish
353
all: start $(DO_REV) $(EDUKE32_TARGET) $(MAPSTER32_TARGET) finish
354
ifneq (,$(EDUKE32_TARGET))
354
ifneq (,$(EDUKE32_TARGET))
355
	@ls -l $(EDUKE32)
355
	@ls -l $(EDUKE32)
356
endif
356
endif
357
ifneq (,$(MAPSTER32_TARGET))
357
ifneq (,$(MAPSTER32_TARGET))
358
	@ls -l $(MAPSTER32)
358
	@ls -l $(MAPSTER32)
359
endif
359
endif
360
360
361
ebacktrace: start $(EBACKTRACEDLL_TARGET) finish
361
ebacktrace: start $(EBACKTRACEDLL_TARGET) finish
362
ifneq (,$(EBACKTRACEDLL_TARGET))
362
ifneq (,$(EBACKTRACEDLL_TARGET))
363
	@ls -l $(EBACKTRACEDLL)
363
	@ls -l $(EBACKTRACEDLL)
364
endif
364
endif
365
365
366
utils: start $(UTILS) finish
366
utils: start $(UTILS) finish
367
	@ls -l $(UTILS)
367
	@ls -l $(UTILS)
368
368
369
start:
369
start:
370
	$(BUILD_STARTED)
370
	$(BUILD_STARTED)
371
371
372
finish:
372
finish:
373
	$(BUILD_FINISHED)
373
	$(BUILD_FINISHED)
374
374
375
375
376
$(EDUKE32): $(GAMEOBJS) $(EOBJ)/$(ENGINELIB) $(JAUDIOLIBDIR)/$(JAUDIOLIB) $(ENET_TARGET) $(MISCGAMEDEPS)
376
$(EDUKE32): $(GAMEOBJS) $(EOBJ)/$(ENGINELIB) $(JAUDIOLIBDIR)/$(JAUDIOLIB) $(ENET_TARGET) $(MISCGAMEDEPS)
377
	$(LINK_STATUS)
377
	$(LINK_STATUS)
378
	if $(LINKER) -o $@ $^ $(OURLDFLAGS) $(GAMELDFLAGS) $(OURLIBS) $(STATICSTDCPP); then $(LINK_OK); else $(LINK_FAILED); fi
378
	if $(LINKER) -o $@ $^ $(OURLDFLAGS) $(GAMELDFLAGS) $(OURLIBS) $(STATICSTDCPP); then $(LINK_OK); else $(LINK_FAILED); fi
379
ifneq ($(STRIP),)
379
ifneq ($(STRIP),)
380
	$(STRIP) $(EDUKE32)
380
	$(STRIP) $(EDUKE32)
381
endif
381
endif
382
ifeq ($(PLATFORM),DARWIN)
382
ifeq ($(PLATFORM),DARWIN)
383
	cp -RPf "platform/Apple/bundles/EDuke32.app" "./"
383
	cp -RPf "platform/Apple/bundles/EDuke32.app" "./"
384
	mkdir -p "EDuke32.app/Contents/MacOS"
384
	mkdir -p "EDuke32.app/Contents/MacOS"
385
	cp -f "$(EDUKE32)" "EDuke32.app/Contents/MacOS/"
385
	cp -f "$(EDUKE32)" "EDuke32.app/Contents/MacOS/"
386
endif
386
endif
387
387
388
$(MAPSTER32): $(EDITOROBJS) $(EOBJ)/$(ENGINELIB) $(EOBJ)/$(EDITORLIB) $(JAUDIOLIBDIR)/$(JAUDIOLIB) $(MISCEDITORDEPS)
388
$(MAPSTER32): $(EDITOROBJS) $(EOBJ)/$(ENGINELIB) $(EOBJ)/$(EDITORLIB) $(JAUDIOLIBDIR)/$(JAUDIOLIB) $(MISCEDITORDEPS)
389
	$(LINK_STATUS)
389
	$(LINK_STATUS)
390
	if $(LINKER) -o $@ $^ $(OURLDFLAGS) $(EDITORLDFLAGS) $(OURLIBS) $(STATICSTDCPP); then $(LINK_OK); else $(LINK_FAILED); fi
390
	if $(LINKER) -o $@ $^ $(OURLDFLAGS) $(EDITORLDFLAGS) $(OURLIBS) $(STATICSTDCPP); then $(LINK_OK); else $(LINK_FAILED); fi
391
ifneq ($(STRIP),)
391
ifneq ($(STRIP),)
392
	$(STRIP) $(MAPSTER32)
392
	$(STRIP) $(MAPSTER32)
393
endif
393
endif
394
ifeq ($(PLATFORM),DARWIN)
394
ifeq ($(PLATFORM),DARWIN)
395
	cp -RPf "platform/Apple/bundles/Mapster32.app" "./"
395
	cp -RPf "platform/Apple/bundles/Mapster32.app" "./"
396
	mkdir -p "Mapster32.app/Contents/MacOS"
396
	mkdir -p "Mapster32.app/Contents/MacOS"
397
	cp -f "$(MAPSTER32)" "Mapster32.app/Contents/MacOS/"
397
	cp -f "$(MAPSTER32)" "Mapster32.app/Contents/MacOS/"
398
endif
398
endif
399
399
400
include Makefile.deps
400
include Makefile.deps
401
401
402
.PHONY: enginelib editorlib
402
.PHONY: enginelib editorlib
403
enginelib editorlib:
403
enginelib editorlib:
404
	-mkdir -p $(EOBJ)
404
	-mkdir -p $(EOBJ)
405
ifeq ($(PRETTY_OUTPUT),1)	
405
ifeq ($(PRETTY_OUTPUT),1)	
406
	printf "\033[K\033[0;35mChanging dir to \033[1;35m$(CURDIR)/$(EROOT)\033[0;35m \033[0m\n"
406
	printf "\033[K\033[0;35mChanging dir to \033[1;35m$(CURDIR)/$(EROOT)\033[0;35m \033[0m\n"
407
endif
407
endif
408
	$(MAKE) -C $(EROOT)/ "OBJ=../$(EOBJ)" $@ LUNATIC=$(LUNATIC)
408
	$(MAKE) -C $(EROOT)/ "OBJ=../$(EOBJ)" $@ LUNATIC=$(LUNATIC)
409
ifeq ($(PRETTY_OUTPUT),1)
409
ifeq ($(PRETTY_OUTPUT),1)
410
	printf "\033[K\033[0;35mChanging dir to \033[1;35m$(CURDIR)\033[0;35m \033[0m\n"
410
	printf "\033[K\033[0;35mChanging dir to \033[1;35m$(CURDIR)\033[0;35m \033[0m\n"
411
endif	
411
endif	
412
412
413
$(EOBJ)/$(ENGINELIB): enginelib
413
$(EOBJ)/$(ENGINELIB): enginelib
414
$(EOBJ)/$(EDITORLIB): editorlib
414
$(EOBJ)/$(EDITORLIB): editorlib
415
$(JAUDIOLIBDIR)/$(JAUDIOLIB):
415
$(JAUDIOLIBDIR)/$(JAUDIOLIB):
416
ifeq ($(PRETTY_OUTPUT),1)	
416
ifeq ($(PRETTY_OUTPUT),1)	
417
	printf "\033[K\033[0;35mChanging dir to \033[1;35m$(CURDIR)/$(JAUDIOLIBDIR)\033[0;35m \033[0m\n"
417
	printf "\033[K\033[0;35mChanging dir to \033[1;35m$(CURDIR)/$(JAUDIOLIBDIR)\033[0;35m \033[0m\n"
418
endif	
418
endif	
419
	$(MAKE) -C $(JAUDIOLIBDIR)
419
	$(MAKE) -C $(JAUDIOLIBDIR)
420
ifeq ($(PRETTY_OUTPUT),1)		
420
ifeq ($(PRETTY_OUTPUT),1)		
421
	printf "\033[K\033[0;35mChanging dir to \033[1;35m$(CURDIR)\033[0;35m \033[0m\n"
421
	printf "\033[K\033[0;35mChanging dir to \033[1;35m$(CURDIR)\033[0;35m \033[0m\n"
422
endif	
422
endif	
423
423
424
$(ENETDIR)/$(ENETLIB):
424
$(ENETDIR)/$(ENETLIB):
425
ifeq ($(PRETTY_OUTPUT),1)	
425
ifeq ($(PRETTY_OUTPUT),1)	
426
	printf "\033[K\033[0;35mChanging dir to \033[1;35m$(CURDIR)/$(ENETDIR)\033[0;35m \033[0m\n"
426
	printf "\033[K\033[0;35mChanging dir to \033[1;35m$(CURDIR)/$(ENETDIR)\033[0;35m \033[0m\n"
427
endif	
427
endif	
428
	$(MAKE) -C $(ENETDIR)
428
	$(MAKE) -C $(ENETDIR)
429
ifeq ($(PRETTY_OUTPUT),1)		
429
ifeq ($(PRETTY_OUTPUT),1)		
430
	printf "\033[K\033[0;35mChanging dir to \033[1;35m$(CURDIR)\033[0;35m \033[0m\n"
430
	printf "\033[K\033[0;35mChanging dir to \033[1;35m$(CURDIR)\033[0;35m \033[0m\n"
431
endif	
431
endif	
432
432
433
433
434
# RULES
434
# RULES
435
435
436
$(EBACKTRACEDLL): platform/Windows/src/backtrace.c
436
$(EBACKTRACEDLL): platform/Windows/src/backtrace.c
437
	$(COMPILE_STATUS)
437
	$(COMPILE_STATUS)
438
	if $(CC) $(OURCONLYFLAGS) -O2 -shared -Wall -Wextra -static-libgcc -I$(EINC) -o $@ $^ -lbfd -liberty -limagehlp; then $(COMPILE_OK); else $(COMPILE_FAILED); fi
438
	if $(CC) $(OURCONLYFLAGS) -O2 -shared -Wall -Wextra -static-libgcc -I$(EINC) -o $@ $^ -lbfd -liberty -limagehlp; then $(COMPILE_OK); else $(COMPILE_FAILED); fi
439
439
440
$(OBJ)/%.$o: $(SRC)/%.nasm
440
$(OBJ)/%.$o: $(SRC)/%.nasm
441
	$(COMPILE_STATUS)
441
	$(COMPILE_STATUS)
442
	$(AS) $(OURASFLAGS) $< -o $@
442
	$(AS) $(OURASFLAGS) $< -o $@
443
443
444
$(OBJ)/%.$o: $(SRC)/%.c
444
$(OBJ)/%.$o: $(SRC)/%.c
445
	$(COMPILE_STATUS)
445
	$(COMPILE_STATUS)
446
	if $(COMPILER) $(OURCFLAGS) -c $< -o $@; then $(COMPILE_OK); else $(COMPILE_FAILED); fi
446
	if $(COMPILER) $(OURCFLAGS) -c $< -o $@; then $(COMPILE_OK); else $(COMPILE_FAILED); fi
447
447
448
#### Frama-C and related
448
#### Frama-C and related
449
449
450
.PHONY: print-compiler-options
450
.PHONY: print-compiler-options
451
print-compiler-options:
451
print-compiler-options:
452
	@echo "$(OURCFLAGS)"
452
	@echo "$(OURCFLAGS)"
453
453
454
#frama-c-check:
454
#frama-c-check:
455
#	frama-c -machdep x86_64 -cpp-command "gcc -C -E $(OURCFLAGS)" -no-annot -val source/anim.c
455
#	frama-c -machdep x86_64 -cpp-command "gcc -C -E $(OURCFLAGS)" -no-annot -val source/anim.c
456
456
457
#### Utilities
457
#### Utilities
458
458
459
$(OBJ)/%.$o: $(SRC)/util/%.c
459
$(OBJ)/%.$o: $(SRC)/util/%.c
460
	$(COMPILE_STATUS)
460
	$(COMPILE_STATUS)
461
	if $(COMPILER) $(OURCFLAGS) -c $< -o $@; then $(COMPILE_OK); else $(COMPILE_FAILED); fi
461
	if $(COMPILER) $(OURCFLAGS) -c $< -o $@; then $(COMPILE_OK); else $(COMPILE_FAILED); fi
462
462
463
ivfrate$(EXESUFFIX): $(OBJ)/ivfrate.$o
463
ivfrate$(EXESUFFIX): $(OBJ)/ivfrate.$o
464
	$(ONESTEP_STATUS)
464
	$(ONESTEP_STATUS)
465
	if $(LINKER) -o $@ $^ $(OURLDFLAGS) $(OURLIBS); then $(ONESTEP_OK); else $(ONESTEP_FAILED); fi
465
	if $(LINKER) -o $@ $^ $(OURLDFLAGS) $(OURLIBS); then $(ONESTEP_OK); else $(ONESTEP_FAILED); fi
466
466
467
#### Lunatic
467
#### Lunatic
468
468
469
# Create object files directly with luajit
469
# Create object files directly with luajit
470
$(OBJ)/luaJIT_BC_%.$o: $(MAKEFILE_COMMON_DIR)/source/lunatic/%.lua
470
$(OBJ)/luaJIT_BC_%.$o: $(MAKEFILE_COMMON_DIR)/source/lunatic/%.lua
471
	$(COMPILE_STATUS)
471
	$(COMPILE_STATUS)
472
	if $(LUAJIT) -bg $(LUAJIT_BCOPTS) $< $@; then $(COMPILE_OK); else $(COMPILE_FAILED); fi
472
	if $(LUAJIT) -bg $(LUAJIT_BCOPTS) $< $@; then $(COMPILE_OK); else $(COMPILE_FAILED); fi
473
473
474
# Same thing for defs*.ilua which I'm too reluctant to rename now:
474
# Same thing for defs*.ilua which I'm too reluctant to rename now:
475
# NOTE: The target path must match EXACTLY with that of the DEFS_BC_SIZE
475
# NOTE: The target path must match EXACTLY with that of the DEFS_BC_SIZE
476
# determination in Makefile.common, because it is embedded into the bytecode as
476
# determination in Makefile.common, because it is embedded into the bytecode as
477
# debugging information.
477
# debugging information.
478
$(OBJ)/luaJIT_BC_%.$o: $(MAKEFILE_COMMON_DIR)/source/lunatic/%.ilua
478
$(OBJ)/luaJIT_BC_%.$o: $(MAKEFILE_COMMON_DIR)/source/lunatic/%.ilua
479
	if $(LUAJIT) -bg $(LUAJIT_BCOPTS) $< $@; then $(COMPILE_OK); else $(COMPILE_FAILED); fi
479
	if $(LUAJIT) -bg $(LUAJIT_BCOPTS) $< $@; then $(COMPILE_OK); else $(COMPILE_FAILED); fi
480
480
481
$(OBJ)/%.$o: $(SRC)/lunatic/%.c
481
$(OBJ)/%.$o: $(SRC)/lunatic/%.c
482
	$(COMPILE_STATUS)
482
	$(COMPILE_STATUS)
483
	if $(COMPILER) $(OURCFLAGS) -c $< -o $@; then $(COMPILE_OK); else $(COMPILE_FAILED); fi
483
	if $(COMPILER) $(OURCFLAGS) -c $< -o $@; then $(COMPILE_OK); else $(COMPILE_FAILED); fi
484
484
485
# TODO: _m32
485
# TODO: _m32
486
# List of exported symbols, OS X
486
# List of exported symbols, OS X
487
$(SRC)/lunatic/dynsymlist_osx: $(SRC)/lunatic/dynsymlist
487
$(SRC)/lunatic/dynsymlist_osx: $(SRC)/lunatic/dynsymlist
488
	sed 's/[{};]//g;s/[A-Za-z_][A-Za-z_0-9]*/_&/g' $< > $@
488
	sed 's/[{};]//g;s/[A-Za-z_][A-Za-z_0-9]*/_&/g' $< > $@
489
489
490
#$(SRC)/lunatic/aliases_list: $(SRC)/lunatic/dynsymlist_osx
490
#$(SRC)/lunatic/aliases_list: $(SRC)/lunatic/dynsymlist_osx
491
#	sed 's/_\([A-Za-z_][A-Za-z_0-9]*\)/_\1 \1/g' $< > $@
491
#	sed 's/_\([A-Za-z_][A-Za-z_0-9]*\)/_\1 \1/g' $< > $@
492
492
493
# List of exported symbols, Windows
493
# List of exported symbols, Windows
494
$(SRC)/lunatic/eduke32.def: $(SRC)/lunatic/dynsymlist
494
$(SRC)/lunatic/eduke32.def: $(SRC)/lunatic/dynsymlist
495
	echo EXPORTS > $@
495
	echo EXPORTS > $@
496
	sed 's/[{};]//g' $< >> $@
496
	sed 's/[{};]//g' $< >> $@
497
497
498
$(SRC)/lunatic/mapster32.def: $(SRC)/lunatic/dynsymlist_m32
498
$(SRC)/lunatic/mapster32.def: $(SRC)/lunatic/dynsymlist_m32
499
	echo EXPORTS > $@
499
	echo EXPORTS > $@
500
	sed 's/[{};]//g' $< >> $@
500
	sed 's/[{};]//g' $< >> $@
501
501
502
####
502
####
503
503
504
$(OBJ)/%.$o: platform/Apple/%.m
504
$(OBJ)/%.$o: platform/Apple/%.m
505
	$(COMPILE_STATUS)
505
	$(COMPILE_STATUS)
506
	if $(COMPILER) $(OURCFLAGS) -c $< -o $@; then $(COMPILE_OK); else $(COMPILE_FAILED); fi
506
	if $(COMPILER) $(OURCFLAGS) -c $< -o $@; then $(COMPILE_OK); else $(COMPILE_FAILED); fi
507
507
508
$(OBJ)/%.$o: $(SRC)/%.m
508
$(OBJ)/%.$o: $(SRC)/%.m
509
	$(COMPILE_STATUS)
509
	$(COMPILE_STATUS)
510
	if $(COMPILER) $(OURCFLAGS) -c $< -o $@; then $(COMPILE_OK); else $(COMPILE_FAILED); fi
510
	if $(COMPILER) $(OURCFLAGS) -c $< -o $@; then $(COMPILE_OK); else $(COMPILE_FAILED); fi
511
511
512
$(OBJ)/%.$o: $(SRC)/%.cc
512
$(OBJ)/%.$o: $(SRC)/%.cc
513
	$(COMPILE_STATUS)
513
	$(COMPILE_STATUS)
514
	if $(CXX) $(OURCXXFLAGS) $(OURCFLAGS) -c $< -o $@; then $(COMPILE_OK); else $(COMPILE_FAILED); fi
514
	if $(CXX) $(OURCXXFLAGS) $(OURCFLAGS) -c $< -o $@; then $(COMPILE_OK); else $(COMPILE_FAILED); fi
515
515
516
$(OBJ)/%.$o: $(SRC)/%.cpp
516
$(OBJ)/%.$o: $(SRC)/%.cpp
517
	$(COMPILE_STATUS)
517
	$(COMPILE_STATUS)
518
	if $(CXX) $(OURCXXFLAGS) $(OURCFLAGS) -c $< -o $@; then $(COMPILE_OK); else $(COMPILE_FAILED); fi
518
	if $(CXX) $(OURCXXFLAGS) $(OURCFLAGS) -c $< -o $@; then $(COMPILE_OK); else $(COMPILE_FAILED); fi
519
519
520
$(OBJ)/%.$o: $(SRC)/%.cxx
520
$(OBJ)/%.$o: $(SRC)/%.cxx
521
	$(COMPILE_STATUS)
521
	$(COMPILE_STATUS)
522
	if $(CXX) $(OURCXXFLAGS) $(OURCFLAGS) -c $< -o $@; then $(COMPILE_OK); else $(COMPILE_FAILED); fi
522
	if $(CXX) $(OURCXXFLAGS) $(OURCFLAGS) -c $< -o $@; then $(COMPILE_OK); else $(COMPILE_FAILED); fi
523
523
524
$(OBJ)/%.$o: $(SRC)/jmact/%.c
524
$(OBJ)/%.$o: $(SRC)/jmact/%.c
525
	$(COMPILE_STATUS)
525
	$(COMPILE_STATUS)
526
	if $(COMPILER) $(OURCFLAGS) -c $< -o $@; then $(COMPILE_OK); else $(COMPILE_FAILED); fi
526
	if $(COMPILER) $(OURCFLAGS) -c $< -o $@; then $(COMPILE_OK); else $(COMPILE_FAILED); fi
527
527
528
$(OBJ)/%.$o: $(SRC)/misc/%.rc
528
$(OBJ)/%.$o: $(SRC)/misc/%.rc
529
	$(COMPILE_STATUS)
529
	$(COMPILE_STATUS)
530
	if $(RC) -i $< -o $@ --include-dir=$(EINC) --include-dir=$(SRC) -DPOLYMER=$(POLYMER); then $(COMPILE_OK); else $(COMPILE_FAILED); fi
530
	if $(RC) -i $< -o $@ --include-dir=$(EINC) --include-dir=$(SRC) -DPOLYMER=$(POLYMER); then $(COMPILE_OK); else $(COMPILE_FAILED); fi
531
531
532
$(OBJ)/%.$o: $(RSRC)/%.c
532
$(OBJ)/%.$o: $(RSRC)/%.c
533
	$(COMPILE_STATUS)
533
	$(COMPILE_STATUS)
534
	if $(COMPILER) $(OURCFLAGS) -c $< -o $@; then $(COMPILE_OK); else $(COMPILE_FAILED); fi
534
	if $(COMPILER) $(OURCFLAGS) -c $< -o $@; then $(COMPILE_OK); else $(COMPILE_FAILED); fi
535
535
536
$(OBJ)/game_banner.$o: $(RSRC)/game_banner.c
536
$(OBJ)/game_banner.$o: $(RSRC)/game_banner.c
537
	$(COMPILE_STATUS)
537
	$(COMPILE_STATUS)
538
	if $(COMPILER) $(OURCFLAGS) -Wno-pointer-sign -c $< -o $@; then $(COMPILE_OK); else $(COMPILE_FAILED); fi
538
	if $(COMPILER) $(OURCFLAGS) -Wno-pointer-sign -c $< -o $@; then $(COMPILE_OK); else $(COMPILE_FAILED); fi
539
539
540
$(OBJ)/editor_banner.$o: $(RSRC)/editor_banner.c
540
$(OBJ)/editor_banner.$o: $(RSRC)/editor_banner.c
541
	$(COMPILE_STATUS)
541
	$(COMPILE_STATUS)
542
	if $(COMPILER) $(OURCFLAGS) -Wno-pointer-sign -c $< -o $@; then $(COMPILE_OK); else $(COMPILE_FAILED); fi
542
	if $(COMPILER) $(OURCFLAGS) -Wno-pointer-sign -c $< -o $@; then $(COMPILE_OK); else $(COMPILE_FAILED); fi
543
543
544
$(RSRC)/game_banner.c: $(RSRC)/game.bmp
544
$(RSRC)/game_banner.c: $(RSRC)/game.bmp
545
	echo "#include <gdk-pixbuf/gdk-pixdata.h>" > $@
545
	echo "#include <gdk-pixbuf/gdk-pixdata.h>" > $@
546
	echo "extern const GdkPixdata startbanner_pixdata;" >> $@
546
	echo "extern const GdkPixdata startbanner_pixdata;" >> $@
547
	gdk-pixbuf-csource --extern --struct --raw --name=startbanner_pixdata $^ | sed 's/load_inc//' >> $@
547
	gdk-pixbuf-csource --extern --struct --raw --name=startbanner_pixdata $^ | sed 's/load_inc//' >> $@
548
$(RSRC)/editor_banner.c: $(RSRC)/build.bmp
548
$(RSRC)/editor_banner.c: $(RSRC)/build.bmp
549
	echo "#include <gdk-pixbuf/gdk-pixdata.h>" > $@
549
	echo "#include <gdk-pixbuf/gdk-pixdata.h>" > $@
550
	echo "extern const GdkPixdata startbanner_pixdata;" >> $@
550
	echo "extern const GdkPixdata startbanner_pixdata;" >> $@
551
	gdk-pixbuf-csource --extern --struct --raw --name=startbanner_pixdata $^ | sed 's/load_inc//' >> $@
551
	gdk-pixbuf-csource --extern --struct --raw --name=startbanner_pixdata $^ | sed 's/load_inc//' >> $@
552
552
553
# PHONIES
553
# PHONIES
554
554
555
clean:
555
clean: $(UNDO_REV)
556
	-rm -f $(OBJ)/* $(EDUKE32) $(EDUKE32).memmap $(MAPSTER32) $(MAPSTER32).memmap core* && $(MAKE) -C $(JAUDIOLIBDIR) clean && $(MAKE) -C $(ENETDIR) clean
556
	-rm -f $(OBJ)/* $(EDUKE32) $(EDUKE32).memmap $(MAPSTER32) $(MAPSTER32).memmap core* && $(MAKE) -C $(JAUDIOLIBDIR) clean && $(MAKE) -C $(ENETDIR) clean
557
ifeq ($(PLATFORM),DARWIN)
557
ifeq ($(PLATFORM),DARWIN)
558
	-rm -rf EDuke32.app Mapster32.app
558
	-rm -rf EDuke32.app Mapster32.app
559
endif
559
endif
560
	echo -n "" > $(OBJ)/keep.me
560
	echo -n "" > $(OBJ)/keep.me
561
561
562
cleanutils:
562
cleanutils:
563
	-rm -f $(UTILS) $(UTILOBJS) $(addsuffix .memmap, $(UTILS))
563
	-rm -f $(UTILS) $(UTILOBJS) $(addsuffix .memmap, $(UTILS))
564
564
565
veryclean: clean cleanutils
565
veryclean: clean cleanutils
566
	-rm -f $(EOBJ)/* $(RSRC)/*banner* $(EBACKTRACEDLL)
566
	-rm -f $(EOBJ)/* $(RSRC)/*banner* $(EBACKTRACEDLL)
567
	echo -n "" > $(EOBJ)/keep.me
567
	echo -n "" > $(EOBJ)/keep.me
568
568
569
printutils:
569
printutils:
570
	echo "$(UTILS)"
570
	echo "$(UTILS)"
-
 
571
-
 
572
rev:
-
 
573
	@echo "s_buildRev = \"r$(VC_REV)$(VC_REV_CUSTOM)\";">source/rev.h
-
 
574
-
 
575
rev_clean:
-
 
576
	@$(VC_CLEAN) source/rev.h