author | pliden |
Thu, 28 Mar 2019 19:43:59 +0100 | |
changeset 54330 | 69e80a82db9a |
parent 53683 | 48ff68e2fe5c |
child 58908 | 73bb9c4002cc |
permissions | -rw-r--r-- |
12892 | 1 |
# |
41472 | 2 |
# Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved. |
12892 | 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 |
||
47314 | 26 |
$(eval $(call IncludeCustomExtension, gensrc/GensrcIcons.gmk)) |
39504
96c700e62710
8003593: build-infra: Paths to optional platform-specific files should not be hardwired to src/closed
erikj
parents:
35241
diff
changeset
|
27 |
|
18241 | 28 |
GENSRC_AWT_ICONS := |
29 |
GENSRC_AWT_ICONS_SRC := |
|
27565 | 30 |
GENSRC_AWT_ICONS_TMP := $(SUPPORT_OUTPUTDIR)/gensrc/java.desktop |
31 |
GENSRC_AWT_ICONS_DST := $(GENSRC_AWT_ICONS_TMP)/sun/awt/ |
|
12892 | 32 |
|
39504
96c700e62710
8003593: build-infra: Paths to optional platform-specific files should not be hardwired to src/closed
erikj
parents:
35241
diff
changeset
|
33 |
# Allow this to be overridden from a custom makefile |
47217 | 34 |
X11_ICONS_PATH_PREFIX ?= $(TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE) |
12892 | 35 |
|
18241 | 36 |
GENSRC_AWT_ICONS_SRC += \ |
14231 | 37 |
$(X11_ICONS_PATH_PREFIX)/classes/sun/awt/X11/java-icon16.png \ |
38 |
$(X11_ICONS_PATH_PREFIX)/classes/sun/awt/X11/java-icon24.png \ |
|
39 |
$(X11_ICONS_PATH_PREFIX)/classes/sun/awt/X11/java-icon32.png \ |
|
40 |
$(X11_ICONS_PATH_PREFIX)/classes/sun/awt/X11/java-icon48.png |
|
12892 | 41 |
|
42 |
||
47217 | 43 |
AWT_ICONPATH := $(TOPDIR)/src/java.desktop/share/classes/sun/awt/resources |
12892 | 44 |
|
18241 | 45 |
GENSRC_AWT_ICONS_SRC += \ |
20547 | 46 |
$(AWT_ICONPATH)/security-icon-bw16.png \ |
47 |
$(AWT_ICONPATH)/security-icon-interim16.png \ |
|
48 |
$(AWT_ICONPATH)/security-icon-yellow16.png \ |
|
49 |
$(AWT_ICONPATH)/security-icon-bw24.png \ |
|
50 |
$(AWT_ICONPATH)/security-icon-interim24.png \ |
|
51 |
$(AWT_ICONPATH)/security-icon-yellow24.png \ |
|
52 |
$(AWT_ICONPATH)/security-icon-bw32.png \ |
|
53 |
$(AWT_ICONPATH)/security-icon-interim32.png \ |
|
54 |
$(AWT_ICONPATH)/security-icon-yellow32.png \ |
|
55 |
$(AWT_ICONPATH)/security-icon-bw48.png \ |
|
56 |
$(AWT_ICONPATH)/security-icon-interim48.png \ |
|
57 |
$(AWT_ICONPATH)/security-icon-yellow48.png |
|
12892 | 58 |
|
18241 | 59 |
GENSRC_AWT_ICONS_FILES := $(notdir $(GENSRC_AWT_ICONS_SRC)) |
12892 | 60 |
|
18241 | 61 |
GENSRC_AWT_ICONS_SHORT_NAME = $(subst .,_,$(subst -,_,$(1))) |
62 |
GENSRC_AWT_ICONS_DST_NAME = AWTIcon$(2)_$(subst .,_,$(subst -,_,$(1))) |
|
12892 | 63 |
|
27565 | 64 |
################################################################################ |
12892 | 65 |
|
20547 | 66 |
$(GENSRC_AWT_ICONS_TMP)/_the.icons.dir: |
35241 | 67 |
$(call LogInfo, Generating icon classes) |
68 |
$(call MakeDir, $(GENSRC_AWT_ICONS_DST)) |
|
12892 | 69 |
$(TOUCH) $@ |
70 |
||
27565 | 71 |
################################################################################ |
12892 | 72 |
|
18241 | 73 |
define SetupGensrcAWTIcon |
20547 | 74 |
# param 1 is for src-file |
75 |
# param 2 is for src-dir |
|
76 |
$1_SHORTNAME := $(call GENSRC_AWT_ICONS_SHORT_NAME,$1) |
|
77 |
$1_NAME32 := $(call GENSRC_AWT_ICONS_DST_NAME,$1,32) |
|
78 |
$1_TARGET32 := $(GENSRC_AWT_ICONS_DST)/$$($1_NAME32).java |
|
79 |
$1_NAME64 := $(call GENSRC_AWT_ICONS_DST_NAME,$1,64) |
|
80 |
$1_TARGET64 := $(GENSRC_AWT_ICONS_DST)/$$($1_NAME64).java |
|
12892 | 81 |
|
25859 | 82 |
$$($1_TARGET32): $2/$1 $(GENSRC_AWT_ICONS_TMP)/_the.icons.dir $(BUILD_TOOLS_JDK) |
12892 | 83 |
$(RM) $$@ $$@.tmp |
18241 | 84 |
$(ECHO) "package sun.awt;" > $$@.tmp |
12892 | 85 |
$(ECHO) "public class $$($1_NAME32) {" >> $$@.tmp |
86 |
$(ECHO) "public static int[] $$($1_SHORTNAME) = { " >> $$@.tmp |
|
18241 | 87 |
$(CAT) $$< | $(TOOL_AWT_TOBIN) >> $$@.tmp |
12892 | 88 |
$(ECHO) "}; }" >> $$@.tmp |
89 |
$(MV) $$@.tmp $$@ |
|
90 |
||
20547 | 91 |
GENSRC_AWT_ICONS += $$($1_TARGET32) |
12892 | 92 |
|
25859 | 93 |
$$($1_TARGET64): $2/$1 $(GENSRC_AWT_ICONS_TMP)/_the.icons.dir $(BUILD_TOOLS_JDK) |
12892 | 94 |
$(RM) $$@ $$@.tmp |
18241 | 95 |
$(ECHO) "package sun.awt;" > $$@.tmp |
12892 | 96 |
$(ECHO) "public class $$($1_NAME64) {" >> $$@.tmp |
97 |
$(ECHO) "public static long[] $$($1_SHORTNAME) = { " >> $$@.tmp |
|
18241 | 98 |
$(CAT) $$< | $(TOOL_AWT_TOBIN) >> $$@.tmp |
12892 | 99 |
$(ECHO) "}; }" >> $$@.tmp |
100 |
$(MV) $$@.tmp $$@ |
|
101 |
||
20547 | 102 |
GENSRC_AWT_ICONS += $$($1_TARGET64) |
12892 | 103 |
endef |
104 |
||
20547 | 105 |
$(foreach I, $(GENSRC_AWT_ICONS_SRC), $(eval $(call SetupGensrcAWTIcon,$(notdir $(I)),$(dir $(I))))) |
14231 | 106 |
|
25859 | 107 |
GENSRC_JAVA_DESKTOP += $(GENSRC_AWT_ICONS) |
108 |
||
27565 | 109 |
################################################################################ |
14231 | 110 |
|
53683 | 111 |
ifeq ($(call isTargetOs, macosx), true) |
14231 | 112 |
|
27565 | 113 |
GENSRC_OSX_ICONS_DST := $(SUPPORT_OUTPUTDIR)/headers/java.desktop |
20547 | 114 |
GENSRC_OSX_ICONS := $(GENSRC_OSX_ICONS_DST)/AWTIconData.h |
14429
f930c8da4439
8001965: build-infra: Large compare diffs between new and old on mac
tbell
parents:
14231
diff
changeset
|
115 |
|
47217 | 116 |
GENSRC_OSX_ICONS_SRC ?= $(TOPDIR)/make/data/macosxicons/JavaApp.icns |
39504
96c700e62710
8003593: build-infra: Paths to optional platform-specific files should not be hardwired to src/closed
erikj
parents:
35241
diff
changeset
|
117 |
|
14429
f930c8da4439
8001965: build-infra: Large compare diffs between new and old on mac
tbell
parents:
14231
diff
changeset
|
118 |
|
25859 | 119 |
$(GENSRC_OSX_ICONS): $(GENSRC_OSX_ICONS_SRC) $(BUILD_TOOLS_JDK) |
47253
92fd0e04e0e1
8187544: Replace BUILD_OUTPUT and OUTPUT_ROOT with OUTPUTDIR
ihse
parents:
47217
diff
changeset
|
120 |
$(call LogInfo, Generating $(patsubst $(OUTPUTDIR)/%, %, $@)) |
35241 | 121 |
$(call MakeDir, $(@D)) |
14231 | 122 |
$(RM) $@ $@.tmp |
123 |
$(ECHO) "static unsigned char sAWTIconData[] = { " >> $@.tmp |
|
124 |
$(CAT) $< | $(TOOL_OSX_TOBIN) >> $@.tmp |
|
125 |
$(ECHO) "};" >> $@.tmp |
|
126 |
$(MV) $@.tmp $@ |
|
127 |
||
25859 | 128 |
GENSRC_JAVA_DESKTOP += $(GENSRC_OSX_ICONS) |
14231 | 129 |
endif |