From 1379d86e9b97c59aac534fbb652497c38b5ad709 Mon Sep 17 00:00:00 2001 From: bird Date: Tue, 22 Oct 2024 23:02:49 +0000 Subject: [PATCH] sdks/WINSDK10.kmk: Added an optional SDK_WINSDK10_MAX_VERSION restriction to make it easier to pick an WDK/SDK verison with x86 kernel mode libraries. git-svn-id: https://www.virtualbox.org/svn/kbuild-mirror/trunk@3626 1093d150-e988-4e3a-8fd4-90e8b09e91e5 --- kBuild/sdks/WINSDK10-KM-WLH.kmk | 54 +++++++++++++++++++++++++++++++++++++++++ kBuild/sdks/WINSDK10.kmk | 34 ++++++++++++++++++-------- 2 files changed, 78 insertions(+), 10 deletions(-) create mode 100644 kBuild/sdks/WINSDK10-KM-WLH.kmk diff --git a/kBuild/sdks/WINSDK10-KM-WLH.kmk b/kBuild/sdks/WINSDK10-KM-WLH.kmk new file mode 100644 index 00000000..1596b7db --- /dev/null +++ b/kBuild/sdks/WINSDK10-KM-WLH.kmk @@ -0,0 +1,54 @@ +# $Id$ +## @file +# kBuild SDK - Derives from WINSDK10.kmk, kernel mode, Targeting Windows Vista (KBUILD_TARGET_ARCH). +# +# @note There are no Vista libraries shipping with the windows 10 WDK, so this +# is a bit hackish and uses the Windows 7 ones instead. +# + +# +# Copyright (c) 2006-2021 knut st. osmundsen +# +# This file is part of kBuild. +# +# kBuild is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# kBuild is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with kBuild; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# +# As a special exception you are granted permission to include this file, via +# the kmk include directive, as you wish without this in itself causing the +# resulting makefile, program or whatever to be covered by the GPL license. +# This exception does not however invalidate any other reasons why the makefile, +# program, whatever should not be covered the GPL. +# +# + +ifndef SDK_WINSDK10 + include $(KBUILD_PATH)/sdks/WINSDK10-KM.kmk +endif + +SDK_WINSDK10-KM-WLH := The Microsoft Windows 10 SDK, kernel mode, Targeting Windows Vista (KBUILD_TARGET_ARCH) - using W7 libraries. +SDK_WINSDK10-KM-WLH_EXTENDS := WINSDK10-KM +SDK_WINSDK10-KM-WLH_DEFS ?= WIN32=100 _WIN32_WINNT=0x0600 WINVER=0x0600 _WIN32_IE=0x0700 NTDDI_VERSION=0x06000000 \ + KMDF_MAJOR_VERSION=01 KMDF_MINOR_VERSION=007 +SDK_WINSDK10-KM-WLH_LIBPATH.x86 ?= $(PATH_SDK_WINSDK10_KM_LIB_W7.x86) +SDK_WINSDK10-KM-WLH_LIBPATH.amd64 ?= $(PATH_SDK_WINSDK10_KM_LIB_W7.amd64) +SDK_WINSDK10-KM-WLH_LIBPATH.arm32 ?= $(PATH_SDK_WINSDK10_KM_LIB_W7.arm32) + +# SDK Specific Properties. +PATH_SDK_WINSDK10-KM-WLH_LIB.x86 ?= $(PATH_SDK_WINSDK10_KM_LIB_W7.x86) +PATH_SDK_WINSDK10-KM-WLH_LIB.amd64?= $(PATH_SDK_WINSDK10_KM_LIB_W7.amd64) +PATH_SDK_WINSDK10-KM-WLH_LIB.arm32?= $(PATH_SDK_WINSDK10_KM_LIB_W7.arm32) +PATH_SDK_WINSDK10-KM-WLH_LIB ?= $(PATH_SDK_WINSDK10-KM-WLH_LIB.$(KBUILD_TARGET_ARCH)) + diff --git a/kBuild/sdks/WINSDK10.kmk b/kBuild/sdks/WINSDK10.kmk index 5c7176de..b5cf9a8a 100644 --- a/kBuild/sdks/WINSDK10.kmk +++ b/kBuild/sdks/WINSDK10.kmk @@ -43,32 +43,46 @@ endif ## @def PATH_SDK_WINSDK10 ## The base path of the Windows 10 SDK. + +## @def SDK_WINSDK10_MAX_VERSION +## The maximum SDK version to use. +ifndef SDK_WINSDK10_MAX_VERSION + SDK_WINSDK10_MAX_VERSION := 99.9.99999.9 +endif + ## @def SDK_WINSDK10_VERSION ## The SDK version for subdirectories. +if defined(SDK_WINSDK10_VERSION) && "$(SDK_WINSDK10_VERSION)" > "$(SDK_WINSDK10_MAX_VERSION)" + $(warning Dropping SDK_WINSDK10_VERSION=$(SDK_WINSDK10_VERSION) is it is later than SDK_WINSDK10_MAX_VERSION=$(SDK_WINSDK10_MAX_VERSION)) + SDK_WINSDK10_VERSION := +endif + ifndef PATH_SDK_WINSDK10 ifndef SDK_WINSDK10_VERSION - PATH_SDK_WINSDK10 := $(firstfile $(foreachfile toolsdir, \ - $(KBUILD_DEVTOOLS_BLD) $(KBUILD_DEVTOOLS_TRG) $(KBUILD_DEVTOOLS)/win.x86 $(KBUILD_DEVTOOLS)/win.amd64 \ - , $(rsortfiles $(qwildcard ,$(toolsdir)/sdk/v10*/[Ii][Nn][Cc][Ll][Uu][Dd][Ee]/10.0.*)))) + PATH_SDK_WINSDK10 := $(firstfile $(foreachfile candidate, $(foreachfile toolsdir, \ + $(KBUILD_DEVTOOLS)/win $(KBUILD_DEVTOOLS_BLD) $(KBUILD_DEVTOOLS_TRG) $(KBUILD_DEVTOOLS)/win.x86 $(KBUILD_DEVTOOLS)/win.amd64 \ + ,$(rsortfiles $(qwildcard ,$(toolsdir)/sdk/v10*/[Ii][Nn][Cc][Ll][Uu][Dd][Ee]/10.0.*))) \ + ,$(if-expr "$(qnotdir ,$(candidate))" vle "$(SDK_WINSDK10_MAX_VERSION)",$(candidate),))) ifeq ($(PATH_SDK_WINSDK10),) - PATH_SDK_WINSDK10 := $(firstfile $(foreachfile progfilesdir,$(WINCMN_PROGRAM_FILES_LIST)\ - ,$(rsortfiles $(qwildcard ,$(progfilesdir)/Windows\ Kits/10/[Ii][Nn][Cc][Ll][Uu][Dd][Ee]/10.0.*)) )) + PATH_SDK_WINSDK10 := $(firstfile $(foreachfile candidate, $(foreachfile progfilesdir,$(WINCMN_PROGRAM_FILES_LIST)\ + ,$(rsortfiles $(qwildcard ,$(progfilesdir)/Windows\ Kits/10/[Ii][Nn][Cc][Ll][Uu][Dd][Ee]/10.0.*)) ) \ + ,$(if-expr "$(qnotdir ,$(candidate))" vle "$(SDK_WINSDK10_MAX_VERSION)",$(candidate),))) ifeq ($(PATH_SDK_WINSDK10),) - $(warning kBuild: PATH_SDK_WINSDK10 couldn't be determined!) - PATH_SDK_WINSDK10 := $(KBUILD_DEVTOOLS_BLD)/sdk/v10-not-found/Include/10.0.10240.0 + $(warning kBuild: PATH_SDK_WINSDK10 could not be determined!) + PATH_SDK_WINSDK10 := $(KBUILD_DEVTOOLS)/win/sdk/v10-not-found/Include/10.0.10240.0 endif endif SDK_WINSDK10_VERSION := $(qnotdir ,$(PATH_SDK_WINSDK10)) else PATH_SDK_WINSDK10 := $(firstfile $(foreachfile toolsdir, \ $(KBUILD_DEVTOOLS_BLD) $(KBUILD_DEVTOOLS_TRG) $(KBUILD_DEVTOOLS)/win.x86 $(KBUILD_DEVTOOLS)/win.amd64 \ - , $(rsortfiles $(qwildcard ,$(toolsdir)/sdk/v10*/[Ii][Nn][Cc][Ll][Uu][Dd][Ee]/$(SDK_WINSDK10_VERSION))))) + ,$(rsortfiles $(qwildcard ,$(toolsdir)/sdk/v10*/[Ii][Nn][Cc][Ll][Uu][Dd][Ee]/$(SDK_WINSDK10_VERSION))))) ifeq ($(PATH_SDK_WINSDK10),) PATH_SDK_WINSDK10 := $(firstfile $(foreachfile progfilesdir,$(WINCMN_PROGRAM_FILES_LIST)\ ,$(rsortfiles $(qwildcard ,$(progfilesdir)/Windows\ Kits/10/[Ii][Nn][Cc][Ll][Uu][Dd][Ee]/$(SDK_WINSDK10_VERSION))) )) ifeq ($(PATH_SDK_WINSDK10),) - $(warning kBuild: PATH_SDK_WINSDK10 couldn't be determined!) - PATH_SDK_WINSDK10 := $(KBUILD_DEVTOOLS_BLD)/sdk/v10-not-found/Include/$(SDK_WINSDK10_VERSION) + $(warning kBuild: PATH_SDK_WINSDK10 could not be determined!) + PATH_SDK_WINSDK10 := $(KBUILD_DEVTOOLS)/win/sdk/v10-not-found/Include/$(SDK_WINSDK10_VERSION) endif endif SDK_WINSDK10_VERSION := $(qnotdir ,$(PATH_SDK_WINSDK10)) -- 2.11.4.GIT