-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
120 lines (98 loc) · 3.05 KB
/
Makefile
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
# Command macros
LINK = link
# Command configuration
CPPFLAGS = -nologo -W3 -O2x -GF -EHsc -D_CRT_SECURE_NO_WARNINGS -DNOMINMAX
LFLAGS = -nologo -release user32.lib gdi32.lib comctl32.lib
RFLAGS = -nologo
# Dynamic configuration
!IF [$(CC) -nologo -c 2> NUL > NUL] == 0
NOOUTPUT = > NUL
!ELSE
NOOUTPUT = 2> NUL > NUL
!ENDIF
!IF [$(CC) -nologo -EP -P msvc\msvc_detect_version.cpp $(NOOUTPUT)] == 0
!INCLUDE msvc_detect_version.i
!IF [DEL msvc_detect_version.i]
!ENDIF
!MESSAGE Detected $(CC) version: $(CCVERSION)
!ELSE
!ERROR Failed to retrieve $(CC) version.
!ENDIF
!IF $(CCVERSION) <= 1400
CPPFLAGS = $(CPPFLAGS) -Dnullptr=NULL
!ENDIF
!IFDEF DXSDK
!IFNDEF DX7SDK
DX7SDK = $(DXSDK)
!ENDIF
!IFNDEF DX8SDK
DX8SDK = $(DXSDK)
!ENDIF
!IFNDEF DX9SDK
DX9SDK = $(DXSDK)
!ENDIF
!ENDIF
!IFDEF DX7SDK
CPPFLAGS = $(CPPFLAGS) -I$(DX7SDK)\Include
!ENDIF
!IFDEF DX8SDK
CPPFLAGS = $(CPPFLAGS) -I$(DX8SDK)\Include
!ENDIF
!IFDEF DX9SDK
CPPFLAGS = $(CPPFLAGS) -I$(DX9SDK)\Include
!ENDIF
# Per-target configuration
LDX7FLAGS = -libpath:$(DX7SDK)\Lib advapi32.lib ole32.lib ddraw.lib d3dx.lib dxguid.lib
LDX8FLAGS = -libpath:$(DX8SDK)\Lib advapi32.lib ole32.lib d3d8.lib d3dx8.lib -nodefaultlib:libci.lib
LDX9FLAGS = -libpath:$(DX9SDK)\Lib advapi32.lib ole32.lib d3d9.lib d3dx9.lib
!IF $(CCVERSION) >= 1900
LDX7FLAGS = $(LDX7FLAGS) legacy_stdio_definitions.lib
LDX8FLAGS = $(LDX8FLAGS) legacy_stdio_definitions.lib
LDX9FLAGS = $(LDX9FLAGS) legacy_stdio_definitions.lib
!ENDIF
LGLFLAGS = opengl32.lib glu32.lib
# Targets
all : \
testcase1.exe \
testcase2.exe \
!IF "$(DX7SDK)" != ""
testcase2dx7.exe \
testcase2dx7x.exe \
!ENDIF
!IF "$(DX8SDK)" != ""
testcase2dx8.exe \
!ENDIF
!IF "$(DX9SDK)" != ""
testcase2dx9.exe \
!ENDIF
testcase2gl.exe \
testcase2w.exe \
testcase3.exe
testcase1.exe : testcase1.obj
$(LINK) $(LFLAGS) -out:$@ $**
testcase2.exe : testcase2.obj
$(LINK) $(LFLAGS) -out:$@ $**
testcase2dx7.exe : testcase2dx7.obj
$(LINK) $(LFLAGS) $(LDX7FLAGS) -out:$@ $**
testcase2dx7x.exe : testcase2dx7x.obj
$(LINK) $(LFLAGS) $(LDX7FLAGS) -out:$@ $**
testcase2dx8.exe : testcase2dx8.obj
$(LINK) $(LFLAGS) $(LDX8FLAGS) -out:$@ $**
testcase2dx9.exe : testcase2dx9.obj
$(LINK) $(LFLAGS) $(LDX9FLAGS) -out:$@ $**
testcase2gl.exe : testcase2gl.obj
$(LINK) $(LFLAGS) $(LGLFLAGS) -out:$@ $**
testcase2w.exe : testcase2w.obj
$(LINK) $(LFLAGS) -out:$@ $**
testcase3.exe : testcase3.obj testcase3.res
$(LINK) $(LFLAGS) -out:$@ $**
testcase1.cpp testcase2.cpp testcase2w.cpp testcase3.cpp : raytracr.hpp
testcase1.cpp testcase2dx7.cpp testcase2dx7x.cpp testcase2dx8.cpp testcase2dx9.cpp testcase2gl.cpp testcase2w.cpp testcase3.cpp : simplewnd.hpp utility.hpp
testcase3.cpp : testcase3.h
raytracr.hpp : _raytracr\*.hpp
clean :
if exist testcase*.exe del testcase*.exe
if exist testcase*.obj del testcase*.obj
if exist testcase*.res del testcase*.res
if exist testcase*.pdb del testcase*.pdb
if exist vc*.pdb del vc*.pdb