1 | # $Id: Makefile.kmk 99040 2023-03-18 21:03:42Z vboxsync $
|
---|
2 | ## @file
|
---|
3 | # Makefile for the OS/2 Guest Additions Shared Folder FSD.
|
---|
4 | #
|
---|
5 |
|
---|
6 | #
|
---|
7 | # Copyright (c) 2007 knut st. osmundsen <[email protected]>
|
---|
8 | #
|
---|
9 | # Permission is hereby granted, free of charge, to any person
|
---|
10 | # obtaining a copy of this software and associated documentation
|
---|
11 | # files (the "Software"), to deal in the Software without
|
---|
12 | # restriction, including without limitation the rights to use,
|
---|
13 | # copy, modify, merge, publish, distribute, sublicense, and/or sell
|
---|
14 | # copies of the Software, and to permit persons to whom the
|
---|
15 | # Software is furnished to do so, subject to the following
|
---|
16 | # conditions:
|
---|
17 | #
|
---|
18 | # The above copyright notice and this permission notice shall be
|
---|
19 | # included in all copies or substantial portions of the Software.
|
---|
20 | #
|
---|
21 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
---|
22 | # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
---|
23 | # OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
---|
24 | # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
---|
25 | # HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
---|
26 | # WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
---|
27 | # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
---|
28 | # OTHER DEALINGS IN THE SOFTWARE.
|
---|
29 | #
|
---|
30 |
|
---|
31 | ifneq ($(KBUILD_HOST),os2)
|
---|
32 | VBOX_USE_WATCOM_FOR_OS2 = 1
|
---|
33 | KBUILD_TARGET = os2
|
---|
34 | BUILD_TARGET = os2
|
---|
35 | KBUILD_TARGET_ARCH = x86
|
---|
36 | BUILD_TARGET_ARCH = x86
|
---|
37 | endif
|
---|
38 |
|
---|
39 | SUB_DEPTH = ../../../../..
|
---|
40 | include $(KBUILD_PATH)/subheader.kmk
|
---|
41 |
|
---|
42 | #
|
---|
43 | # Debug segment name hack for NASM and dependency workaround (see valkit/bootsector).
|
---|
44 | #
|
---|
45 | include $(KBUILD_PATH)/tools/NASM.kmk
|
---|
46 | TOOL_VBoxNasmDot = Our version of the NASM tool
|
---|
47 | ifndef TOOL_VBoxNasmDot_PATH
|
---|
48 | ifdef TOOL_VBoxNasm_PATH
|
---|
49 | TOOL_VBoxNasmDot_PATH = $(TOOL_VBoxNasm_PATH)
|
---|
50 | else
|
---|
51 | TOOL_VBoxNasmDot_PATH := $(firstword $(rsort $(wildcard $(KBUILD_DEVTOOLS_HST)/nasm/v*.*)))
|
---|
52 | if "$(TOOL_VBoxNasmDot_PATH)" == "" && "$(KBUILD_DEVTOOLS_HST_ALT)" != ""
|
---|
53 | TOOL_VBoxNasmDot_PATH := $(firstword $(rsort $(wildcard $(KBUILD_DEVTOOLS_HST_ALT)/nasm/v*.*)))
|
---|
54 | endif
|
---|
55 | endif
|
---|
56 | endif
|
---|
57 | ifneq ($(TOOL_VBoxNasmDot_PATH),)
|
---|
58 | TOOL_VBoxNasmDot_AS ?= $(TOOL_VBoxNasmDot_PATH)/nasm$(HOSTSUFF_EXE)
|
---|
59 | else
|
---|
60 | TOOL_VBoxNasmDot_AS ?= nasm$(HOSTSUFF_EXE)
|
---|
61 | endif
|
---|
62 | TOOL_VBoxNasmDot_ASFLAGS ?= $(TOOL_NASM_ASFLAGS)
|
---|
63 | TOOL_VBoxNasmDot_COMPILE_AS_OUTPUT = $(outbase).lst
|
---|
64 | TOOL_VBoxNasmDot_COMPILE_AS_DEPEND = $(dotseg_1_TARGET)
|
---|
65 | TOOL_VBoxNasmDot_COMPILE_AS_DEPORD =
|
---|
66 | define TOOL_VBoxNasmDot_COMPILE_AS_CMDS
|
---|
67 | ifdef TOOL_VBoxNasmDot_USE_KSUBMIT
|
---|
68 | $(QUIET)kmk_builtin_kSubmit -C $(PATH_OUT_BASE) -- $(TOOL_VBoxNasmDot_AS)\
|
---|
69 | $(flags) $(qaddprefix sh,-i, $(qaddsuffix ,/,$(incs))) $(qaddprefix sh,-D, $(defs))\
|
---|
70 | -l $(outbase).lst\
|
---|
71 | -o $(obj)\
|
---|
72 | -MD "$(dep)" -MP\
|
---|
73 | $(abspath $(source))
|
---|
74 | else
|
---|
75 | $(QUIET)$(REDIRECT) -C $(PATH_OUT_BASE) -- $(TOOL_VBoxNasmDot_AS)\
|
---|
76 | $(flags) $(qaddprefix sh,-i, $(qaddsuffix ,/,$(incs))) $(qaddprefix sh,-D, $(defs))\
|
---|
77 | -l $(outbase).lst\
|
---|
78 | -o $(obj)\
|
---|
79 | -MD "$(dep)" -MP\
|
---|
80 | $(abspath $(source))
|
---|
81 | endif
|
---|
82 | $(QUIET)"$(dotseg_1_TARGET)" "$(obj)"
|
---|
83 | endef
|
---|
84 |
|
---|
85 | #
|
---|
86 | # Tool for renaming segments and groups from '$debug_*' to '.debug_*'.
|
---|
87 | #
|
---|
88 | BLDPROGS += dotseg
|
---|
89 | dotseg_TEMPLATE = VBoxBldProg
|
---|
90 | dotseg_SOURCES = dotseg.cpp
|
---|
91 |
|
---|
92 |
|
---|
93 | #
|
---|
94 | # IFS kBuild template tweak.
|
---|
95 | #
|
---|
96 | TEMPLATE_VBoxR0DrvIFS = Hack to make sure we link a library. IFS must not be physical devices, but DLLs!
|
---|
97 | TEMPLATE_VBoxR0DrvIFS_EXTENDS = VBoxGuestR0Drv
|
---|
98 | ifdef VBOX_USE_WATCOM_FOR_OS2
|
---|
99 | TEMPLATE_VBoxR0DrvIFS_LDFLAGS = $(subst physdevice,dll, $(TEMPLATE_VBoxGuestR0Drv_LDFLAGS))
|
---|
100 | endif
|
---|
101 | TEMPLATE_VBoxR0DrvIFS_SYSSUFF = .ifs
|
---|
102 | TEMPLATE_VBoxR0DrvIFS_DLLSUFF = .ifs
|
---|
103 | TEMPLATE_VBoxR0DrvIFS_ASTOOL = VBoxNasmDot
|
---|
104 |
|
---|
105 |
|
---|
106 | #
|
---|
107 | # The OS/2 shared folder installable file system driver (IFS).
|
---|
108 | #
|
---|
109 | SYSMODS += VBoxSF
|
---|
110 | VBoxSF_TEMPLATE = VBoxR0DrvIFS
|
---|
111 | VBoxSF_DEFS = VBOX_WITH_HGCM
|
---|
112 | VBoxSF_INCS := \
|
---|
113 | . \
|
---|
114 | $(PATH_ROOT)/src/VBox/Runtime/include
|
---|
115 | ifdef VBOX_USE_WATCOM_FOR_OS2
|
---|
116 | VBoxSF_LDFLAGS := \
|
---|
117 | OPTION MODNAME='VBoxSF' \
|
---|
118 | SEG TYPE CODE PRELOAD DYNAMIC SHARED NONPERMANENT, \
|
---|
119 | TYPE DATA PRELOAD DYNAMIC
|
---|
120 | # OPTION DESCRIPTION "'VirtualBox Guest Additions Shared Folder FSD for OS/2.'" - quoting issues
|
---|
121 | # Data exports:
|
---|
122 | VBoxSF_LDFLAGS += \
|
---|
123 | EXPORT 'FS_ATTRIBUTE' \
|
---|
124 | EXPORT 'FS_NAME' \
|
---|
125 | EXPORT 'FS_MPSAFEFLAGS2' \
|
---|
126 | EXPORT 'FS32_ATTRIBUTE'
|
---|
127 | # 16-bit entry points.
|
---|
128 | VBoxSF_LDFLAGS += \
|
---|
129 | EXPORT 'FS_ALLOCATEPAGESPACE' \
|
---|
130 | EXPORT 'FS_ATTACH' \
|
---|
131 | EXPORT 'FS_CANCELLOCKREQUEST' \
|
---|
132 | EXPORT 'FS_CANCELLOCKREQUESTL' \
|
---|
133 | EXPORT 'FS_CHDIR' \
|
---|
134 | EXPORT 'FS_CHGFILEPTR' \
|
---|
135 | EXPORT 'FS_CLOSE' \
|
---|
136 | EXPORT 'FS_COMMIT' \
|
---|
137 | EXPORT 'FS_COPY' \
|
---|
138 | EXPORT 'FS_DELETE' \
|
---|
139 | EXPORT 'FS_DOPAGEIO' \
|
---|
140 | EXPORT 'FS_EXIT' \
|
---|
141 | EXPORT 'FS_FILEATTRIBUTE' \
|
---|
142 | EXPORT 'FS_FILEINFO' \
|
---|
143 | EXPORT 'FS_FILEIO' \
|
---|
144 | EXPORT 'FS_FILELOCKS' \
|
---|
145 | EXPORT 'FS_FILELOCKSL' \
|
---|
146 | EXPORT 'FS_FINDCLOSE' \
|
---|
147 | EXPORT 'FS_FINDFIRST' \
|
---|
148 | EXPORT 'FS_FINDFROMNAME' \
|
---|
149 | EXPORT 'FS_FINDNEXT' \
|
---|
150 | EXPORT 'FS_FINDNOTIFYCLOSE' \
|
---|
151 | EXPORT 'FS_FINDNOTIFYFIRST' \
|
---|
152 | EXPORT 'FS_FINDNOTIFYNEXT' \
|
---|
153 | EXPORT 'FS_FLUSHBUF' \
|
---|
154 | EXPORT 'FS_FSCTL' \
|
---|
155 | EXPORT 'FS_FSINFO' \
|
---|
156 | EXPORT 'FS_INIT' \
|
---|
157 | EXPORT 'FS_IOCTL' \
|
---|
158 | EXPORT 'FS_MKDIR' \
|
---|
159 | EXPORT 'FS_MOUNT' \
|
---|
160 | EXPORT 'FS_MOVE' \
|
---|
161 | EXPORT 'FS_NEWSIZE' \
|
---|
162 | EXPORT 'FS_NEWSIZEL' \
|
---|
163 | EXPORT 'FS_NMPIPE' \
|
---|
164 | EXPORT 'FS_OPENCREATE' \
|
---|
165 | EXPORT 'FS_OPENPAGEFILE' \
|
---|
166 | EXPORT 'FS_PATHINFO' \
|
---|
167 | EXPORT 'FS_PROCESSNAME' \
|
---|
168 | EXPORT 'FS_READ' \
|
---|
169 | EXPORT 'FS_RMDIR' \
|
---|
170 | EXPORT 'FS_SETSWAP' \
|
---|
171 | EXPORT 'FS_SHUTDOWN' \
|
---|
172 | EXPORT 'FS_VERIFYUNCNAME' \
|
---|
173 | EXPORT 'FS_WRITE'
|
---|
174 | # 32-bit entry points.
|
---|
175 | VBoxSF_LDFLAGS += \
|
---|
176 | EXPORT 'FS32_CHGFILEPTRL' \
|
---|
177 | EXPORT 'FS32_READ' \
|
---|
178 | EXPORT 'FS32_READFILEATCACHE' \
|
---|
179 | EXPORT 'FS32_RETURNFILECACHE' \
|
---|
180 | EXPORT 'FS32_WRITE'
|
---|
181 | else
|
---|
182 | VBoxSF_LDFLAGS := $(addprefix -Zlinker , \
|
---|
183 | SEG TYPE CODE PRELOAD DYNAMIC SHARED NONPERMANENT, \
|
---|
184 | TYPE DATA PRELOAD DYNAMIC)
|
---|
185 | #VBoxSF_LDFLAGS += -s -t -v
|
---|
186 | endif
|
---|
187 |
|
---|
188 | VBoxSF_SOURCES = \
|
---|
189 | VBoxSFA.asm \
|
---|
190 | VBoxSF.cpp \
|
---|
191 | VBoxSFFile.cpp \
|
---|
192 | VBoxSFFind.cpp \
|
---|
193 | VBoxSFInit.cpp
|
---|
194 | ifndef VBOX_USE_WATCOM_FOR_OS2
|
---|
195 | VBoxSF_SOURCES += \
|
---|
196 | VBoxSF.def
|
---|
197 | endif
|
---|
198 |
|
---|
199 | VBoxSFA.asm_DEFS = VBOX_SVN_REV_STR="$(VBOX_SVN_REV)" VBOX_VERSION_STRING="$(VBOX_VERSION_STRING)"
|
---|
200 | VBoxSFInit.cpp_DEFS = VBOX_SVN_REV=$(VBOX_SVN_REV)
|
---|
201 |
|
---|
202 | VBoxSF_LIBS = \
|
---|
203 | $(VBOX_LIB_VBGL_R0) \
|
---|
204 | $(VBOX_LIB_IPRT_GUEST_R0)
|
---|
205 | ifdef VBOX_USE_WATCOM_FOR_OS2
|
---|
206 | VBoxSF_LIBS += $(PATH_IGCC)/lib/libend.lib
|
---|
207 | else
|
---|
208 | VBoxSF_LIBS += end
|
---|
209 | endif
|
---|
210 |
|
---|
211 |
|
---|
212 | #
|
---|
213 | # Simple utility for attaching a shared folder to a drive letter.
|
---|
214 | #
|
---|
215 | PROGRAMS += VBoxSFUtil
|
---|
216 | ifdef VBOX_USE_WATCOM_FOR_OS2
|
---|
217 | VBoxSFUtil_TEMPLATE = DUMMY
|
---|
218 | VBoxSFUtil_TOOL = OPENWATCOM
|
---|
219 | VBoxSFUtil_ASTOOL = NASM
|
---|
220 | VBoxSFUtil_ASFLAGS = -f obj -DASM_FORMAT_OMF
|
---|
221 | VBoxSFUtil_INCS = $(PATH_TOOL_OPENWATCOM)/h/os2
|
---|
222 | VBoxSFUtil_LDFLAGS = -bcl=os2v2 #"IMPORT DosGlobalInfo doscalls.217"
|
---|
223 | VBoxSFUtil_DEFS = $(DEFS) IN_RING3
|
---|
224 | else
|
---|
225 | VBoxSFUtil_TEMPLATE = VBoxGuestR3Exe
|
---|
226 | endif
|
---|
227 | VBoxSFUtil_SOURCES = \
|
---|
228 | VBoxSFUtil.cpp \
|
---|
229 | VBoxSFUtilA.asm
|
---|
230 |
|
---|
231 | #PROGRAMS += VBoxSFUtil16
|
---|
232 | #VBoxSFUtil16_TEMPLATE = DUMMY
|
---|
233 | #VBoxSFUtil16_TOOL = OPENWATCOM-16
|
---|
234 | #VBoxSFUtil16_ASTOOL = NASM
|
---|
235 | #VBoxSFUtil16_INCS = $(PATH_TOOL_OPENWATCOM)/h/os2
|
---|
236 | #VBoxSFUtil16_LDFLAGS = -bcl=os2
|
---|
237 | #VBoxSFUtil16_SOURCES = VBoxSFUtil.cpp
|
---|
238 |
|
---|
239 |
|
---|
240 | include $(FILE_KBUILD_SUB_FOOTER)
|
---|
241 |
|
---|