# # 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 # 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