summaryrefslogtreecommitdiffstats
path: root/src/windows/identity/config/Makefile.w32
blob: 1b862a9ad487d7291417b3e36a7b7dad5f8910a1 (plain)
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
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
#
#  Khimaira : Win32 configuration makefile
#             This file will be included by all the makefiles
#             in the build tree.
#
# Copyright (c) 2004 Massachusetts Institute of Technology
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation files
# (the "Software"), to deal in the Software without restriction,
# including without limitation the rights to use, copy, modify, merge,
# publish, distribute, sublicense, and/or sell copies of the Software,
# and to permit persons to whom the Software is furnished to do so,
# subject to the following conditions:
#
# The above copyright notice and this permission notice shall be
# included in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
# BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
# ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.

!ifndef KHIMAIRA_WIN32_CONFIG
KHIMAIRA_WIN32_CONFIG=1

# Environment Variables
#  The following environment variables MUST be set:
#   KH_ROOT : Root of the source tree.
#   KH_BUILD: One of DEBUG or RETAIL
#
#  The following environment variables are optional:
#   KH_RUNTIME: One of STATIC or DLL, specifies whether the CRT libs
#               are linked statically or through MSVCRT.DLL.
#   KH_AUXCFLAGS: Optional flags for CL
#   KH_RELEASE: Release type.  One of OFFICIAL, PRERELEASE, PRIVATE or SPECIAL.
#      OFFICIAL   : An official release of Khimaira
#      PREPRELEASE: A beta/release candidate release
#      PRIVATE    : Private build
#      SPECIAL    : Special build.  Typically one with non-mainline patches.

# Version info
KHIMAIRA_VERSION_MAJOR=0
KHIMAIRA_VERSION_MINOR=1
KHIMAIRA_VERSION_PATCH=1
KHIMAIRA_VERSION_AUX=0
KHIMAIRA_VERSION=$(KHIMAIRA_VERSION_MAJOR).$(KHIMAIRA_VERSION_MINOR).$(KHIMAIRA_VERSION_PATCH).$(KHIMAIRA_VERSION_AUX)
KHIMAIRA_VERSIONC=$(KHIMAIRA_VERSION_MAJOR),$(KHIMAIRA_VERSION_MINOR),$(KHIMAIRA_VERSION_PATCH),$(KHIMAIRA_VERSION_AUX)

# Source information
KHIMAIRA_SRC_COMPANY_1033=Massachusetts Institute of Technology

KHIMAIRA_SRC_COPYRIGHT_1033=(C) 2005 Massachusetts Institute of Technology

# Choose the default build type if one is not set
!if ("$(KH_BUILD)" != "DEBUG") && ("$(KH_BUILD)" != "RETAIL")
!  if defined(NODEBUG) && "$(NODEBUG)"=="1"
KH_BUILD=RETAIL
!  else
KH_BUILD=DEBUG
!  endif
!endif

!if "$(KH_BUILD)"=="DEBUG" && defined(NODEBUG) && "$(NODEBUG)"=="1"
! error The Khimaira build configuration is set for DEBUG while the Platform SDK build environment is set to RETAIL.
!endif

# The default release type is PRIVATE is no other type is specified
!if ("$(KH_RELEASE)" != "OFFICIAL") && ("$(KH_RELEASE)" != "PRERELEASE") && ("$(KH_RELEASE)" != "PRIVATE") && ("$(KH_RELEASE)" != "SPECIAL")
KH_RELEASE=PRERELEASE
!endif

# Version and build strings

!if "$(KH_RELEASE)" == "OFFICIAL"
KHIMAIRA_VERSION_STR_1033=$(KHIMAIRA_VERSION)
KHIMAIRA_COMMENT_STR_1033=Official build.
!elseif "$(KH_RELEASE)" == "PRERELEASE"
KHIMAIRA_VERSION_STR_1033=$(KHIMAIRA_VERSION) Alpha
KHIMAIRA_COMMENT_STR_1033=Prerelease build.
!elseif "$(KH_RELEASE)" == "PRIVATE"
KHIMAIRA_VERSION_STR_1033=$(KHIMAIRA_VERSION).PRIVATE
KHIMAIRA_PRIVATE_STR_1033=Private build.
!elseif "$(KH_RELEASE)" == "SPECIAL"
KHIMAIRA_VERSION_STR_1033=$(KHIMAIRA_VERSION).SPECIAL
KHIMAIRA_SPECIAL_STR_1033=Special build.
!endif

!if "$(KH_BUILD)" == "DEBUG"
KHIMAIRA_VERSION_STR_1033=$(KHIMAIRA_VERSION_STR_1033).DEBUG
!else
!endif

KHIMAIRA_PRODUCT_1033=NetIDMgr $(KHIMAIRA_VERSION_STR_1033)

# See what compiler we are using
# TODO: Update this to support other compilers
!if defined(MSVCVer) && "$(MSVCVer)"=="8.0"
KH_CLVER=vc8
!else
KH_CLVER=vc7
!endif

# Check for required env vars
!ifndef MODULE
!	error MODULE must be specified
!endif
!ifndef KH_ROOT
KH_ROOT=$(PISMERE)\athena\auth\krb5\src\windows\identity
!endif

!ifdef NODEBUG
OUTPRE_DBG=rel
!else
OUTPRE_DBG=dbg
!endif
OUTPRE1=obj
OUTPRE2=$(OUTPRE1)\$(CPU)
OUTPRE3=$(OUTPRE2)\$(OUTPRE_DBG)
OUTPRE=$(OUTPRE3)^\



# Output directory structure
DESTROOT=$(KH_ROOT)\dest
OBJROOT=$(KH_ROOT)\obj
SRC=$(KH_ROOT)

DESTDIR=$(DESTROOT)\$(CPU)\$(OUTPRE_DBG)
OBJDIR=$(OBJROOT)\$(CPU)\$(OUTPRE_DBG)

OBJ=$(OBJDIR)\$(MODULE)
INCDIR=$(DESTDIR)\include
#BINDIR=$(DESTDIR)\bin
BINDIR=$(KH_ROOT)\$(OUTPRE)
#LIBDIR=$(DESTDIR)\lib
LIBDIR=$(KH_ROOT)\$(OUTPRE)
DOCDIR=$(DESTDIR)\doc

# Source directories
CONFDIR=$(SRC)\config

# Setup environment for win32.mak

!if "$(KH_BUILD)" == "RETAIL"
NODEBUG=1
!endif

# Win32.mak
!include <Win32.Mak>

# Program macros

CD=cd
RM=del /q
MKDIR=mkdir
RMDIR=rmdir
ECHO=echo
MAKECMD=nmake
CP=copy /y
LINK=link
CCSV=perl $(SRC)\config\ccsv.pl
MC=mc

!ifdef KH_DOXYFULLPATH
DOXYGEN=$(KH_DOXYFULLPATH)
!else
DOXYGEN=doxygen
!endif

!ifdef KH_HHCFULLPATH
HHC=$(KH_HHCFULLPATH)
!else
HHC=hhc
!endif

!ifdef KH_KFWPATH
KFWINCDIR=$(KH_KFWPATH)\inc
kfwincflags = -I$(KFWINCDIR)\krb5 -I$(KFWINCDIR)\krb5\KerberosIV -I$(KFWINCDIR)\loadfuncs -I$(KFWINCDIR)
KFWLIBDIR=$(KH_KFWPATH)\lib\$(CPU)
!else
KFWINCDIR=$(PISMERE)\athena\auth\krb5\src\include
kfwincflags = -I$(KFWINCDIR) -I$(PISMERE)\athena\util\loadfuncs -I$(PISMERE)\athena\auth\krb5\src\include\kerberosIV -I$(PISMERE)\athena\auth\krb4\include
KFWLIBDIR=$(PISMERE)\target\lib\$(CPU)\$(OUTPRE_DBG)
!endif

!ifdef KH_AFSPATH
AFSINCDIR=$(KH_AFSPATH)\include
AFSLIBDIR=$(KH_AFSPATH)\lib
afsincflags=-I$(AFSINCDIR)
!endif

#EXTLIBDIR=$(SRC)\ext-lib\$(CPU)
#EXTINCDIR=-I$(SRC)\ext-inc

incflags= -I$(INCDIR) -I$(SRC)\include -I. -I$(OBJ) $(kfwincflags) $(afsincflags)
rincflags= /i $(INCDIR) /i $(SRC)\include /i .
khdefines=-DUNICODE -D_UNICODE
khcwarn=/Wp64
!ifndef KH_NO_WX
khcwarn=$(khcwarn) /WX
!endif

khcflags=$(cdebug) $(cflags) $(incflags) $(khdefines) $(khcwarn)
khlguiflags=$(ldebug) $(guilflags)
khlconflags=$(ldebug) $(conlflags)
khldllguiflags=$(ldebug) $(dlllflags)
khldllconflags=$(ldebug) $(dlllflags)

!if "$(KH_RUNTIME)" == "STATIC"
khcflags=$(khcflags) $(cvarsmt)
khlguiflags=$(khlguiflags) $(guilibsmt)
khlconflags=$(khlconflags) $(conlibsmt)
khldllguiflags=$(khldllguiflags) $(guilibsmt)
khldllconflags=$(khldllconflags) $(conlibsmt)
!else
khcflags=$(khcflags) $(cvarsdll)
khlguiflags=$(khlguiflags) $(guilibsdll)
khlconflags=$(khlconflags) $(conlibsdll)
khldllguiflags=$(khldllguiflags) $(guilibsdll)
khldllconflags=$(khldllconflags) $(conlibsdll)
!endif

C2OBJ=$(CC) $(khcflags) $(KH_AUXCFLAGS) /Fo"$@" /c $**

EXECONLINK=$(LINK) /NOLOGO $(khlconflags) /OUT:$@ $**

EXEGUILINK=$(LINK) /NOLOGO $(khlguiflags) /OUT:$@ $**

DLLCONLINK=$(LINK) /NOLOGO $(khldllconflags) /OUT:$@ /IMPLIB:$(LIBDIR)\$(@B).lib $**

DLLGUILINK=$(LINK) /NOLOGO $(khldllguiflags) /OUT:$@ /IMPLIB:$(LIBDIR)\$(@B).lib $**

DLLRESLINK=$(LINK) /NOLOGO /DLL /NOENTRY /MACHINE:$(PROCESSOR_ARCHITECTURE) /OUT:$@ $**

RC2RES=$(RC) $(RFLAGS) $(rincflags) /fo $@ $**

MC2RC=$(MC) $(MCFLAGS) -h $(OBJ)\ -m 1024 -r $(OBJ)\ -x $(OBJ)\ $**

{}.c{$(OBJ)}.obj:
	$(C2OBJ)

{$(OBJ)}.c{$(OBJ)}.obj:
	$(C2OBJ)

{}.h{$(INCDIR)}.h:
	$(CP) $** $@

{}.rc{$(OBJ)}.res:
	$(RC2RES)

{$(OBJ)}.rc{$(OBJ)}.res:
	$(RC2RES)

clean::
!if exist($(OBJ))
	$(RM) $(OBJ)\
!endif

test::

mkdirs::
!if !exist($(OBJ))
	$(MKDIR) $(OBJ)
!endif

TAGFILE = $(SRC)\TAGS

etag::
	etags -o $(TAGFILE) -a *.c *.h

.SUFFIXES: .h

!endif