2 # Copyright (c) 2008 Secure Endpoints Inc.
4 # Permission is hereby granted, free of charge, to any person
5 # obtaining a copy of this software and associated documentation files
6 # (the "Software"), to deal in the Software without restriction,
7 # including without limitation the rights to use, copy, modify, merge,
8 # publish, distribute, sublicense, and/or sell copies of the Software,
9 # and to permit persons to whom the Software is furnished to do so,
10 # subject to the following conditions:
12 # The above copyright notice and this permission notice shall be
13 # included in all copies or substantial portions of the Software.
15 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16 # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17 # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18 # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
19 # BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
20 # ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
21 # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
24 # Environment variables
25 # ---------------------
27 # Before running the makefile, set the environment variable KFWSDKDIR
28 # to the directory containing the Kerberos for Windows SDK version 3.1
29 # or later. The path should not end in a backslash.
31 # Configuration settings
32 # ----------------------
34 # Declare a few things about our plug-in.
36 # TODO: Change the plug-in name
37 PLUGINNAME=MyAFSExtPlugin
39 # TODO: Change the module name
40 MODULENAME=MyAFSExtModule
42 # TODO: Change the authentication method name
43 AUTHMETHODNAME=$(PLUGINNAME)
45 # TODO: Change this as appropriate
50 # TODO: Change the version numbers
57 VERLIST=$(VERMAJOR).$(VERMINOR).$(VERAUX).$(VERPATCH)
58 VERLISTC=$(VERMAJOR),$(VERMINOR),$(VERAUX),$(VERPATCH)
63 ! error Platform SDK environment variables not set.
67 ! error KFWSDKDIR environment variable not set.
71 ! error AFSPLUGINDIR environment variable not set.
85 !error Environment variable 'CPU' is not defined.
88 DEST=$(BUILDROOT)\dest\$(CPU)_$(BUILDTYPE)
89 OBJ=$(BUILDROOT)\obj\$(CPU)_$(BUILDTYPE)
92 KFWINCDIR=$(KFWSDKDIR)\inc
93 NIDMINCDIR=$(KFWINCDIR)\netidmgr
94 NIDMLIBDIR=$(KFWSDKDIR)\lib\$(CPU)
96 NIDMINCDIR=$(KFWSDKDIR)\inc
97 NIDMLIBDIR=$(KFWSDKDIR)
117 incflags = -I"$(NIDMINCDIR)" -I"$(OBJ)" -I"$(AFSPLUGINDIR)" -I.
118 rincflags = /i "$(NIDMINCDIR)" /i "$(OBJ)" /i "$(AFSPLUGINDIR)" /i .
120 ldebug = $(ldebug) /DEBUG
121 cdebug = $(cdebug) -Os -Zi
123 cdefines = $(cdefines) -DUNICODE -D_UNICODE
125 C2OBJ=$(CC) $(cdebug) $(cflags) $(incflags) $(cdefines) /Fo"$@" /c $**
127 DLLGUILINK=$(LINK) /NOLOGO $(ldebug) $(dlllflags) $(guilibsmt) /OUT:"$@" /IMPLIB:$(DEST)\$(@B).lib $**
129 DLLRESLINK=$(LINK) /NOLOGO /DLL /NOENTRY /MACHINE:$(PROCESSOR_ARCHITECTURE) /OUT:"$@" $**
131 RC2RES=$(RC) $(RFLAGS) $(rincflags) /fo "$@" $**
133 MC2RC=$(MC) $(MCFLAGS) -h "$(OBJ)\" -m 1024 -r "$(OBJ)\" -x "$(OBJ)\" $**
138 {$(OBJ)}.c{$(OBJ)}.obj:
161 # Starting with Visual Studio 8, the C compiler and the linker
162 # generate manifests so that the applications will link with the
163 # correct side-by-side DLLs at run-time. These are required for
164 # correct operation under Windows XP. We also have custom manifests
165 # which need to be merged with the manifests that VS creates.
167 # The syntax for invoking the _VC_MANIFEST_EMBED_foo macro is:
168 # $(_VC_MANIFEST_EMBED_???) <any additional manifests that need to be merged in>
175 _VC_MANIFEST_EMBED_EXE= \
176 if exist "$@.manifest" $(MT) -outputresource:"$@";1 -manifest "$@.manifest"
178 _VC_MANIFEST_EMBED_DLL=$(_VC_MANIFEST_EMBED_EXE)
180 # Note that if you are merging manifests, then the VS generated
181 # manifest should be cleaned up after calling _VC_MANIFEST_EMBED_???.
182 # This ensures that even if the DLL or EXE is executed in-place, the
183 # embedded manifest will be used. Otherwise the $@.manifest file will
185 _VC_MANIFEST_CLEAN= \
186 if exist "$@.manifest" $(RM) "$@.manifest"
188 # End of manifest handling
191 # Now for the actual build stuff
193 DLL=$(DEST)\$(DLLBASENAME).dll
196 "$(NIDMLIBDIR)\nidmgr32.lib"
202 $(OBJ)\config_main.obj
204 DLLRESFILE=$(OBJ)\version.res
206 CONFIGHEADER=$(OBJ)\credacq_config.h
208 all: mkdirs $(CONFIGHEADER) $(DLL) lang
210 $(CONFIGHEADER): Makefile
212 /* This is a generated file. Do not modify directly. */
216 #define MYPLUGIN_DLLBASE "$(DLLBASENAME)"
218 #define MYPLUGIN_NAME "$(PLUGINNAME)"
220 #define MYMODULE_NAME "$(MODULENAME)"
222 #define AUTHMETHOD_NAME "$(AUTHMETHODNAME)"
224 #define VERSION_MAJOR $(VERMAJOR)
225 #define VERSION_MINOR $(VERMINOR)
226 #define VERSION_AUX $(VERAUX)
227 #define VERSION_PATCH $(VERPATCH)
229 #define VERSION_LIST $(VERLIST)
230 #define VERSION_LISTC $(VERLISTC)
231 #define VERSION_STRING "$(VERLIST)"
236 $(RM) $(CONFIGHEADER)
238 $(DLL): $(OBJFILES) $(DLLRESFILE)
239 $(DLLGUILINK) $(LIBFILES)
240 $(_VC_MANIFEST_EMBED_DLL)
241 $(_VC_MANIFEST_CLEAN)
246 # Language specific resources
248 # (repeat the following block as needed, redefining LANG for each
249 # supported language)
254 LANGDLL=$(DEST)\$(DLLBASENAME)_$(LANG).dll
258 $(LANGDLL): $(OBJ)\langres_$(LANG).res $(OBJ)\version_$(LANG).res
260 $(_VC_MANIFEST_EMBED_DLL)
261 $(_VC_MANIFEST_CLEAN)
266 $(OBJ)\version_$(LANG).res: version.rc
267 $(RC) $(RFLAGS) $(rincflags) /d LANGRES /d LANG_$(LANG) /fo $@ $**
270 $(RM) $(OBJ)\version_$(LANG).res
272 $(OBJ)\langres_$(LANG).res: lang\$(LANG)\langres.rc
276 $(RM) $(OBJ)\langres_$(LANG).res