forked from jonof/jfduke3d
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile.msvc
153 lines (123 loc) · 3.31 KB
/
Makefile.msvc
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
# Duke3D Makefile for Watcom Make
SRC=source
OBJ=obj
EROOT=engine
EINC=$(EROOT)\include
ELIB=$(EROOT)\obj.msc
INC=$(SRC)
o=obj
ENGINELIB=engine.lib
EDITORLIB=build.lib
!ifdef DEBUG
# debugging options
flags_cl=/G6 /Ot /Z7
flags_link=/DEBUG
!else
# release options
flags_cl=/G6Fy /Ox #/Ob1gity
flags_link=/RELEASE
!endif
DXROOT=c:\sdks\directx\dx7
ENGINEOPTS=/DSUPERBUILD /DPOLYMOST /DUSE_OPENGL /DDYNAMIC_OPENGL
CC=cl
AS=ml
LINK=link /opt:nowin98 /nologo /opt:ref
CFLAGS= /MD /J /nologo $(flags_cl) \
/I$(INC) /I$(EINC) /I$(SRC)\jmact /I$(SRC)\jaudiolib /I..\jfaud\inc \
/DNOCOPYPROTECT $(ENGINEOPTS) \
/I$(DXROOT)\include /DRENDERTYPEWIN=1
LIBS=user32.lib gdi32.lib shell32.lib dxguid.lib winmm.lib wsock32.lib comctl32.lib \
..\jfaud\jfaud.lib /NODEFAULTLIB:libFLAC.lib \
#opengl32.lib
ASFLAGS=/nologo /coff
EXESUFFIX=.exe
JMACTOBJ=$(OBJ)\util_lib.$o \
$(OBJ)\file_lib.$o \
$(OBJ)\control.$o \
$(OBJ)\keyboard.$o \
$(OBJ)\mouse.$o \
$(OBJ)\mathutil.$o \
$(OBJ)\scriplib.$o
#AUDIOLIB_FX=$(OBJ)\jaudiolib_fxstub.$o
#AUDIOLIB_MUSIC=$(OBJ)\jaudiolib_musicstub.$o
#AUDIOLIB_FX=$(OBJ)\jaudiolib_fx_fmod.$o
AUDIOLIB_JFAUD=$(OBJ)\jfaud_sounds.$o
AUDIOLIB_FX=$(OBJ)\mv_mix.$o \
$(OBJ)\mv_mix16.$o \
$(OBJ)\mvreverb.$o \
$(OBJ)\pitch.$o \
$(OBJ)\multivoc.$o \
$(OBJ)\ll_man.$o \
$(OBJ)\fx_man.$o \
$(OBJ)\dsoundout.$o
AUDIOLIB_MUSIC=$(OBJ)\midi.$o \
$(OBJ)\mpu401.$o \
$(OBJ)\music.$o
#AUDIOLIBOBJ=$(AUDIOLIB_MUSIC) $(AUDIOLIB_FX) $(OBJ)\sounds.$o
AUDIOLIBOBJ=$(AUDIOLIB_JFAUD)
GAMEOBJS=$(OBJ)\game.$o \
$(OBJ)\actors.$o \
$(OBJ)\gamedef.$o \
$(OBJ)\global.$o \
$(OBJ)\menues.$o \
$(OBJ)\player.$o \
$(OBJ)\premap.$o \
$(OBJ)\sector.$o \
$(OBJ)\rts.$o \
$(OBJ)\config.$o \
$(OBJ)\animlib.$o\
$(OBJ)\testcd.$o \
$(OBJ)\osdfuncs.$o \
$(OBJ)\osdcmds.$o \
$(OBJ)\grpscan.$o \
$(OBJ)\winbits.$o \
$(OBJ)\gameres.res \
$(OBJ)\startwin.game.$o \
$(JMACTOBJ) \
$(AUDIOLIBOBJ)
EDITOROBJS=$(OBJ)\astub.$o \
$(OBJ)\buildres.res
# RULES
.SUFFIXES: .masm
{$(SRC)}.masm{$(OBJ)}.$o:
$(AS) /c $(ASFLAGS) /Fo$@ $<
{$(SRC)\jaudiolib}.masm{$(OBJ)}.$o:
$(AS) /c $(ASFLAGS) /Fo$@ $<
{$(SRC)\jmact}.c{$(OBJ)}.$o:
$(CC) /c $(CFLAGS) /Fo$@ $<
{$(SRC)\jaudiolib}.c{$(OBJ)}.$o:
$(CC) /c $(CFLAGS) /Fo$@ $<
{$(SRC)\util}.c{$(OBJ)}.$o:
$(CC) /c $(CFLAGS) /Fo$@ $<
{$(SRC)}.c{$(OBJ)}.$o:
$(CC) /c $(CFLAGS) /Fo$@ $<
{$(SRC)}.cpp{$(OBJ)}.$o:
$(CC) /c $(CFLAGS) /Fo$@ $<
{$(SRC)\misc}.rc{$(OBJ)}.res:
$(RC) /i$(EINC) /i$(SRC) /fo$@ /r $<
# TARGETS
all: duke3d$(EXESUFFIX) build$(EXESUFFIX) ;
duke3d$(EXESUFFIX): $(GAMEOBJS) $(ELIB)\$(ENGINELIB)
$(LINK) /OUT:$@ /SUBSYSTEM:WINDOWS /LIBPATH:$(DXROOT)\lib $(flags_link) /MAP $** $(LIBS) msvcrt.lib
build$(EXESUFFIX): $(EDITOROBJS) $(ELIB)\$(ENGINELIB) $(ELIB)\$(EDITORLIB)
$(LINK) /OUT:$@ /SUBSYSTEM:WINDOWS /LIBPATH:$(DXROOT)\lib $(flags_link) /MAP $** $(LIBS) msvcrt.lib
!include Makefile.deps
enginelib editorlib: AlwaysBuild
echo CFLAGS=$(ENGINEOPTS) > engineoverrides.mak
cd $(EROOT)
nmake /f Makefile.msvc "OVERRIDES=$(MAKEDIR)\engineoverrides.mak" $@
cd $(MAKEDIR)
AlwaysBuild: ;
$(ELIB)\$(EDITORLIB): editorlib ;
$(ELIB)\$(ENGINELIB): enginelib ;
# PHONIES
clean:
-del /q $(OBJ)\*
cd $(EROOT)
nmake /f Makefile.msvc $@
cd $(MAKEDIR)
veryclean: clean
-del /q duke3d$(EXESUFFIX) build$(EXESUFFIX)
cd $(EROOT)
nmake /f Makefile.msvc $@
cd $(MAKEDIR)