-
Notifications
You must be signed in to change notification settings - Fork 13
/
common.mak.linux
150 lines (122 loc) · 3.39 KB
/
common.mak.linux
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
# 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
endif
ifdef RELEASE
undef DEBUG
OUTDIR=release
NODPRINTFS = 1
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
LIBPNGDIR = $(TOPDIR)/libpng
BLAKBINDIR = $(TOPDIR)/bin
BLAKLIBDIR = $(TOPDIR)/lib
BLAKINCLUDEDIR = $(TOPDIR)/include
BLAKSERVRUNDIR = $(TOPDIR)/run/server
CLIENTRUNDIR = $(TOPDIR)/run/localclient
MYSQLINCLUDEDIR = $(TOPDIR)/include/mysql
DX9INCLUDEDIR = $(TOPDIR)/include/dx9
LIBPNGINCLUDEDIR = $(TOPDIR)/include/libpng
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
CCOMMONFLAGS = -nologo -DBLAK_PLATFORM_WINDOWS -DWIN32 \
-D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_DEPRECATE \
-D_WINSOCK_DEPRECATED_NO_WARNINGS /wd4996 /wd4390 \
-TP -WX -GR- -EHsc- /MP -W3 /fp:fast
CNORMALFLAGS = $(CCOMMONFLAGS) /Ox /GL /GF
CDEBUGFLAGS = $(CCOMMONFLAGS) -Zi -DBLAKDEBUG
CNODEBUGFLAGS = $(CCOMMONFLAGS) -DBLAKDEBUG
# For shared libs (dll)
LINKNORMALFLAGS = -nologo /release /machine:ix86 /LTCG /LARGEADDRESSAWARE /OPT:REF /OPT:ICF
LINKDEBUGFLAGS = -nologo /debug /machine:ix86 /LARGEADDRESSAWARE
LINKNODEBUGFLAGS = -nologo /machine:ix86 /LARGEADDRESSAWARE
# For static libs (lib)
LINKSTNORMALFLAGS = -nologo /machine:ix86 /LTCG
LINKSTDEBUGFLAGS = -nologo /machine:ix86
ifdef DEBUG
ifdef DEBUGINFO
CFLAGS = $(CDEBUGFLAGS)
LINKFLAGS = $(LINKDEBUGFLAGS)
LINKSTFLAGS = $(LINKSTDEBUGFLAGS)
else
CFLAGS = $(CNODEBUGFLAGS)
LINKFLAGS = $(LINKNODEBUGFLAGS)
LINKSTFLAGS = $(LINKSTDEBUGFLAGS)
endif
else
CFLAGS = $(CNORMALFLAGS)
LINKFLAGS = $(LINKNORMALFLAGS)
LINKSTFLAGS = $(LINKSTNORMALFLAGS)
endif
ifdef DLL
LINKFLAGS = $(LINKFLAGS) /DLL
endif
ifdef DYNAMIC
CFLAGS = $(CFLAGS) /MD
else
CFLAGS = $(CFLAGS) /MT
endif
ifdef NODPRINTFS
CFLAGS = $(CFLAGS) -DNODPRINTFS
endif
# programs
CC = g++
MAKE = make
LIBPRG =
LINK = g++
LINKST =
RC =
RSCMERGE = $(TOPDIR)/bin/rscmerge -o
POSTBUILD = $(TOPDIR)/postbuild-linux
LEX = /usr/bin/flex -I -i
YACC = /usr/bin/bison -d -t
XCP =
CP = cp
RM = rm -f
RMDIR = rmdir
MV = mv
LATEX = latex
MAKENSIS =
BC = $(BLAKBINDIR)/bc
MAKEBGF = $(BLAKBINDIR)/makebgf
# environment variables for compiler
LIB = $(LIB);$(BLAKLIBDIR)
INCLUDE = $(INCLUDE);$(BLAKINCLUDEDIR);$(MYSQLINCLUDEDIR);$(DX9INCLUDEDIR);$(LIBPNGINCLUDEDIR)