VirtualBox

source: vbox/trunk/src/VBox/Installer/win/Stub/Makefile.kmk@ 64931

Last change on this file since 64931 was 64931, checked in by vboxsync, 8 years ago

installer/win/VBoxStub: Add all the certificates we use, not just the SHA-1 one.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 6.1 KB
Line 
1# $Id: Makefile.kmk 64931 2016-12-16 23:02:13Z vboxsync $
2## @file
3# Sub-Makefile for the stub installer.
4#
5
6#
7# Copyright (C) 2009-2016 Oracle Corporation
8#
9# This file is part of VirtualBox Open Source Edition (OSE), as
10# available from http://www.virtualbox.org. This file is free software;
11# you can redistribute it and/or modify it under the terms of the GNU
12# General Public License (GPL) as published by the Free Software
13# Foundation, in version 2 as it comes in the "COPYING" file of the
14# VirtualBox OSE distribution. VirtualBox OSE is distributed in the
15# hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
16#
17
18SUB_DEPTH = ../../../../..
19include $(KBUILD_PATH)/subheader.kmk
20
21# This has to be 32-bit, so don't include it in the 64-bit build.
22if "$(KBUILD_TARGET_ARCH)" == "x86"
23
24 TEMPLATE_VBOXSTUB = Drop the signing, we will sign it later.
25 TEMPLATE_VBOXSTUB_EXTENDS = VBOXR3STATIC
26 TEMPLATE_VBOXSTUB_POST_CMDS = $(NO_SUCH_VARIABLE)
27
28 PROGRAMS += VBoxStub
29 VBoxStub_TEMPLATE= VBOXSTUB
30 VBoxStub_DEFS = _WIN32_WINNT=0x0501 IN_RT_R3
31
32 VBoxStub_SOURCES = \
33 VBoxStub.cpp \
34 VBoxStub.rc
35
36 VBoxStub_SDKS += \
37 VBOX_NTDLL
38 VBoxStub_LIBS = \
39 $(VBOX_LIB_RUNTIME_STATIC) \
40 $(PATH_TOOL_$(VBOX_VCC_TOOL)_LIB)/delayimp.lib
41 VBoxStub_LDFLAGS = \
42 -DelayLoad:comctl32.dll
43 VBoxStub_POST_CMDS = $(VBOX_CHECK_IMPORTS) --image $(out) ntdll.dll kernel32.dll
44 VBoxStub_LNK_DEPS = $(VBOX_CHECK_IMPORTS)
45
46 VBoxStub.cpp_DEFS += VBOX_SVN_REV=$(VBOX_SVN_REV)
47 VBoxStub.cpp_DEPS = $(VBOX_SVN_REV_KMK)
48
49 # If signing mode is enabled, then add the possibility to install the code
50 # signing certificates (public key only) automatically in /silent mode.
51 ifdef VBOX_SIGNING_MODE
52
53 VBoxStub_SOURCES += VBoxStubCertUtil.cpp
54 VBoxStub.cpp_DEPS += $(VBoxStub_0_OUTDIR)/VBoxStubPublicCert.h
55 VBoxStub.cpp_INCS += $(VBoxStub_0_OUTDIR)
56 VBoxStub.cpp_DEFS += VBOX_WITH_CODE_SIGNING
57
58 $$(VBoxStub_0_OUTDIR)/VBoxStubPublicCert.h: | $$(dir $$@) $(VBOX_RTSIGNTOOL) $(PATH_STAGE_SYS)/VBoxDrv.sys
59 $(RM) -f -- "$@" "$@.cer0" "$@.cer1" "$@.cer2" "$@.array"
60
61 $(VBOX_RTSIGNTOOL) extract-exe-signer-cert --signature-index 0 --exe "$(PATH_STAGE_SYS)/VBoxDrv.sys" --output "$@.cer0" --der
62 $(VBOX_BIN2C) -ascii --append VBoxStubTrustedCert0 "$@.cer0" $@
63 $(APPEND) "$@.array" " { g_abVBoxStubTrustedCert0, sizeof(g_abVBoxStubTrustedCert0) }, "
64 if defined(VBOX_CERTIFICATE_SHA2_SUBJECT_NAME) && (!defined(VBOX_WITH_CORP_CODE_SIGNING) || "$(VBOX_WITH_CORP_CODE_SIGNING)" != "all")
65 $(VBOX_RTSIGNTOOL) extract-exe-signer-cert --signature-index 1 --exe "$(PATH_STAGE_SYS)/VBoxDrv.sys" --output "$@.cer1" --der
66 $(VBOX_BIN2C) -ascii --append VBoxStubTrustedCert1 "$@.cer1" $@
67 $(APPEND) "$@.array" " { g_abVBoxStubTrustedCert1, sizeof(g_abVBoxStubTrustedCert1) }, "
68 endif
69 if defined(VBOX_WITH_CORP_CODE_SIGNING) && "$(VBOX_WITH_CORP_CODE_SIGNING)" != "all" && "$(VBOX_SIGNING_MODE)" == "release"
70 $(VBOX_RTSIGNTOOL) extract-exe-signer-cert --signature-index 1 --exe "$(VBOX_RTSIGNTOOL)" --output "$@.cer2" --der
71 $(VBOX_BIN2C) -ascii --append bVBoxStubTrustedCert2 "$@.cer2" $@
72 $(APPEND) "$@.array" " { g_abVBoxStubTrustedCert2, sizeof(g_abVBoxStubTrustedCert2) }, "
73 endif
74 $(APPEND) -n "$@" \
75 "" \
76 "struct { uint8_t const *pab; uint32_t cb; }" "g_aVBoxStubTrustedCerts[] = " \
77 "{"
78 $(SED) --append "$@" -e "" "$@.array"
79 $(APPEND) -n "$@" \
80 "};"
81 $(RM) -f -- "$@.cer0" "$@.cer1" "$@.cer2" "$@.array"
82
83 VBoxStubPublicCert.h:: $$(VBoxStub_0_OUTDIR)/VBoxStubPublicCert.h
84
85 endif
86
87 # The icon location is configurable.
88 VBoxStub.rc_INCS += $(VBoxStub_0_OUTDIR)
89 VBoxStub.rc_DEPS += \
90 $(VBoxStub_0_OUTDIR)/VBoxStub-icon.rc \
91 $(VBoxStub_0_OUTDIR)/VBoxStub-manifest.rc
92 VBoxStub.rc_CLEAN = \
93 $(VBoxStub_0_OUTDIR)/VBoxStub-icon.rc \
94 $(VBoxStub_0_OUTDIR)/VBoxStub-manifest.rc
95
96 # Icon include file.
97 $$(VBoxStub_0_OUTDIR)/VBoxStub-icon.rc: $(VBOX_WINDOWS_ICON_FILE) $(MAKEFILE_CURRENT) | $$(dir $$@)
98 $(APPEND) -t $@ 'IDI_VIRTUALBOX ICON DISCARDABLE "$(subst /,\\,$(VBOX_WINDOWS_ICON_FILE))"'
99
100 # Manifest.
101 VBOX_STUB_MANIFEST_FILE := $(PATH_SUB_CURRENT)/VBoxStub.manifest
102 $$(VBoxStub_0_OUTDIR)/VBoxStub-manifest.rc: $(VBOX_STUB_MANIFEST_FILE) $(MAKEFILE_CURRENT) | $$(dir $$@)
103 $(APPEND) -t $@ 'APP_MANIFEST RT_MANIFEST "$(subst /,\\,$(VBOX_STUB_MANIFEST_FILE))"'
104
105 # Dynamic import no. 1: MSI.DLL
106 VBoxStub_SOURCES += $(VBoxStub_0_OUTDIR)/MsiLazyLoad.asm
107 $$(VBoxStub_0_OUTDIR)/MsiLazyLoad.asm: $(PATH_SUB_CURRENT)/msi.def $(VBOX_DEF_2_LAZY_LOAD) | $$(dir $$@)
108 $(call MSG_TOOL,VBoxDef2LazyLoad,VBoxStub,$(filter %.def, $^),$@)
109 $(QUIET)$(RM) -f -- "$@"
110 $(VBOX_DEF_2_LAZY_LOAD) --system --library MSI.DLL --output "$@" $(filter %.def, $^)
111
112 # Dynamic import no. 2: CRYPTO32.DLL
113 VBoxStub_SOURCES += $(VBoxStub_0_OUTDIR)/Crypt32LazyLoad.asm
114 $$(VBoxStub_0_OUTDIR)/Crypt32LazyLoad.asm: $(PATH_SUB_CURRENT)/crypt32.def $(VBOX_DEF_2_LAZY_LOAD) | $$(dir $$@)
115 $(call MSG_TOOL,VBoxDef2LazyLoad,VBoxStub,$(filter %.def, $^),$@)
116 $(QUIET)$(RM) -f -- "$@"
117 $(VBOX_DEF_2_LAZY_LOAD) --system --library CRYPT32.DLL --output "$@" $(filter %.def, $^)
118
119 # Dynamic import no. 3: WS2_32.DLL
120 VBoxStub_SOURCES += $(VBoxStub_0_OUTDIR)/Ws232LazyLoad.asm
121 $$(VBoxStub_0_OUTDIR)/Ws232LazyLoad.asm: $(PATH_SUB_CURRENT)/ws2_32.def $(VBOX_DEF_2_LAZY_LOAD) | $$(dir $$@)
122 $(call MSG_TOOL,VBoxDef2LazyLoad,VBoxStub,$(filter %.def, $^),$@)
123 $(QUIET)$(RM) -f -- "$@"
124 $(VBOX_DEF_2_LAZY_LOAD) --system --library WS2_32.DLL --output "$@" $(filter %.def, $^)
125
126 # Dynamic import no. 4: USER32.DLL
127 VBoxStub_SOURCES += $(VBoxStub_0_OUTDIR)/User32LazyLoad.asm
128 $$(VBoxStub_0_OUTDIR)/User32LazyLoad.asm: $(PATH_SUB_CURRENT)/user32.def $(VBOX_DEF_2_LAZY_LOAD) | $$(dir $$@)
129 $(call MSG_TOOL,VBoxDef2LazyLoad,VBoxStub,$(filter %.def, $^),$@)
130 $(QUIET)$(RM) -f -- "$@"
131 $(VBOX_DEF_2_LAZY_LOAD) --system --library USER32.DLL --output "$@" $(filter %.def, $^)
132
133 # Dynamic import no. 5: SHELL32.DLL
134 VBoxStub_SOURCES += $(VBoxStub_0_OUTDIR)/Shell32LazyLoad.asm
135 $$(VBoxStub_0_OUTDIR)/Shell32LazyLoad.asm: $(PATH_SUB_CURRENT)/shell32.def $(VBOX_DEF_2_LAZY_LOAD) | $$(dir $$@)
136 $(call MSG_TOOL,VBoxDef2LazyLoad,VBoxStub,$(filter %.def, $^),$@)
137 $(QUIET)$(RM) -f -- "$@"
138 $(VBOX_DEF_2_LAZY_LOAD) --system --library SHELL32.DLL --output "$@" $(filter %.def, $^)
139
140
141endif # x86 only
142
143include $(FILE_KBUILD_SUB_FOOTER)
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette