VirtualBox

source: vbox/trunk/src/VBox/Additions/os2/VBoxSF/Makefile.kmk

Last change on this file was 99040, checked in by vboxsync, 14 months ago

*.kmk: Applied scm with new indenting of multiline variable/function expansions in variable assignments. bugref:10348

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 7.0 KB
Line 
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 <bird-src-spam@anduin.net>
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
31ifneq ($(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
37endif
38
39SUB_DEPTH = ../../../../..
40include $(KBUILD_PATH)/subheader.kmk
41
42#
43# Debug segment name hack for NASM and dependency workaround (see valkit/bootsector).
44#
45include $(KBUILD_PATH)/tools/NASM.kmk
46TOOL_VBoxNasmDot = Our version of the NASM tool
47ifndef 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
56endif
57ifneq ($(TOOL_VBoxNasmDot_PATH),)
58 TOOL_VBoxNasmDot_AS ?= $(TOOL_VBoxNasmDot_PATH)/nasm$(HOSTSUFF_EXE)
59else
60 TOOL_VBoxNasmDot_AS ?= nasm$(HOSTSUFF_EXE)
61endif
62TOOL_VBoxNasmDot_ASFLAGS ?= $(TOOL_NASM_ASFLAGS)
63TOOL_VBoxNasmDot_COMPILE_AS_OUTPUT = $(outbase).lst
64TOOL_VBoxNasmDot_COMPILE_AS_DEPEND = $(dotseg_1_TARGET)
65TOOL_VBoxNasmDot_COMPILE_AS_DEPORD =
66define 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)"
83endef
84
85#
86# Tool for renaming segments and groups from '$debug_*' to '.debug_*'.
87#
88BLDPROGS += dotseg
89dotseg_TEMPLATE = VBoxBldProg
90dotseg_SOURCES = dotseg.cpp
91
92
93#
94# IFS kBuild template tweak.
95#
96TEMPLATE_VBoxR0DrvIFS = Hack to make sure we link a library. IFS must not be physical devices, but DLLs!
97TEMPLATE_VBoxR0DrvIFS_EXTENDS = VBoxGuestR0Drv
98ifdef VBOX_USE_WATCOM_FOR_OS2
99 TEMPLATE_VBoxR0DrvIFS_LDFLAGS = $(subst physdevice,dll, $(TEMPLATE_VBoxGuestR0Drv_LDFLAGS))
100endif
101TEMPLATE_VBoxR0DrvIFS_SYSSUFF = .ifs
102TEMPLATE_VBoxR0DrvIFS_DLLSUFF = .ifs
103TEMPLATE_VBoxR0DrvIFS_ASTOOL = VBoxNasmDot
104
105
106#
107# The OS/2 shared folder installable file system driver (IFS).
108#
109SYSMODS += VBoxSF
110VBoxSF_TEMPLATE = VBoxR0DrvIFS
111VBoxSF_DEFS = VBOX_WITH_HGCM
112VBoxSF_INCS := \
113 . \
114 $(PATH_ROOT)/src/VBox/Runtime/include
115ifdef 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'
181else
182 VBoxSF_LDFLAGS := $(addprefix -Zlinker , \
183 SEG TYPE CODE PRELOAD DYNAMIC SHARED NONPERMANENT, \
184 TYPE DATA PRELOAD DYNAMIC)
185 #VBoxSF_LDFLAGS += -s -t -v
186endif
187
188VBoxSF_SOURCES = \
189 VBoxSFA.asm \
190 VBoxSF.cpp \
191 VBoxSFFile.cpp \
192 VBoxSFFind.cpp \
193 VBoxSFInit.cpp
194ifndef VBOX_USE_WATCOM_FOR_OS2
195 VBoxSF_SOURCES += \
196 VBoxSF.def
197endif
198
199VBoxSFA.asm_DEFS = VBOX_SVN_REV_STR="$(VBOX_SVN_REV)" VBOX_VERSION_STRING="$(VBOX_VERSION_STRING)"
200VBoxSFInit.cpp_DEFS = VBOX_SVN_REV=$(VBOX_SVN_REV)
201
202VBoxSF_LIBS = \
203 $(VBOX_LIB_VBGL_R0) \
204 $(VBOX_LIB_IPRT_GUEST_R0)
205ifdef VBOX_USE_WATCOM_FOR_OS2
206 VBoxSF_LIBS += $(PATH_IGCC)/lib/libend.lib
207else
208 VBoxSF_LIBS += end
209endif
210
211
212#
213# Simple utility for attaching a shared folder to a drive letter.
214#
215PROGRAMS += VBoxSFUtil
216ifdef 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
224else
225 VBoxSFUtil_TEMPLATE = VBoxGuestR3Exe
226endif
227VBoxSFUtil_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
240include $(FILE_KBUILD_SUB_FOOTER)
241
Note: See TracBrowser for help on using the repository browser.

© 2023 Oracle
ContactPrivacy policyTerms of Use