Note to self: selective target name in DDK builds

Just found out how to properly “detect” in the sources file which one (32 or 64bit) is being built and assign a different output name to the debug symbols and the target file.

!if $(386)
TARGETNAME=shellext32
!elseif $(AMD64)
TARGETNAME=shellext64
!else
TARGETNAME=shellext
!endif

Pretty useful at times. I did try !if "$(CPUTYPE)" == "..." but that didn’t work out for me. It may not be useful at first sight, but if you consider that due to WOW64, both DLLs could be in use at the same time on the same computer, the use may become more apparent … (for IA64 this wouldn’t be the case, though).

// Oliver

This entry was posted in /dev/null, EN, Programming. Bookmark the permalink.

One Response to Note to self: selective target name in DDK builds

  1. Eugene says:

    Year.. I use the same technique:

    TARGETNAME=GoodLib

    !IF “$(AMD64)”==”1”
    TARGETNAME=$(TARGETNAME)64
    !ENDIF

    Another question is a detection of type of platform in ddkpostbld.cmd… I use something like this:

    if “%_BUILDARCH%” == “AMD64” (
    set ASMDIR=x64
    ) else (
    set ASMDIR=Win32
    )

    if not “%ASMDIR%” == “x64” set _BUILDARCH=i386

    xcopy “.\obj%BUILD_ALT_DIR%\%_BUILDARCH%\*.pdb” “%SYMDIR%\%MYBUILDTYPE%” /Y /I /R /E /Q

    if not exist “%TEMPDIR%\%PRJNAME%” md “%TEMPDIR%\%PRJNAME%”
    move /y .\obj%BUILD_ALT_DIR% “%TEMPDIR%\%PRJNAME%” > nul
    move /y .\%ASMDIR%\*.asm “%TEMPDIR%\%PRJNAME%\obj%BUILD_ALT_DIR%\%_BUILDARCH%” > nul

Leave a Reply

Your email address will not be published. Required fields are marked *