annotate make/gensrc/GensrcIcons.gmk @ 47284:59bdd7243c52

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