jdk
181 строка · 7.1 Кб
1#
2# Copyright (c) 2018, 2024, Oracle and/or its affiliates. All rights reserved.
3# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4#
5# This code is free software; you can redistribute it and/or modify it
6# under the terms of the GNU General Public License version 2 only, as
7# published by the Free Software Foundation. Oracle designates this
8# particular file as subject to the "Classpath" exception as provided
9# by Oracle in the LICENSE file that accompanied this code.
10#
11# This code is distributed in the hope that it will be useful, but WITHOUT
12# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14# version 2 for more details (a copy is included in the LICENSE file that
15# accompanied this code).
16#
17# You should have received a copy of the GNU General Public License version
18# 2 along with this work; if not, write to the Free Software Foundation,
19# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20#
21# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22# or visit www.oracle.com if you need additional information or have any
23# questions.
24#
25
26include LibCommon.gmk
27include LauncherCommon.gmk
28
29JPACKAGE_OUTPUT_DIR := \
30$(JDK_OUTPUTDIR)/modules/$(MODULE)/jdk/jpackage/internal/resources
31
32JPACKAGE_CFLAGS_windows := -DUNICODE -D_UNICODE
33JPACKAGE_CXXFLAGS_windows := -EHsc $(JPACKAGE_CFLAGS_windows)
34
35################################################################################
36## Build jpackageapplauncher
37################################################################################
38
39ifeq ($(call isTargetOs, linux), true)
40JPACKAGEAPPLAUNCHER_LINK_TYPE := C
41JPACKAGEAPPLAUNCHER_INCLUDE_FILES := %.c
42else
43JPACKAGEAPPLAUNCHER_LINK_TYPE := C++
44endif
45
46# Output app launcher executable in resources dir, and symbols in the object dir
47$(eval $(call SetupJdkExecutable, BUILD_JPACKAGEAPPLAUNCHER, \
48NAME := jpackageapplauncher, \
49LINK_TYPE := $(JPACKAGEAPPLAUNCHER_LINK_TYPE), \
50OUTPUT_DIR := $(JPACKAGE_OUTPUT_DIR), \
51SYMBOLS_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/jpackageapplauncher, \
52SRC := applauncher, \
53EXTRA_SRC := common, \
54INCLUDE_FILES := $(JPACKAGEAPPLAUNCHER_INCLUDE_FILES), \
55OPTIMIZATION := LOW, \
56DISABLED_WARNINGS_clang_LinuxPackage.c := format-nonliteral, \
57DISABLED_WARNINGS_clang_JvmLauncherLib.c := format-nonliteral, \
58CFLAGS_FILTER_OUT := -MD, \
59CXXFLAGS_FILTER_OUT := -MD, \
60CFLAGS_macosx := -Wno-format-nonliteral, \
61CFLAGS_windows := -MT $(JPACKAGE_CFLAGS_windows), \
62CXXFLAGS_windows := -MT $(JPACKAGE_CXXFLAGS_windows), \
63LD_SET_ORIGIN := false, \
64LDFLAGS_macosx := -rpath @executable_path/../Frameworks/ \
65-rpath @executable_path/../PlugIns/, \
66LIBS_macosx := -framework Cocoa, \
67LIBS_windows := msi.lib ole32.lib shell32.lib shlwapi.lib user32.lib, \
68LIBS_linux := $(LIBDL), \
69MANIFEST := $(JAVA_MANIFEST), \
70MANIFEST_VERSION := $(VERSION_NUMBER_FOUR_POSITIONS) \
71))
72
73TARGETS += $(BUILD_JPACKAGEAPPLAUNCHER)
74
75ifeq ($(call isTargetOs, linux), true)
76##############################################################################
77## Build libjpackageapplauncheraux
78##############################################################################
79
80$(eval $(call SetupJdkLibrary, BUILD_LIBJPACKAGEAPPLAUNCHERAUX, \
81NAME := jpackageapplauncheraux, \
82OUTPUT_DIR := $(JPACKAGE_OUTPUT_DIR), \
83SYMBOLS_DIR := \
84$(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libjpackageapplauncheraux, \
85SRC := libapplauncher, \
86EXTRA_SRC := \
87applauncher \
88common, \
89EXCLUDE_FILES := LinuxLauncher.c LinuxPackage.c, \
90LINK_TYPE := C++, \
91OPTIMIZATION := LOW, \
92DISABLED_WARNINGS_clang_JvmLauncherLib.c := format-nonliteral, \
93DISABLED_WARNINGS_clang_tstrings.cpp := format-nonliteral, \
94LD_SET_ORIGIN := false, \
95LIBS_linux := $(LIBDL), \
96))
97
98TARGETS += $(BUILD_LIBJPACKAGEAPPLAUNCHERAUX)
99endif
100
101ifeq ($(call isTargetOs, windows), true)
102##############################################################################
103## Build libjpackage
104##############################################################################
105
106$(eval $(call SetupJdkLibrary, BUILD_LIBJPACKAGE, \
107NAME := jpackage, \
108OPTIMIZATION := LOW, \
109EXTRA_SRC := common, \
110CXXFLAGS_windows := $(JPACKAGE_CXXFLAGS_windows), \
111LDFLAGS := $(LDFLAGS_CXX_JDK), \
112LIBS_windows := advapi32.lib msi.lib ole32.lib shell32.lib shlwapi.lib \
113user32.lib, \
114))
115
116TARGETS += $(BUILD_LIBJPACKAGE)
117
118##############################################################################
119## Build libwixhelper
120##############################################################################
121
122# Build Wix custom action helper
123# Output library in resources dir, and symbols in the object dir
124$(eval $(call SetupJdkLibrary, BUILD_LIBWIXHELPER, \
125NAME := wixhelper, \
126OUTPUT_DIR := $(JPACKAGE_OUTPUT_DIR), \
127SYMBOLS_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libwixhelper, \
128OPTIMIZATION := LOW, \
129EXTRA_SRC := common, \
130CXXFLAGS_FILTER_OUT := -MD, \
131CXXFLAGS_windows := -MT $(JPACKAGE_CXXFLAGS_windows), \
132LDFLAGS := $(LDFLAGS_CXX_JDK), \
133LIBS_windows := msi.lib ole32.lib shell32.lib shlwapi.lib user32.lib, \
134))
135
136TARGETS += $(BUILD_LIBWIXHELPER)
137
138##############################################################################
139## Build msiwrapper
140##############################################################################
141
142# Build exe installer wrapper for msi installer
143$(eval $(call SetupJdkExecutable, BUILD_MSIWRAPPER, \
144NAME := msiwrapper, \
145OUTPUT_DIR := $(JPACKAGE_OUTPUT_DIR), \
146SYMBOLS_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/msiwrapper, \
147EXTRA_SRC := common, \
148CXXFLAGS_FILTER_OUT := -MD, \
149CXXFLAGS_windows := -MT $(JPACKAGE_CXXFLAGS_windows), \
150LIBS_windows := msi.lib ole32.lib shell32.lib shlwapi.lib user32.lib, \
151))
152
153TARGETS += $(BUILD_MSIWRAPPER)
154
155##############################################################################
156## Build jpackageapplauncherw
157##############################################################################
158
159# Build non-console version of launcher
160$(eval $(call SetupJdkExecutable, BUILD_JPACKAGEAPPLAUNCHERW, \
161NAME := jpackageapplauncherw, \
162OUTPUT_DIR := $(JPACKAGE_OUTPUT_DIR), \
163SYMBOLS_DIR := \
164$(SUPPORT_OUTPUTDIR)/native/$(MODULE)/jpackageapplauncherw, \
165SRC := applauncher, \
166EXTRA_SRC := common, \
167OPTIMIZATION := LOW, \
168CFLAGS_FILTER_OUT := -MD, \
169CXXFLAGS_FILTER_OUT := -MD, \
170CFLAGS := -DJP_LAUNCHERW, \
171CXXFLAGS := -DJP_LAUNCHERW, \
172CFLAGS_windows := -MT $(JPACKAGE_CFLAGS_windows), \
173CXXFLAGS_windows := -MT $(JPACKAGE_CXXFLAGS_windows), \
174LD_SET_ORIGIN := false, \
175LIBS_windows := msi.lib ole32.lib shell32.lib shlwapi.lib user32.lib, \
176MANIFEST := $(JAVA_MANIFEST), \
177MANIFEST_VERSION := $(VERSION_NUMBER_FOUR_POSITIONS) \
178))
179
180TARGETS += $(BUILD_JPACKAGEAPPLAUNCHERW)
181endif
182