summaryrefslogtreecommitdiff
path: root/Makefile
blob: 6fc9d14a959a6d139e4d4b99daabbb1d1e7f39e0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
# viDOOM - level editor for DOOM
# 
# Copyright (C) 2000  Ian Cowburn (ianc@noddybox.demon.co.uk)
# 
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
# 
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
# 
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
# 
# -------------------------------------------------------------------------
#

#
# START OF CONFIGURATION PART
#
# 1. The platform to compile for.  Currently supported ones are:
#	djgpp		(Currently unmaintained)
#	linux
#	cygwin-xfree	(Same as linux)
#
MAKEPLAT=linux


# 2. Set to the directory where you want to install viDOOM.  Note this is not
#    used in the default make - a 'make install' must be issued to activate
#    this.
#
INSTALLDIR=C:/viDOOM


# 3. The directory seperator for this machine.  This is unquoted (unlike the
#    seperator in the config file) as this is for the makefiles own use.
#
MKDS=/


#
# END OF CONFIGURATION PART
#



# Shouldn't be any need to edit past here
#
include make$(MKDS)$(MAKEPLAT).cfg


# Uncomment to build debug version
#
DEBUG=$(DEFINEFLAG)VIDOOM_DEBUG


CFLAGS=		$(INCFLAG). $(EXTRACF) $(DEFINEFLAG)TRACEFORM='$(TRACEFORM)' \
		$(DEBUG) $(DEFINEFLAG)PLATFORM=$(PLATFORM) \
		$(DEFINEFLAG)DIRSEP='$(DIRSEP)'

VIDOOM=		vidoom
WADDIR=		waddir
GFXTEST=	gfxtest
WADTEST=	wadtest

COMMON_OBJ=	$(PLATFORM)$(MKDS)main$(OBJ_EXT) \
		$(PLATFORM)$(MKDS)file$(OBJ_EXT) \
		$(PLATFORM)$(MKDS)gfx$(OBJ_EXT) \
		$(PLATFORM)$(MKDS)mem$(OBJ_EXT) \
		$(PLATFORM)$(MKDS)platgui$(OBJ_EXT) \
		$(PLATFORM)$(MKDS)runcmd$(OBJ_EXT) \
		$(PLATFORM)$(MKDS)vstring$(OBJ_EXT) \
		ini$(OBJ_EXT) wad$(OBJ_EXT) util$(OBJ_EXT) \
		list$(OBJ_EXT) map$(OBJ_EXT) gui$(OBJ_EXT) debug$(OBJ_EXT) \
		globals$(OBJ_EXT) texture$(OBJ_EXT) things$(OBJ_EXT) \
		linedefs$(OBJ_EXT) sectors$(OBJ_EXT) edit$(OBJ_EXT) \
		editcord$(OBJ_EXT) editdraw$(OBJ_EXT) editgui$(OBJ_EXT) \
		editevnt$(OBJ_EXT) editline$(OBJ_EXT) editmult$(OBJ_EXT) \
		editsect$(OBJ_EXT) editsel$(OBJ_EXT) editthng$(OBJ_EXT) \
		editvar$(OBJ_EXT) editvert$(OBJ_EXT) editsrot$(OBJ_EXT) \
		editcrse$(OBJ_EXT) editilst$(OBJ_EXT) editmrg$(OBJ_EXT) \
		edit3d$(OBJ_EXT) genlines$(OBJ_EXT) gensect$(OBJ_EXT) \
		names$(OBJ_EXT) editlump$(OBJ_EXT) specials$(OBJ_EXT) \
		flags$(OBJ_EXT)

ALL_HEADERS=	vidoom.h config.h file.h gfx.h mem.h map.h runcmd.h \
		ini.h wad.h list.h edit.h platgui.h gui.h debug.h globals.h \
		texture.h things.h linedefs.h editvar.h genlines.h gensect.h \
		names.h specials.h flags.h

VIDOOM_OBJ=	vidoom$(OBJ_EXT) $(COMMON_OBJ)
WADDIR_OBJ=	waddir$(OBJ_EXT) $(COMMON_OBJ)
GFXTEST_OBJ=	gfxtest$(OBJ_EXT) $(COMMON_OBJ)
WADTEST_OBJ=	$(WADTEST)$(OBJ_EXT) $(COMMON_OBJ)



$(VIDOOM)$(EXE_EXT):$(VIDOOM_OBJ)
	$(LD) $(EXTRALF) $(EXEFLAG) $(VIDOOM)$(EXE_EXT) \
		$(VIDOOM_OBJ) $(LIBS) $(MATHLIB)

$(WADDIR)$(EXE_EXT):$(WADDIR_OBJ)
	$(LD) $(EXTRALF) $(EXEFLAG) $(WADDIR)$(EXE_EXT) \
		$(WADDIR_OBJ) $(LIBS) $(MATHLIB)

$(GFXTEST)$(EXE_EXT):$(GFXTEST_OBJ)
	$(LD) $(EXTRALF) $(EXEFLAG) $(GFXTEST)$(EXE_EXT) $(GFXTEST_OBJ) \
		$(LIBS) $(MATHLIB)

$(WADTEST)$(EXE_EXT):$(WADTEST_OBJ)
	$(LD) $(EXTRALF) $(EXEFLAG) $(WADTEST)$(EXE_EXT) $(WADTEST_OBJ) \
		$(LIBS) $(MATHLIB)


all: $(VIDOOM)$(EXE_EXT) $(WADDIR)$(EXE_EXT) \
     $(GFXTEST)$(EXE_EXT) $(WADTEST)$(EXE_EXT)


$(PLATFORM)$(MKDS)main$(OBJ_EXT): $(PLATFORM)$(MKDS)main.c $(ALL_HEADERS)
	cd $(PLATFORM); $(CC) $(INCFLAG).. $(CFLAGS) $(OBJFLAG) main.c ; cd ..

$(PLATFORM)$(MKDS)file$(OBJ_EXT): $(PLATFORM)$(MKDS)file.c $(ALL_HEADERS)
	cd $(PLATFORM); $(CC) $(INCFLAG).. $(CFLAGS) $(OBJFLAG) file.c ; cd ..

$(PLATFORM)$(MKDS)gfx$(OBJ_EXT): $(PLATFORM)$(MKDS)gfx.c $(ALL_HEADERS)
	cd $(PLATFORM); $(CC) $(INCFLAG).. $(CFLAGS) $(OBJFLAG) gfx.c ; cd ..

$(PLATFORM)$(MKDS)mem$(OBJ_EXT): $(PLATFORM)$(MKDS)mem.c $(ALL_HEADERS)
	cd $(PLATFORM); $(CC) $(INCFLAG).. $(CFLAGS) $(OBJFLAG) mem.c ; cd ..

$(PLATFORM)$(MKDS)platgui$(OBJ_EXT): $(PLATFORM)$(MKDS)platgui.c $(ALL_HEADERS)
	cd $(PLATFORM); $(CC) $(INCFLAG).. $(CFLAGS) $(OBJFLAG) platgui.c ; cd ..

$(PLATFORM)$(MKDS)runcmd$(OBJ_EXT): $(PLATFORM)$(MKDS)runcmd.c $(ALL_HEADERS)
	cd $(PLATFORM); $(CC) $(INCFLAG).. $(CFLAGS) $(OBJFLAG) runcmd.c ; cd ..

$(PLATFORM)$(MKDS)vstring$(OBJ_EXT): $(PLATFORM)$(MKDS)vstring.c $(ALL_HEADERS)
	cd $(PLATFORM); $(CC) $(INCFLAG).. $(CFLAGS) $(OBJFLAG) vstring.c ; cd ..


debug$(OBJ_EXT): debug.c config.h debug.h vstring.h
	$(CC) $(CFLAGS) $(OBJFLAG) $<

edit$(OBJ_EXT): edit.c config.h debug.h vstring.h globals.h edit.h wad.h map.h \
		list.h editvar.h things.h gfx.h platgui.h linedefs.h gui.h mem.h
	$(CC) $(CFLAGS) $(OBJFLAG) $<

edit3d$(OBJ_EXT): edit3d.c config.h debug.h vstring.h globals.h editvar.h \
		  things.h gfx.h platgui.h linedefs.h wad.h map.h list.h gui.h \
		  mem.h
	$(CC) $(CFLAGS) $(OBJFLAG) $<

editcord$(OBJ_EXT): editcord.c config.h debug.h vstring.h globals.h texture.h \
		    gfx.h platgui.h editvar.h things.h linedefs.h wad.h map.h \
		    list.h gui.h mem.h
	$(CC) $(CFLAGS) $(OBJFLAG) $<

editcrse$(OBJ_EXT): editcrse.c config.h debug.h vstring.h globals.h editvar.h \
		    things.h gfx.h platgui.h linedefs.h wad.h map.h list.h \
		    gui.h mem.h sectors.h
	$(CC) $(CFLAGS) $(OBJFLAG) $<

editdraw$(OBJ_EXT): editdraw.c config.h debug.h vstring.h globals.h editvar.h \
		    things.h gfx.h platgui.h linedefs.h wad.h map.h list.h \
		    gui.h mem.h
	$(CC) $(CFLAGS) $(OBJFLAG) $<

editevnt$(OBJ_EXT): editevnt.c config.h debug.h vstring.h globals.h editvar.h \
		    things.h gfx.h platgui.h linedefs.h wad.h map.h list.h \
		    gui.h mem.h
	$(CC) $(CFLAGS) $(OBJFLAG) $<

editgui$(OBJ_EXT): editgui.c config.h debug.h vstring.h globals.h editvar.h \
		   things.h gfx.h platgui.h linedefs.h wad.h map.h list.h \
		   gui.h mem.h texture.h sectors.h specials.h
	$(CC) $(CFLAGS) $(OBJFLAG) $<

editilst$(OBJ_EXT): editilst.c config.h debug.h vstring.h globals.h editvar.h \
		    things.h gfx.h platgui.h linedefs.h wad.h map.h list.h \
		    gui.h mem.h
	$(CC) $(CFLAGS) $(OBJFLAG) $<

editline$(OBJ_EXT): editline.c config.h debug.h vstring.h globals.h editvar.h \
		    things.h gfx.h platgui.h linedefs.h wad.h map.h list.h \
		    gui.h mem.h sectors.h texture.h genlines.h specials.h \
		    flags.h util.h
	$(CC) $(CFLAGS) $(OBJFLAG) $<

editlump$(OBJ_EXT): editlump.c config.h debug.h vstring.h globals.h editvar.h \
		    things.h gfx.h platgui.h linedefs.h wad.h map.h list.h \
		    gui.h mem.h runcmd.h file.h util.h
	$(CC) $(CFLAGS) $(OBJFLAG) $<

editmrg$(OBJ_EXT): editmrg.c config.h debug.h vstring.h globals.h editvar.h \
		   things.h gfx.h platgui.h linedefs.h wad.h map.h list.h \
		   gui.h mem.h
	$(CC) $(CFLAGS) $(OBJFLAG) $<

editmult$(OBJ_EXT): editmult.c config.h debug.h vstring.h globals.h util.h \
		    editvar.h things.h gfx.h platgui.h linedefs.h wad.h map.h \
		    list.h gui.h mem.h
	$(CC) $(CFLAGS) $(OBJFLAG) $<

editsect$(OBJ_EXT): editsect.c config.h debug.h vstring.h globals.h sectors.h \
		    wad.h map.h list.h gfx.h platgui.h editvar.h things.h \
		    linedefs.h gui.h mem.h gensect.h util.h
	$(CC) $(CFLAGS) $(OBJFLAG) $<

editsel$(OBJ_EXT): editsel.c config.h debug.h vstring.h globals.h editvar.h \
		   things.h gfx.h platgui.h linedefs.h wad.h map.h list.h \
		   gui.h mem.h
	$(CC) $(CFLAGS) $(OBJFLAG) $<

editsrot$(OBJ_EXT): editsrot.c config.h debug.h vstring.h globals.h editvar.h \
		    things.h gfx.h platgui.h linedefs.h wad.h map.h list.h \
		    gui.h mem.h
	$(CC) $(CFLAGS) $(OBJFLAG) $<

editthng$(OBJ_EXT): editthng.c config.h debug.h vstring.h globals.h specials.h \
		    flags.h util.h editvar.h things.h gfx.h platgui.h \
		    linedefs.h wad.h map.h list.h gui.h mem.h
	$(CC) $(CFLAGS) $(OBJFLAG) $<

editvar$(OBJ_EXT): editvar.c config.h debug.h vstring.h globals.h editvar.h \
		   things.h gfx.h platgui.h linedefs.h wad.h map.h list.h \
		   gui.h mem.h
	$(CC) $(CFLAGS) $(OBJFLAG) $<

editvert$(OBJ_EXT): editvert.c config.h debug.h vstring.h globals.h editvar.h \
		    things.h gfx.h platgui.h linedefs.h wad.h map.h list.h \
		    gui.h mem.h
	$(CC) $(CFLAGS) $(OBJFLAG) $<

flags$(OBJ_EXT): flags.c config.h debug.h vstring.h globals.h platgui.h gfx.h \
		 flags.h mem.h list.h
	$(CC) $(CFLAGS) $(OBJFLAG) $<

genlines$(OBJ_EXT): genlines.c config.h debug.h vstring.h globals.h platgui.h \
		    gfx.h genlines.h mem.h map.h linedefs.h wad.h list.h
	$(CC) $(CFLAGS) $(OBJFLAG) $<

gensect$(OBJ_EXT): gensect.c config.h debug.h vstring.h globals.h platgui.h \
		   gfx.h gensect.h mem.h map.h
	$(CC) $(CFLAGS) $(OBJFLAG) $<

globals$(OBJ_EXT): globals.c config.h debug.h vstring.h globals.h ini.h gfx.h \
		   mem.h texture.h platgui.h things.h linedefs.h wad.h map.h \
		   list.h sectors.h genlines.h gensect.h specials.h flags.h
	$(CC) $(CFLAGS) $(OBJFLAG) $<

gui$(OBJ_EXT): gui.c config.h debug.h vstring.h globals.h gui.h gfx.h \
	       platgui.h mem.h ini.h names.h
	$(CC) $(CFLAGS) $(OBJFLAG) $<

ini$(OBJ_EXT): ini.c config.h debug.h vstring.h ini.h mem.h file.h gfx.h
	$(CC) $(CFLAGS) $(OBJFLAG) $<

linedefs$(OBJ_EXT): linedefs.c config.h debug.h vstring.h globals.h platgui.h \
		    gfx.h linedefs.h wad.h map.h list.h mem.h
	$(CC) $(CFLAGS) $(OBJFLAG) $<

list$(OBJ_EXT): list.c config.h debug.h vstring.h list.h mem.h
	$(CC) $(CFLAGS) $(OBJFLAG) $<

map$(OBJ_EXT): map.c config.h debug.h vstring.h map.h mem.h
	$(CC) $(CFLAGS) $(OBJFLAG) $<

names$(OBJ_EXT): names.c config.h debug.h vstring.h names.h globals.h file.h
	$(CC) $(CFLAGS) $(OBJFLAG) $<

sectors$(OBJ_EXT): sectors.c config.h debug.h vstring.h globals.h sectors.h \
		   wad.h map.h list.h gfx.h platgui.h mem.h
	$(CC) $(CFLAGS) $(OBJFLAG) $<

specials$(OBJ_EXT): specials.c config.h debug.h vstring.h globals.h platgui.h \
		    gfx.h gui.h specials.h mem.h list.h map.h
	$(CC) $(CFLAGS) $(OBJFLAG) $<

texture$(OBJ_EXT): texture.c config.h debug.h vstring.h globals.h texture.h \
		   gfx.h platgui.h wad.h map.h list.h mem.h gui.h
	$(CC) $(CFLAGS) $(OBJFLAG) $<

things$(OBJ_EXT): things.c config.h debug.h vstring.h globals.h platgui.h \
		  gfx.h things.h mem.h list.h map.h
	$(CC) $(CFLAGS) $(OBJFLAG) $<

util$(OBJ_EXT): util.c config.h debug.h vstring.h mem.h util.h
	$(CC) $(CFLAGS) $(OBJFLAG) $<

wad$(OBJ_EXT): wad.c config.h debug.h vstring.h globals.h wad.h map.h list.h \
	       gfx.h mem.h file.h util.h
	$(CC) $(CFLAGS) $(OBJFLAG) $<


$(VIDOOM)$(OBJ_EXT): $(VIDOOM).c $(ALL_HEADERS)
	$(CC) $(CFLAGS) $(OBJFLAG) $(VIDOOM).c

$(WADDIR)$(OBJ_EXT): $(WADDIR).c $(ALL_HEADERS)
	$(CC) $(CFLAGS) $(OBJFLAG) $(WADDIR).c

$(GFXTEST)(OBJ_EXT): $(GFXTEST).c $(ALL_HEADERS)
	$(CC) $(CFLAGS) $(OBJFLAG) $(GFXTEST).c

$(WADTEST)(OBJ_EXT): $(WADTEST).c $(ALL_HEADERS)
	$(CC) $(CFLAGS) $(OBJFLAG) $(WADTEST).c


# Rule for installation
#
install: $(VIDOOM)$(EXE_EXT) FORCE
	cd $(PLATFORM) ; $(MAKEINSTALL)

FORCE:

# Rule for cleaning up
#
clean:
	$(RMCMD) $(COMMON_OBJ)
	$(RMCMD) vidoom$(OBJ_EXT)
	$(RMCMD) waddir$(OBJ_EXT)
	$(RMCMD) gfxtest$(OBJ_EXT)
	$(RMCMD) vidoom$(EXE_EXT)
	$(RMCMD) waddir$(EXE_EXT)
	$(RMCMD) gfxtest$(EXE_EXT)

#
# $Id: Makefile,v 1.48 2002/09/05 20:00:47 ianc Exp ianc $
#
# END OF FILE