forked from fuzzball-muck/fuzzball
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmakefile.win
188 lines (162 loc) · 6.66 KB
/
makefile.win
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
!IF "$(OS)" == "Windows_NT"
NULL=
!ELSE
NULL=nul
!ENDIF
WINDIR=.\win32
SRCDIR=.\src
INCDIR=.\include
# Compile output directory
!IF "$(OUTDIR)" == ""
OUTDIR=.\game
!MESSAGE [makefile.win] Compile output directory OUTDIR not specified, assuming default: $(OUTDIR)
!ENDIF
INTDIR=.\compile
# Package includes (e.g. from conan.io)
!IF "$(PACKAGE_DIR)" == ""
PACKAGE_DIR=.\win32
!MESSAGE [makefile.win] Package directory PACKAGE_DIR not specified, assuming default: $(PACKAGE_DIR)
!ENDIF
# OpenSSL include directory
!IF "$(OPENSSLDIR)" == ""
OPENSSLDIR=e:\sandbox\openssl
!MESSAGE [makefile.win] OpenSSL directory OPENSSLDIR not specified, assuming default: $(OPENSSLDIR)
!ENDIF
# First, check if the expected directory exists in OPENSSLDIR
!IF EXIST("$(OPENSSLDIR)\lib\vc")
LIB_OPENSSL_PATH=$(OPENSSLDIR)\lib\vc
!ELSEIF EXIST("$(PACKAGE_DIR)\lib\vc")
LIB_OPENSSL_PATH=$(PACKAGE_DIR)\lib\vc
!ELSE
!ERROR [makefile.win] Could not find OpenSSL library directory in OPENSSLDIR or PACKAGE_DIR
!ENDIF
!MESSAGE [makefile.win] Selected OpenSSL path: $(LIB_OPENSSL_PATH)
# We've found where OpenSSL is supposed to be stored. Now determine the filenames.
# (OpenSSL 1.1.x changed the library names)
!IF EXIST("$(LIB_OPENSSL_PATH)\libssl.lib") && EXIST("$(LIB_OPENSSL_PATH)\libcrypto.lib")
# > OpenSSL 1.1.x via Conan
!MESSAGE [makefile.win] Using OpenSSL library names libssl.lib and libcrypto.lib
LIB_NAME_SSL_MAIN=libssl.lib
LIB_NAME_SSL_CRYPTO=libcrypto.lib
!ELSEIF EXIST("$(LIB_OPENSSL_PATH)\ssleay32.lib") && EXIST("$(LIB_OPENSSL_PATH)\libeay32.lib")
# > OpenSSL 1.0.x via Conan
!MESSAGE [makefile.win] Using OpenSSL library names ssleay32.lib and libeay32.lib
LIB_NAME_SSL_MAIN=ssleay32.lib
LIB_NAME_SSL_CRYPTO=libeay32.lib
!ELSEIF EXIST("$(LIB_OPENSSL_PATH)\ssleay32MD.lib") && EXIST("$(LIB_OPENSSL_PATH)\libeay32MD.lib")
# > Alternative local OpenSSL sources
!MESSAGE [makefile.win] Using OpenSSL library names ssleay32MD.lib and libeay32MD.lib
LIB_NAME_SSL_MAIN=ssleay32MD.lib
LIB_NAME_SSL_CRYPTO=libeay32MD.lib
!ELSE
!ERROR [makefile.win] Could not find OpenSSL .lib files inside $(LIB_OPENSSL_PATH) - is OpenSSL present?
!ENDIF
# Specify PACKAGE_DIR first so it takes priority, allowing easier overriding of any built-in binaries/libs
CPP=cl.exe
CPP_OPS=/nologo /EHsc /MT /W3 /O2 /c /D "WIN32" /D "FD_SETSIZE=4096" /D "_WINSOCK_DEPRECATED_NO_WARNINGS" /D "_CRT_SECURE_NO_DEPRECATE" /I"$(PACKAGE_DIR)\include" /I"$(WINDIR)" /I"$(INCDIR)" /I"$(OPENSSLDIR)\include" /Fd"$(INTDIR)\\"
LINK32=link.exe
LINK32_OPS=/NODEFAULTLIB:libc /LIBPATH:"$(PACKAGE_DIR)\lib\vc" /LIBPATH:".\win32" /LIBPATH:"$(OPENSSLDIR)\lib\vc" pcre.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ws2_32.lib $(LIB_NAME_SSL_CRYPTO) $(LIB_NAME_SSL_MAIN) winmm.lib /nologo /subsystem:console /incremental:no /machine:I386
# Enable These for debugging
#CPP_OPS=/c /Od /D "_DEBUG" /Zi /EHsc /nologo /MTd /W3 /D "WIN32" /D "FD_SETSIZE=4096" /D "_WINSOCK_DEPRECATED_NO_WARNINGS" /D "_CRT_SECURE_NO_DEPRECATE" /I"$(PACKAGE_DIR)\include" /I"$(WINDIR)" /I"$(INCDIR)" /I"$(OPENSSLDIR)\include" /Fd"$(INTDIR)\\"
#LINK32_OPS=/DEBUG /NODEFAULTLIB:libc /LIBPATH:"$(PACKAGE_DIR)\lib\vc" /LIBPATH:".\win32" /LIBPATH:"$(OPENSSLDIR)\lib\vc" pcre.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ws2_32.lib libeay32$(LIB_SUFFIX).lib ssleay32$(LIB_SUFFIX).lib winmm.lib /nologo /subsystem:console /incremental:no /machine:I386
ALL : "$(OUTDIR)\fbmuck.exe" "$(OUTDIR)\restart.exe"
CLEAN :
-@erase "$(INTDIR)\*.obj"
-@erase "$(INTDIR)\*.idb"
-@erase "$(INTDIR)\*.exe"
-@erase "$(OUTDIR)\restart.exe"
-@erase "$(OUTDIR)\fbmuck.exe"
# Object files
RESTART_OBJ="$(INTDIR)\restart.obj"
MALLOC_OBJ="$(INTDIR)\crt_malloc.obj"
BASE_OBJ="$(INTDIR)\array.obj" \
"$(INTDIR)\boolexp.obj" \
"$(INTDIR)\compile.obj" \
"$(INTDIR)\create.obj" \
"$(INTDIR)\db.obj" \
"$(INTDIR)\debugger.obj" \
"$(INTDIR)\diskprop.obj" \
"$(INTDIR)\edit.obj" \
"$(INTDIR)\events.obj" \
"$(INTDIR)\fbmath.obj" \
"$(INTDIR)\fbsignal.obj" \
"$(INTDIR)\fbstrings.obj" \
"$(INTDIR)\fbtime.obj" \
"$(INTDIR)\game.obj" \
"$(INTDIR)\hashtab.obj" \
"$(INTDIR)\help.obj" \
"$(INTDIR)\interp.obj" \
"$(INTDIR)\log.obj" \
"$(INTDIR)\look.obj" \
"$(INTDIR)\match.obj" \
"$(INTDIR)\mcp.obj" \
"$(INTDIR)\mcpgui.obj" \
"$(INTDIR)\mcppkgs.obj" \
"$(INTDIR)\mfuns.obj" \
"$(INTDIR)\mfuns2.obj" \
"$(INTDIR)\move.obj" \
"$(INTDIR)\msgparse.obj" \
"$(INTDIR)\mufevent.obj" \
"$(INTDIR)\p_array.obj" \
"$(INTDIR)\p_connects.obj" \
"$(INTDIR)\p_db.obj" \
"$(INTDIR)\p_error.obj" \
"$(INTDIR)\p_float.obj" \
"$(INTDIR)\p_math.obj" \
"$(INTDIR)\p_mcp.obj" \
"$(INTDIR)\p_misc.obj" \
"$(INTDIR)\p_props.obj" \
"$(INTDIR)\p_regex.obj" \
"$(INTDIR)\p_stack.obj" \
"$(INTDIR)\p_strings.obj" \
"$(INTDIR)\pennies.obj" \
"$(INTDIR)\player.obj" \
"$(INTDIR)\predicates.obj" \
"$(INTDIR)\propdirs.obj" \
"$(INTDIR)\property.obj" \
"$(INTDIR)\props.obj" \
"$(INTDIR)\sanity.obj" \
"$(INTDIR)\set.obj" \
"$(INTDIR)\speech.obj" \
"$(INTDIR)\timequeue.obj" \
"$(INTDIR)\tune.obj" \
"$(INTDIR)\wiz.obj" \
"$(INTDIR)\win32.obj" \
"$(INTDIR)\smtp.obj"
INTERFACE_OBJ="$(INTDIR)\interface.obj" "$(INTDIR)\interface_ssl.obj"
RESOLVER_OBJ="$(INTDIR)\resolver.obj"
# Directories
"$(OUTDIR)" :
if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
"$(INTDIR)" :
if not exist "$(INTDIR)/$(NULL)" mkdir "$(INTDIR)"
# Generic src/.c to compile/.obj
{$(SRCDIR)}.c{$(INTDIR)}.obj::
$(CPP) @<<
$(CPP_OPS) /Fo"$(INTDIR)\\" $<
<<
# Generic win32/.cpp to compile/.obj
{$(WINDIR)}.cpp{$(INTDIR)}.obj::
$(CPP) @<<
$(CPP_OPS) /Fo"$(INTDIR)\\" $<
<<
# Generic win32/.c to compile/.obj
{$(WINDIR)}.c{$(INTDIR)}.obj::
$(CPP) @<<
$(CPP_OPS) /Fo"$(INTDIR)\\" $<
<<
# fbmuck main executable
"$(OUTDIR)\fbmuck.exe" : "$(OUTDIR)" "$(INTDIR)" $(VERSION_OBJ) $(BASE_OBJ) $(MALLOC_OBJ) $(INTERFACE_OBJ)
$(LINK32) @<<
$(LINK32_OPS) /out:"$(OUTDIR)\fbmuck.exe" $(BASE_OBJ) $(MALLOC_OBJ) $(INTERFACE_OBJ) $(VERSION_OBJ)
<<
# resolver program
"$(OUTDIR)\fb-resolver.exe" : "$(OUTDIR)" "$(INTDIR)" $(RESOLVER_OBJ)
$(LINK32) @<<
$(LINK32_OPS) /out:"$(OUTDIR)\fb-resolver.exe" $(RESOLVER_OBJ) $(MALLOC_OBJ)
<<
# restart program
"$(OUTDIR)\restart.exe" : "$(OUTDIR)" "$(INTDIR)" $(RESTART_OBJ)
$(LINK32) @<<
$(LINK32_OPS) /out:"$(OUTDIR)\restart.exe" $(RESTART_OBJ)
<<