forked from Meridian59/Meridian59
-
Notifications
You must be signed in to change notification settings - Fork 0
/
common.mak
142 lines (115 loc) · 3.27 KB
/
common.mak
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
# stuff included in blakston makefiles
# defining DYNAMIC uses multi-threaded C runtime DLL;
# otherwise link statically with single-threaded lib
# defining RELEASE compiles optimized
# defining NODEBUG omits debugging information
# defining FINAL implies release, and also removes debugging strings from client executable
!ifdef FINAL
RELEASE = 1
NODPRINTFS = 1
!endif
!ifdef RELEASE
!undef DEBUG
OUTDIR=release
!else
DEBUG = 1
OUTDIR=debug
!endif
# set to get debugging info in executable
!ifdef NODEBUG
!undef DEBUGINFO
!else
DEBUGINFO = 1
!endif
# Set source directories
# Subdirectories of components
BBGUNDIR = $(TOPDIR)\bbgun
CLIENTDIR = $(TOPDIR)\clientd3d
BLAKSERVDIR = $(TOPDIR)\blakserv
BLAKCOMPDIR = $(TOPDIR)\blakcomp
ROOMEDITDIR = $(TOPDIR)\roomedit
DOCDIR = $(TOPDIR)\doc
DECODIR = $(TOPDIR)\blakdeco
MAKEBGFDIR = $(TOPDIR)\makebgf
RESOURCEDIR = $(TOPDIR)\resource
DIFFDIR = $(TOPDIR)\blakdiff
MODULEDIR = $(TOPDIR)\module
CRUSHERDIR = $(TOPDIR)\crusher
UTILDIR = $(TOPDIR)\util
SPROCKETDIR = $(TOPDIR)\sprocket
CLUBDIR = $(TOPDIR)\club
KEYBINDDIR = $(TOPDIR)\keybind
WAVEMIXDIR = $(TOPDIR)\wavemix
LIBARCHIVEDIR = $(TOPDIR)\libarchive
LIBPNGDIR = $(TOPDIR)\libpng
ZLIBDIR = $(TOPDIR)\zlib
BLAKBINDIR = $(TOPDIR)\bin
BLAKLIBDIR = $(TOPDIR)\lib
BLAKINCLUDEDIR = $(TOPDIR)\include
BLAKSERVRUNDIR = $(TOPDIR)\run\server
CLIENTRUNDIR = $(TOPDIR)\run\localclient
KODDIR = $(TOPDIR)\kod
KODINCLUDEDIR = $(KODDIR)\include
PALETTEFILE = $(TOPDIR)\blakston.pal
# compiler specs -- uses multi-threaded DLL C runtime library
# /TP builds C files in C++ mode
# /WX treats warnings as errors
# /GR- turns off RTTI
# /EHsc- turns off exceptions
# /wd4996 disables warning (GetVersionExA has been deprecated)
# /wd4312 disables warning (cast 32-bit value to 64-bit pointer)
# /MP enables parallel compiling
CCOMMONFLAGS = -nologo -DBLAK_PLATFORM_WINDOWS -DWIN32 \
-D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_DEPRECATE \
-D_WINSOCK_DEPRECATED_NO_WARNINGS /wd4996 /wd4312 \
-TP -WX -GR- -EHsc- -MP
CNORMALFLAGS = $(CCOMMONFLAGS) -W2 /Ox
CDEBUGFLAGS = $(CCOMMONFLAGS) -Zi -W3 -DBLAKDEBUG
CNODEBUGFLAGS = $(CCOMMONFLAGS) -W2 -DBLAKDEBUG
LINKNORMALFLAGS =/release
LINKDEBUGFLAGS = /debug
LINKNODEBUGFLAGS =
LINKCONSOLEFLAGS = -subsystem:console
LINKWINDOWSFLAGS = -subsystem:windows
!ifdef DEBUG
!ifdef DEBUGINFO
CFLAGS = $(CDEBUGFLAGS)
LINKFLAGS = $(LINKDEBUGFLAGS)
!else
CFLAGS = $(CNODEBUGFLAGS)
LINKFLAGS = $(LINKNODEBUGFLAGS)
!endif DEBUGINFO
!else
CFLAGS = $(CNORMALFLAGS)
LINKFLAGS = $(LINKNORMALFLAGS)
!endif DEBUG
!ifdef DLL
LINKFLAGS = $(LINKFLAGS) /DLL
!endif
!ifdef DYNAMIC
CFLAGS = $(CFLAGS) /MD
!else
CFLAGS = $(CFLAGS) /MT
!endif DYNAMIC
!ifdef NODPRINTFS
CFLAGS = $(CFLAGS) -DNODPRINTFS
!endif NODPRINTFS
# programs
CC = cl
MAKE = nmake -nologo
LIBPRG = lib -nologo
LINK = link -nologo
RC = rc -nologo
LEX = $(TOPDIR)\bin\flex -I -i
YACC = $(TOPDIR)\bin\bison -d -t
CP = copy /Y
RM = -del /Q
RMDIR = -rmdir
MV = move
LATEX = latex
MAKENSIS = "c:\program files (x86)\nsis\makensis.exe"
BC = $(BLAKBINDIR)\bc
MAKEBGF = $(BLAKBINDIR)\makebgf
# environment variables for compiler
LIB = $(LIB);$(BLAKLIBDIR);$(TOPDIR)\miles\lib
INCLUDE = $(INCLUDE);$(BLAKINCLUDEDIR);$(LIBARCHIVEDIR);$(LIBPNGDIR);$(ZLIBDIR);$(TOPDIR)\miles\include