# Copyright 2000, International Business Machines Corporation and others. # All Rights Reserved. # # This software has been released under the terms of the IBM Public # License. For details, see the LICENSE file in the top-level source # directory or online at http://www.openafs.org/dl/license10.html # Common nmake file to be included in each NTMakfile. # # Required definitions: # AFSDEV_BUILDTYPE = [ CHECKED | FREE ] # # Optional definitions: # AFSDEV_WARNLEVEL = [0 | 1 | 2 | 3 | 4] (default is 3) # AFSDEV_AUXCDEFINES = (default is null) # AFSDEV_AUXRCFLAGS = (default is null) # AFSDEV_AUXMIDLFLAGS = auxiliary midl flags # AFSDEV_TEXTMODE = (default is null) # DEBUG_VERBOSE = optional debug statements for testing # AFS_OBJDIR - Location of object directory, either absolute or relative # AFSROOT - ROOT Directory so that $(AFSROOT)\scr is location of source # ############################################################################ # Optional compliation flags # NO_CRTDBG - used to disable some builds for CFTDBG allocate mapping # _CRTDBG_MAP_ALLOC = (default is null) # VADUMP - define VADUMP=1 if you are going to use the vadump utility and you are using V6.0 # ####### Special optional defines !IFNDEF NO_CRTDBG #don't set _CRTDBG_MAP_ALLOC flag for some module compliations #_CRTDBG_MAP_ALLOC=1 !ENDIF ####### #sanity checks !IF EXISTS("TOOLS.INI") !MESSAGE ************CAUTION TOOLS.INI IN EFFECT********** !ENDIF !IF ("$(AFSROOT)"=="") !ERROR AFSROOT is not set !ENDIF !IF (DEFINED(PROFILE) || DEFINED(TUNE)) AFSDEV_BUILDTYPE = NONE !ELSE !IF ("$(AFSDEV_BUILDTYPE)" != "CHECKED" && "$(AFSDEV_BUILDTYPE)" != "FREE") !ERROR Must define AFSDEV_BUILDTYPE to be CHECKED or FREE. !ENDIF !ENDIF !IF ("$(AFSDEV_BUILDTYPE)" == "FREE") !UNDEF _CRTDBG_MAP_ALLOC !ENDIF #define used in WinNT/2000 installation and program version display AFSPRODUCT_VERSION=1.2.11 AFSPRODUCT_FILE_VERSION=1,2,1100,0 CELLNAME_DEFAULT=Your Cell Name CELLSERVDB_INSTALL=CellServDB.GrandCentral CELLSERVDB_WEB=http://grand.central.org/dl/cellservdb/CellServDB TARGETOS = WINNT # Define defaults folder locations DEST=dest SRC=src OBJ=obj !IF ("$(AFS_OBJDIR)"=="") ######### AFS_OBJDIR is NOT used use default locations ! IF ("$(AFSDEV_BUILDTYPE)" == "CHECKED") DESTDIR=$(AFSROOT)\$(OBJ)\$(DEST)\checked OJT=$(MAKEDIR:src=obj\checked) ! ELSE DESTDIR=$(AFSROOT)\$(OBJ)\$(DEST)\free OJT=$(MAKEDIR:src=obj\free) ! ENDIF UTIL_CR = $(DESTDIR)\bin\util_cr.exe !ELSE ######### AFS_OBJDIR is defined, use specific locations for obj and dest # there is a special case for config because util_cr is not defined yet! ! IF (EXIST($(AFSROOT)\$(AFS_OBJDIR))) # AFS_OBJDIR is relative path ! IF ("$(AFSDEV_BUILDTYPE)" == "CHECKED") DESTDIR=$(AFSROOT)\$(AFS_OBJDIR)\$(DEST)\checked OJT=$(AFSROOT)\$(AFS_OBJDIR)\checked\config ! ELSE OJT=$(AFSROOT)\$(AFS_OBJDIR)\free\config DESTDIR=$(AFSROOT)\$(AFS_OBJDIR)\$(DEST)\free ! ENDIF ! ELSE ! IF (EXIST($(AFS_OBJDIR))) # AFS_OBJDIR is full path ! IF ("$(AFSDEV_BUILDTYPE)" == "CHECKED") DESTDIR=$(AFS_OBJDIR)\$(DEST)\checked OJT=$(AFS_OBJDIR)\checked\config ! ELSE DESTDIR=$(AFS_OBJDIR)\$(DEST)\free OJT=$(AFS_OBJDIR)\free\config ! ENDIF ! ELSE !ERROR Can't find location of DEST directory! ! ENDIF ! ENDIF UTIL_CR = $(DESTDIR)\bin\util_cr.exe ! IF ("$(MAKEDIR:\config=)"=="$(MAKEDIR)") # we are NOT doing a config make, use util_cr to generate object directory ! IF ( !EXIST($(UTIL_CR)) || (!EXIST($(TMP)\home) && !EXIST($(TEMP)\home)) || (([$(UTIL_CR) _dir "!$(AFSDEV_BUILDTYPE)!src!$(AFS_OBJDIR)!"])!=0)) !ERROR Can't produce object paths, util_cr not working , TMP or TEMP environment variables not defined ! ENDIF ! IF EXIST($(TMP)\home) !INCLUDE $(TMP)\home ! ELSE !INCLUDE $(TEMP)\home ! ENDIF ! ENDIF !ENDIF #AFS_OBJDIR !MESSAGE Directory assignments: OJT=[$(OJT)] DESTDIR=[$(DESTDIR)] # Definitions provided here are based on WIN32.MAK, a common nmake # file included with the MS SDK and MS VC distributions. # WIN32.MAK, and this nmake file, are targeted to the MSVC compiler; # port this nmake file if additional compiler support is required. !IF ("$(AFSVER)"=="1300") afslflags = $(afslflags) /DEBUG !ENDIF !IF ("$(APPVER)" == "") APPVER=4.0 !ENDIF !UNDEF NODEBUG !INCLUDE # Extend and/or supplement definitions in WIN32.MAK. # Command macros. COPY = -copy DEL = -del MKDIR = -mkdir REN = ren ECHO = echo CD = cd MC = mc -vcsU MAKECMD = nmake.exe COMPILE_ET = $(DESTDIR)\bin\compile_et RXGEN = $(DESTDIR)\bin\rxgen MIDL = midl # Common clean target. clean:: $(DEL) /q $(OJT)\*.obj $(OJT)\*.lib $(OJT)\*.dll $(OJT)\*.exe $(OJT)\*.pdb $(DEL) /q $(OJT)\*_component_version_number.* *_component_version_number.* # Common lang target. lang:: #################### Compile optional build flags set ########### afscdefs =\ -I. \ -I$(DESTDIR)\include \ -I$(DESTDIR)\include\afs \ -I$(DESTDIR)\include\rx \ -DWIN32_LEAN_AND_MEAN \ -DSTRICT \ -D_WIN32_IE=0x0400 \ -DAFS_AFSDB_ENV \ -DAFS_FREELANCE_CLIENT \ -DAFS_64BIT_ENV \ $(AFSDEV_AUXCDEFINES) # Compiler switches (except include paths and preprocessor defines) # # Note: if conflicting options are specified, rightmost option applies. # # /Oy- specifies no frame-pointer omission # /GF pool strings and place in read-only memory # /Gd use cdecl calling convention by default # /Gy enable function-level linking # /GX enable C++ exceptions (assumes extern C funcs never throw exceptions) # /Os favor small (over fast) code; seems to avoid 64-bit bugs in VC compiler afscflags =\ /Oy- \ /GF \ /Gd \ /Gy \ /GX \ /Os cdebug = $(cdebug:-Z7=-Zi) # avoid annoying override warning (D4025) !IF ("APPSVER"=="1300") cdebug = $(cdebug) -Zi !ENDIF !IF ("$(AFSDEV_BUILDTYPE)" == "FREE") afscflags = $(afscflags) /Ox cdebug = $(cdebug:-Od=) # avoid annoying override warning (D4025) cvarsdll = $(cvarsdll:-MDd=-MD) !ELSE # CHECKED BUILD !IF ("$(AFSVER_CL)"=="1200") afscdefs = $(afscdefs) -DDEBUG !ENDIF !IFDEF _CRTDBG_MAP_ALLOC afscflags = $(afscflags) -D_DEBUG -D_CRTDBG_MAP_ALLOC !ENDIF !ENDIF # Set compiler warning level !IFNDEF AFSDEV_WARNLEVEL AFSDEV_WARNLEVEL = 3 !ELSE !IF ("$(AFSDEV_WARNLEVEL)" != "0" && \ "$(AFSDEV_WARNLEVEL)" != "1" && \ "$(AFSDEV_WARNLEVEL)" != "2" && \ "$(AFSDEV_WARNLEVEL)" != "3" && \ "$(AFSDEV_WARNLEVEL)" != "4") !ERROR Must define AFSDEV_WARNLEVEL to be one of 0 through 4. !ENDIF !ENDIF afscflags = $(afscflags) /W$(AFSDEV_WARNLEVEL) # C/C++ compilation macros C2OBJ = $(cc) /Fo$@ /Fd$*.pdb $(cflags) $(cdebug) $(cvarsdll) $(afscflags) $(afscdefs) /c CPP2OBJ = $(C2OBJ) # Inference rules for building and installing targets # Compile .c files, from current directory to defined by OJT .SUFFIXES: .c .rc .c{$(OJT)\}.obj: $(C2OBJ) $< .c.obj: $(C2OBJ) $< .cpp{$(OJT)\}.obj: $(CPP2OBJ) $< .rc{$(OJT)\}.res: $(RC) /fo$(OJT)\$(