annotate make/gensrc/GensrcIcons.gmk @ 13471:31ba5abc1e41

8146403: Windows build can be faster Reviewed-by: ihse
author erikj
date Sat, 16 Jan 2016 13:01:44 +0100
parents 4316e603ae2a
children 47a69a64985c
rev   line source
erikj@5507 1 #
chegar@10967 2 # Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
erikj@5507 3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
erikj@5507 4 #
erikj@5507 5 # This code is free software; you can redistribute it and/or modify it
erikj@5507 6 # under the terms of the GNU General Public License version 2 only, as
erikj@5507 7 # published by the Free Software Foundation. Oracle designates this
erikj@5507 8 # particular file as subject to the "Classpath" exception as provided
erikj@5507 9 # by Oracle in the LICENSE file that accompanied this code.
erikj@5507 10 #
erikj@5507 11 # This code is distributed in the hope that it will be useful, but WITHOUT
erikj@5507 12 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
erikj@5507 13 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
erikj@5507 14 # version 2 for more details (a copy is included in the LICENSE file that
erikj@5507 15 # accompanied this code).
erikj@5507 16 #
erikj@5507 17 # You should have received a copy of the GNU General Public License version
erikj@5507 18 # 2 along with this work; if not, write to the Free Software Foundation,
erikj@5507 19 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
erikj@5507 20 #
erikj@5507 21 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
erikj@5507 22 # or visit www.oracle.com if you need additional information or have any
erikj@5507 23 # questions.
erikj@5507 24 #
erikj@5507 25
leonidr@7450 26 GENSRC_AWT_ICONS :=
leonidr@7450 27 GENSRC_AWT_ICONS_SRC :=
chegar@10967 28 GENSRC_AWT_ICONS_TMP := $(SUPPORT_OUTPUTDIR)/gensrc/java.desktop
chegar@10967 29 GENSRC_AWT_ICONS_DST := $(GENSRC_AWT_ICONS_TMP)/sun/awt/
erikj@5507 30
erikj@5507 31 ifdef OPENJDK
ihse@10990 32 X11_ICONS_PATH_PREFIX := $(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)
erikj@5507 33 else
ihse@10990 34 X11_ICONS_PATH_PREFIX := $(JDK_TOPDIR)/src/closed/java.desktop/$(OPENJDK_TARGET_OS_TYPE)
erikj@5507 35 endif
erikj@5507 36
leonidr@7450 37 GENSRC_AWT_ICONS_SRC += \
ohair@6025 38 $(X11_ICONS_PATH_PREFIX)/classes/sun/awt/X11/java-icon16.png \
ohair@6025 39 $(X11_ICONS_PATH_PREFIX)/classes/sun/awt/X11/java-icon24.png \
ohair@6025 40 $(X11_ICONS_PATH_PREFIX)/classes/sun/awt/X11/java-icon32.png \
ohair@6025 41 $(X11_ICONS_PATH_PREFIX)/classes/sun/awt/X11/java-icon48.png
erikj@5507 42
erikj@5507 43
chegar@10444 44 AWT_ICONPATH := $(JDK_TOPDIR)/src/java.desktop/share/classes/sun/awt/resources
erikj@5507 45
leonidr@7450 46 GENSRC_AWT_ICONS_SRC += \
ihse@8330 47 $(AWT_ICONPATH)/security-icon-bw16.png \
ihse@8330 48 $(AWT_ICONPATH)/security-icon-interim16.png \
ihse@8330 49 $(AWT_ICONPATH)/security-icon-yellow16.png \
ihse@8330 50 $(AWT_ICONPATH)/security-icon-bw24.png \
ihse@8330 51 $(AWT_ICONPATH)/security-icon-interim24.png \
ihse@8330 52 $(AWT_ICONPATH)/security-icon-yellow24.png \
ihse@8330 53 $(AWT_ICONPATH)/security-icon-bw32.png \
ihse@8330 54 $(AWT_ICONPATH)/security-icon-interim32.png \
ihse@8330 55 $(AWT_ICONPATH)/security-icon-yellow32.png \
ihse@8330 56 $(AWT_ICONPATH)/security-icon-bw48.png \
ihse@8330 57 $(AWT_ICONPATH)/security-icon-interim48.png \
ihse@8330 58 $(AWT_ICONPATH)/security-icon-yellow48.png
erikj@5507 59
leonidr@7450 60 GENSRC_AWT_ICONS_FILES := $(notdir $(GENSRC_AWT_ICONS_SRC))
erikj@5507 61
leonidr@7450 62 GENSRC_AWT_ICONS_SHORT_NAME = $(subst .,_,$(subst -,_,$(1)))
leonidr@7450 63 GENSRC_AWT_ICONS_DST_NAME = AWTIcon$(2)_$(subst .,_,$(subst -,_,$(1)))
erikj@5507 64
chegar@10967 65 ################################################################################
erikj@5507 66
ihse@8330 67 $(GENSRC_AWT_ICONS_TMP)/_the.icons.dir:
erikj@13471 68 $(call LogInfo, Generating icon classes)
erikj@13471 69 $(call MakeDir, $(GENSRC_AWT_ICONS_DST))
erikj@5507 70 $(TOUCH) $@
erikj@5507 71
chegar@10967 72 ################################################################################
erikj@5507 73
leonidr@7450 74 define SetupGensrcAWTIcon
ihse@8330 75 # param 1 is for src-file
ihse@8330 76 # param 2 is for src-dir
ihse@8330 77 $1_SHORTNAME := $(call GENSRC_AWT_ICONS_SHORT_NAME,$1)
ihse@8330 78 $1_NAME32 := $(call GENSRC_AWT_ICONS_DST_NAME,$1,32)
ihse@8330 79 $1_TARGET32 := $(GENSRC_AWT_ICONS_DST)/$$($1_NAME32).java
ihse@8330 80 $1_NAME64 := $(call GENSRC_AWT_ICONS_DST_NAME,$1,64)
ihse@8330 81 $1_TARGET64 := $(GENSRC_AWT_ICONS_DST)/$$($1_NAME64).java
erikj@5507 82
chegar@10444 83 $$($1_TARGET32): $2/$1 $(GENSRC_AWT_ICONS_TMP)/_the.icons.dir $(BUILD_TOOLS_JDK)
erikj@5507 84 $(RM) $$@ $$@.tmp
leonidr@7450 85 $(ECHO) "package sun.awt;" > $$@.tmp
erikj@5507 86 $(ECHO) "public class $$($1_NAME32) {" >> $$@.tmp
erikj@5507 87 $(ECHO) "public static int[] $$($1_SHORTNAME) = { " >> $$@.tmp
leonidr@7450 88 $(CAT) $$< | $(TOOL_AWT_TOBIN) >> $$@.tmp
erikj@5507 89 $(ECHO) "}; }" >> $$@.tmp
erikj@5507 90 $(MV) $$@.tmp $$@
erikj@5507 91
ihse@8330 92 GENSRC_AWT_ICONS += $$($1_TARGET32)
erikj@5507 93
chegar@10444 94 $$($1_TARGET64): $2/$1 $(GENSRC_AWT_ICONS_TMP)/_the.icons.dir $(BUILD_TOOLS_JDK)
erikj@5507 95 $(RM) $$@ $$@.tmp
leonidr@7450 96 $(ECHO) "package sun.awt;" > $$@.tmp
erikj@5507 97 $(ECHO) "public class $$($1_NAME64) {" >> $$@.tmp
erikj@5507 98 $(ECHO) "public static long[] $$($1_SHORTNAME) = { " >> $$@.tmp
leonidr@7450 99 $(CAT) $$< | $(TOOL_AWT_TOBIN) >> $$@.tmp
erikj@5507 100 $(ECHO) "}; }" >> $$@.tmp
erikj@5507 101 $(MV) $$@.tmp $$@
erikj@5507 102
ihse@8330 103 GENSRC_AWT_ICONS += $$($1_TARGET64)
erikj@5507 104 endef
erikj@5507 105
ihse@8330 106 $(foreach I, $(GENSRC_AWT_ICONS_SRC), $(eval $(call SetupGensrcAWTIcon,$(notdir $(I)),$(dir $(I)))))
ohair@6025 107
chegar@10444 108 GENSRC_JAVA_DESKTOP += $(GENSRC_AWT_ICONS)
chegar@10444 109
chegar@10967 110 ################################################################################
ohair@6025 111
ihse@8330 112 ifeq ($(OPENJDK_TARGET_OS), macosx)
ohair@6025 113
chegar@10967 114 GENSRC_OSX_ICONS_DST := $(SUPPORT_OUTPUTDIR)/headers/java.desktop
ihse@8330 115 GENSRC_OSX_ICONS := $(GENSRC_OSX_ICONS_DST)/AWTIconData.h
tbell@6106 116
tbell@6106 117 ifdef OPENJDK
erikj@9277 118 GENSRC_OSX_ICONS_SRC := $(JDK_TOPDIR)/make/data/macosxicons/JavaApp.icns
tbell@6106 119 else
erikj@9277 120 GENSRC_OSX_ICONS_SRC := $(JDK_TOPDIR)/make/closed/data/macosxicons/JavaApp.icns
tbell@6106 121 endif
tbell@6106 122
chegar@10444 123 $(GENSRC_OSX_ICONS): $(GENSRC_OSX_ICONS_SRC) $(BUILD_TOOLS_JDK)
erikj@13471 124 $(call LogInfo, Generating $(patsubst $(OUTPUT_ROOT)/%, %, $@))
erikj@13471 125 $(call MakeDir, $(@D))
ohair@6025 126 $(RM) $@ $@.tmp
ohair@6025 127 $(ECHO) "static unsigned char sAWTIconData[] = { " >> $@.tmp
ohair@6025 128 $(CAT) $< | $(TOOL_OSX_TOBIN) >> $@.tmp
ohair@6025 129 $(ECHO) "};" >> $@.tmp
ohair@6025 130 $(MV) $@.tmp $@
ohair@6025 131
chegar@10444 132 GENSRC_JAVA_DESKTOP += $(GENSRC_OSX_ICONS)
ohair@6025 133 endif