1 | # $Id: Makefile.kmk 106855 2024-11-06 15:07:33Z vboxsync $
|
---|
2 | ## @file
|
---|
3 | # Sub-Makefile for zlib.
|
---|
4 | #
|
---|
5 |
|
---|
6 | #
|
---|
7 | # Copyright (C) 2006-2024 Oracle and/or its affiliates.
|
---|
8 | #
|
---|
9 | # This file is part of VirtualBox base platform packages, as
|
---|
10 | # available from https://www.virtualbox.org.
|
---|
11 | #
|
---|
12 | # This program is free software; you can redistribute it and/or
|
---|
13 | # modify it under the terms of the GNU General Public License
|
---|
14 | # as published by the Free Software Foundation, in version 3 of the
|
---|
15 | # License.
|
---|
16 | #
|
---|
17 | # This program is distributed in the hope that it will be useful, but
|
---|
18 | # WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
19 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
---|
20 | # General Public License for more details.
|
---|
21 | #
|
---|
22 | # You should have received a copy of the GNU General Public License
|
---|
23 | # along with this program; if not, see <https://www.gnu.org/licenses>.
|
---|
24 | #
|
---|
25 | # SPDX-License-Identifier: GPL-3.0-only
|
---|
26 | #
|
---|
27 |
|
---|
28 | SUB_DEPTH = ../../..
|
---|
29 | include $(KBUILD_PATH)/subheader.kmk
|
---|
30 |
|
---|
31 | LIBRARIES += VBox-zlib
|
---|
32 | if1of ($(KBUILD_TARGET), os2 win)
|
---|
33 | # only required for vbox-img
|
---|
34 | LIBRARIES += VBox-zlib-static
|
---|
35 | endif
|
---|
36 | VBox-zlib_TEMPLATE = VBoxR3RuntimeDllNonPedanticFast
|
---|
37 | VBox-zlib_DEFS = verbose=-1 NO_VIZ=1
|
---|
38 | ifn1of ($(KBUILD_TARGET), win)
|
---|
39 | VBox-zlib_DEFS = Z_HAVE_UNISTD_H
|
---|
40 | endif
|
---|
41 | VBox-zlib_SOURCES = \
|
---|
42 | adler32.c \
|
---|
43 | compress.c \
|
---|
44 | crc32.c \
|
---|
45 | gzclose.c \
|
---|
46 | gzlib.c \
|
---|
47 | gzread.c \
|
---|
48 | gzwrite.c \
|
---|
49 | uncompr.c \
|
---|
50 | deflate.c \
|
---|
51 | trees.c \
|
---|
52 | zutil.c \
|
---|
53 | inflate.c \
|
---|
54 | infback.c \
|
---|
55 | inftrees.c \
|
---|
56 | inffast.c
|
---|
57 |
|
---|
58 | VBox-zlib-static_TEMPLATE = VBoxR3StaticNonPedantic
|
---|
59 | VBox-zlib-static_DEFS = $(VBox-zlib_DEFS)
|
---|
60 | ifdef VBOX_WITH_NOCRT_STATIC
|
---|
61 | VBox-zlib-static_DEFS += IPRT_NO_CRT_FOR_3RD_PARTY
|
---|
62 | endif
|
---|
63 | VBox-zlib-static_SOURCES = $(VBox-zlib_SOURCES)
|
---|
64 |
|
---|
65 | ifdef VBOX_WITH_32_ON_64_MAIN_API # 32-bit edition.
|
---|
66 | LIBRARIES += VBox-zlib-x86
|
---|
67 | VBox-zlib-x86_TEMPLATE = VBoxR3DllNonPedantic-x86
|
---|
68 | VBox-zlib-x86_EXTENDS = VBox-zlib
|
---|
69 | endif
|
---|
70 |
|
---|
71 | # Builds a Windows DLL in a separate tree so that it can be found by the scons build system.
|
---|
72 | # Required for building NSIS (Windows Guest Additions installer) from source.
|
---|
73 | if defined(VBOX_WITH_ADDITIONS) || !defined(VBOX_WITHOUT_ADDITIONS)
|
---|
74 | DLLS.win += nsis-zlib-dll
|
---|
75 | nsis-zlib-dll_EXTENDS := VBox-zlib
|
---|
76 | nsis-zlib-dll_NAME := zlib1
|
---|
77 | nsis-zlib-dll_TEMPLATE := VBoxR3DllNonPedantic
|
---|
78 | nsis-zlib-dll_INSTTYPE := none
|
---|
79 | nsis-zlib-dll_DEFS := ZLIB_DLL $(VBox-zlib_DEFS)
|
---|
80 | nsis-zlib-dll_SOURCES.win := \
|
---|
81 | win32/zlib1.rc \
|
---|
82 | win32/zlib.def
|
---|
83 |
|
---|
84 | INSTALLS.win += nsis-zlib-install
|
---|
85 | nsis-zlib-install_TEMPLATE := DUMMY
|
---|
86 | nsis-zlib-install_INSTTYPE := stage
|
---|
87 | nsis-zlib-install_INST := nsis-zlib/
|
---|
88 | nsis-zlib-install_MODE := a+r,u+w
|
---|
89 | nsis-zlib-install_SOURCES = \
|
---|
90 | $(nsis-zlib-dll_1_TARGET) \
|
---|
91 | $(basename $(nsis-zlib-dll_1_TARGET)).lib=>lib/zlib.lib \
|
---|
92 | $(basename $(nsis-zlib-dll_1_TARGET)).lib=>lib/zlib1.lib \
|
---|
93 | zconf.h=>include/zconf.h \
|
---|
94 | zlib.h=>include/zlib.h
|
---|
95 | endif
|
---|
96 |
|
---|
97 | include $(FILE_KBUILD_SUB_FOOTER)
|
---|
98 |
|
---|