[ofw] ib_bus.inf example for synchronization of .inf DriverVer and Build date, file ver & svn version number.

Stan C. Smith stan.smith at intel.com
Wed Jun 25 12:38:32 PDT 2008


The following new files and mods enable date & version synchronization between
ibbus.sys and ib_buf.inf. The makefile and .inx filename conventions are derrived
from the WDK examples.
IB_{MAJOR/MINOR}VERSION can be overridden from definitions in the SOURCES file.

>>>> New File trunk\inc\inf_stamp.inc
>>>> .inf file created where .sys file resides.
>>>> Common makefile fragment included by makfile.inc

# Transform .inx file to .inf file adding date + major/min & svn.ver stamps
# Output .inf place is copied to bin\kernel\... folder (where .sys file resides)

_LNG=$(LANGUAGE)
_INX=.
STAMP=stampinf -a $(_BUILDARCH)

!INCLUDE mod_ver.def

..\..\..\bin\kernel\$(O)\$(INF_NAME).inf : $(_INX)\$(INF_NAME).inx 
    copy $(_INX)\$(@B).inx $@
    $(STAMP) -f $@ -d * -v $(IB_MAJORVERSION).$(IB_MINORVERSION).$(IB_F3VERSION).$(OPENIB_REV)


>>>>New file trunk\inc\mod_ver.def

# Define Major and Minor numbers for the current module build.
# This file is included by openib.def & inf_stamp.inc so as to define
# major & minor #'s in a single location.
#
# Major & Minor definitions can be defined in a local SOURCES file
# which overrides these definitions thus providing module local version
# definitions.

!IF !DEFINED(IB_MAJORVERSION)
IB_MAJORVERSION=2
!ENDIF

!IF !DEFINED(IB_MINORVERSION)
IB_MINORVERSION=0
!ENDIF

# unused File version Field 3, see inf_stamp.inc
!IF !DEFINED(IB_F3VERSION)
IB_F3VERSION=0
!ENDIF

>>>>Mods to trunk\inc\openib.def

diff C3 C:/Temp/openib.def-revBASE.svn000.tmp.def C:/openIB-windows/SVN/gen1/trunk/inc/openib.def
*** C:/Temp/openib.def-revBASE.svn000.tmp.def	Wed Jun 25 12:14:41 2008
--- C:/openIB-windows/SVN/gen1/trunk/inc/openib.def	Wed Jun 25 10:56:01 2008
***************
*** 1,3 ****
--- 1,6 ----
+ !IF !DEFINED(_OPENIB_DEF_)
+ _OPENIB_DEF_=1
+ 
  !INCLUDE $(NTMAKEENV)\makefile.def
  
  # Allow overriding the company name.
***************
*** 10,22 ****
  IB_PRODUCTNAME="""OpenFabrics\x20Windows"""
  !ENDIF
  
- !IF !DEFINED(IB_MAJORVERSION)
- IB_MAJORVERSION=1
- !endif
- 
- !IF !DEFINED(IB_MINORVERSION)
- IB_MINORVERSION=0
- !endif
  
  !IF !DEFINED(IB_FILEBUILD)
  IB_FILEBUILD=0
--- 13,20 ----
  IB_PRODUCTNAME="""OpenFabrics\x20Windows"""
  !ENDIF
  
+ # get module versions: major, minor & svn.ver
+ !include mod_ver.def
  
  !IF !DEFINED(IB_FILEBUILD)
  IB_FILEBUILD=0
***************
*** 24,31 ****
  
  !IF !DEFINED(IB_FILEREV)
  IB_FILEREV=$(OPENIB_REV)
- 
- !endif
  
  !IFNDEF VER_PROVIDER
  VER_PROVIDER="""OpenIB"""
--- 22,28 ----
  
  !IF !DEFINED(IB_FILEREV)
  IB_FILEREV=$(OPENIB_REV)
+ !ENDIF
  
  !IFNDEF VER_PROVIDER
  VER_PROVIDER="""OpenIB"""
***************
*** 37,40 ****
      -DVER_FILEMINORVERSION=$(IB_MINORVERSION) \
      -DVER_FILEBUILD=$(IB_FILEBUILD) \
  	-DVER_FILEREV=$(IB_FILEREV) \
  	-DVER_PROVIDER=$(VER_PROVIDER)
--- 34,39 ----
      -DVER_FILEMINORVERSION=$(IB_MINORVERSION) \
      -DVER_FILEBUILD=$(IB_FILEBUILD) \
  	-DVER_FILEREV=$(IB_FILEREV) \
  	-DVER_PROVIDER=$(VER_PROVIDER)
+ 
+ !ENDIF


>>>>New file trunk\core\bus\kernel\makefile.inc

#
# This file indirects to the common inf_stamp.inf that is
# shared by driver components of the OpenIB Windows project.
#

!include ..\..\..\inc\inf_stamp.inc


>>>> Rename trunk\core\bus\kernel\ib_bus.inf --> trunk\core\bus\kernel\ib_bus.inx
>>>> If you need the .inf file without stamping, copy ib_bus.inx --> ib_bus.inf
>>>> Microsoft defined the .inx convention.

>>>>Mods to trunk\core\bus\kernel\SOURCES

*** C:/Temp/SOURCES-revBASE.svn000.tmp  Wed Jun 25 12:09:33 2008
--- C:/openIB-windows/SVN/gen1/trunk/core/bus/kernel/SOURCES  Fri Jun 20 16:35:19 2008
***************
*** 2,7 ****
--- 2,17 ----
  TARGETPATH=..\..\..\bin\kernel\obj$(BUILD_ALT_DIR)
  TARGETTYPE=DRIVER
  
+ # Transform .inx --> .inf adding date & version stamps
+ # NTTARGETFILES invokes loginc in wdk\xxx\bin\makefile.new to
+ # include .\makefile.inc
+ 
+ !if $(_NT_TOOLS_VERSION) != 0x700
+ # WDK build only.
+ INF_NAME=ib_bus
+ NTTARGETFILES=..\..\..\bin\kernel\$(O)\$(INF_NAME).inf
+ MISCFILES=$(NTTARGETFILES)
+ !endif
  
  !if $(FREEBUILD)
  ENABLE_EVENT_TRACING=1






More information about the ofw mailing list