< prev index next >

make/gensrc/GensrcIcons.gmk

Print this page


   1 #
   2 # Copyright (c) 2011, 2019, 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


  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
  58 
  59 GENSRC_AWT_ICONS_FILES := $(notdir $(GENSRC_AWT_ICONS_SRC))
  60 
  61 GENSRC_AWT_ICONS_SHORT_NAME = $(subst .,_,$(subst -,_,$(1)))
  62 GENSRC_AWT_ICONS_DST_NAME = AWTIcon$(2)_$(subst .,_,$(subst -,_,$(1)))
  63 
  64 ################################################################################
  65 
  66 $(GENSRC_AWT_ICONS_TMP)/_the.icons.dir:
  67         $(call LogInfo, Generating icon classes)
  68         $(call MakeDir, $(GENSRC_AWT_ICONS_DST))
  69         $(TOUCH) $@
  70 
  71 ################################################################################
  72 




  73 define SetupGensrcAWTIcon
  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
  81 
  82   $$($1_TARGET32): $2/$1 $(GENSRC_AWT_ICONS_TMP)/_the.icons.dir $(BUILD_TOOLS_JDK)
  83         $(RM) $$@ $$@.tmp
  84         $(ECHO) "package sun.awt;" > $$@.tmp
  85         $(ECHO) "public class $$($1_NAME32) {" >> $$@.tmp
  86         $(ECHO) "public static int[] $$($1_SHORTNAME) = { " >> $$@.tmp
  87         $(CAT) $$< | $(TOOL_AWT_TOBIN) >> $$@.tmp
  88         $(ECHO) "}; }" >> $$@.tmp
  89         $(MV) $$@.tmp $$@
  90 
  91   GENSRC_AWT_ICONS += $$($1_TARGET32)
  92 
  93   $$($1_TARGET64): $2/$1 $(GENSRC_AWT_ICONS_TMP)/_the.icons.dir $(BUILD_TOOLS_JDK)
  94         $(RM) $$@ $$@.tmp
  95         $(ECHO) "package sun.awt;" > $$@.tmp
  96         $(ECHO) "public class $$($1_NAME64) {" >> $$@.tmp
  97         $(ECHO) "public static long[] $$($1_SHORTNAME) = { " >> $$@.tmp
  98         $(CAT) $$< | $(TOOL_AWT_TOBIN) >> $$@.tmp
  99         $(ECHO) "}; }" >> $$@.tmp
 100         $(MV) $$@.tmp $$@
 101 
 102   GENSRC_AWT_ICONS += $$($1_TARGET64)
 103 endef
 104 
 105 $(foreach I, $(GENSRC_AWT_ICONS_SRC), $(eval $(call SetupGensrcAWTIcon,$(notdir $(I)),$(dir $(I)))))
 106 
 107 GENSRC_JAVA_DESKTOP += $(GENSRC_AWT_ICONS)
 108 
 109 ################################################################################
 110 
 111 ifeq ($(call isTargetOs, macosx), true)



 112 
 113   GENSRC_OSX_ICONS_DST := $(SUPPORT_OUTPUTDIR)/headers/java.desktop
 114   GENSRC_OSX_ICONS := $(GENSRC_OSX_ICONS_DST)/AWTIconData.h
 115 
 116   GENSRC_OSX_ICONS_SRC ?= $(TOPDIR)/make/data/macosxicons/JavaApp.icns
 117 
 118 
 119   $(GENSRC_OSX_ICONS): $(GENSRC_OSX_ICONS_SRC) $(BUILD_TOOLS_JDK)
 120         $(call LogInfo, Generating $(patsubst $(OUTPUTDIR)/%, %, $@))
 121         $(call MakeDir, $(@D))
 122         $(RM) $@ $@.tmp
 123         $(ECHO) "static unsigned char sAWTIconData[] = { " >> $@.tmp
 124         $(CAT) $< | $(TOOL_OSX_TOBIN) >> $@.tmp
 125         $(ECHO) "};" >> $@.tmp
 126         $(MV) $@.tmp $@
 127 
 128   GENSRC_JAVA_DESKTOP += $(GENSRC_OSX_ICONS)
 129 endif
   1 #
   2 # Copyright (c) 2011, 2020, 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


  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
  58 
  59 GENSRC_AWT_ICONS_FILES := $(notdir $(GENSRC_AWT_ICONS_SRC))
  60 
  61 GENSRC_AWT_ICONS_SHORT_NAME = $(subst .,_,$(subst -,_,$(1)))
  62 GENSRC_AWT_ICONS_DST_NAME = AWTIcon$(2)_$(subst .,_,$(subst -,_,$(1)))
  63 
  64 ################################################################################
  65 
  66 $(GENSRC_AWT_ICONS_TMP)/_the.icons.dir:
  67         $(call LogInfo, Generating icon classes)
  68         $(call MakeDir, $(GENSRC_AWT_ICONS_DST))
  69         $(TOUCH) $@
  70 
  71 ################################################################################
  72 
  73 TOOL_AWT_TOBIN = $(JAVA_SMALL) -Djava.awt.headless=true \
  74     -cp $(BUILDTOOLS_OUTPUTDIR)/jdk_tools_classes \
  75     org.openjdk.buildtools.icondataawt.ToBin
  76 
  77 define SetupGensrcAWTIcon
  78   # param 1 is for src-file
  79   # param 2 is for src-dir
  80   $1_SHORTNAME := $(call GENSRC_AWT_ICONS_SHORT_NAME,$1)
  81   $1_NAME32 := $(call GENSRC_AWT_ICONS_DST_NAME,$1,32)
  82   $1_TARGET32 := $(GENSRC_AWT_ICONS_DST)/$$($1_NAME32).java
  83   $1_NAME64 := $(call GENSRC_AWT_ICONS_DST_NAME,$1,64)
  84   $1_TARGET64 := $(GENSRC_AWT_ICONS_DST)/$$($1_NAME64).java
  85 
  86   $$($1_TARGET32): $2/$1 $(GENSRC_AWT_ICONS_TMP)/_the.icons.dir $(BUILD_TOOLS_JDK)
  87         $(RM) $$@ $$@.tmp
  88         $(ECHO) "package sun.awt;" > $$@.tmp
  89         $(ECHO) "public class $$($1_NAME32) {" >> $$@.tmp
  90         $(ECHO) "public static int[] $$($1_SHORTNAME) = { " >> $$@.tmp
  91         $(CAT) $$< | $(TOOL_AWT_TOBIN) >> $$@.tmp
  92         $(ECHO) "}; }" >> $$@.tmp
  93         $(MV) $$@.tmp $$@
  94 
  95   GENSRC_AWT_ICONS += $$($1_TARGET32)
  96 
  97   $$($1_TARGET64): $2/$1 $(GENSRC_AWT_ICONS_TMP)/_the.icons.dir $(BUILD_TOOLS_JDK)
  98         $(RM) $$@ $$@.tmp
  99         $(ECHO) "package sun.awt;" > $$@.tmp
 100         $(ECHO) "public class $$($1_NAME64) {" >> $$@.tmp
 101         $(ECHO) "public static long[] $$($1_SHORTNAME) = { " >> $$@.tmp
 102         $(CAT) $$< | $(TOOL_AWT_TOBIN) >> $$@.tmp
 103         $(ECHO) "}; }" >> $$@.tmp
 104         $(MV) $$@.tmp $$@
 105 
 106   GENSRC_AWT_ICONS += $$($1_TARGET64)
 107 endef
 108 
 109 $(foreach I, $(GENSRC_AWT_ICONS_SRC), $(eval $(call SetupGensrcAWTIcon,$(notdir $(I)),$(dir $(I)))))
 110 
 111 GENSRC_JAVA_DESKTOP += $(GENSRC_AWT_ICONS)
 112 
 113 ################################################################################
 114 
 115 ifeq ($(call isTargetOs, macosx), true)
 116   TOOL_OSX_TOBIN = $(JAVA_SMALL) -Djava.awt.headless=true \
 117       -cp $(BUILDTOOLS_OUTPUTDIR)/jdk_tools_classes \
 118       org.openjdk.buildtools.icondataosx.ToBin
 119 
 120   GENSRC_OSX_ICONS_DST := $(SUPPORT_OUTPUTDIR)/headers/java.desktop
 121   GENSRC_OSX_ICONS := $(GENSRC_OSX_ICONS_DST)/AWTIconData.h
 122 
 123   GENSRC_OSX_ICONS_SRC ?= $(TOPDIR)/make/data/macosxicons/JavaApp.icns
 124 
 125 
 126   $(GENSRC_OSX_ICONS): $(GENSRC_OSX_ICONS_SRC) $(BUILD_TOOLS_JDK)
 127         $(call LogInfo, Generating $(patsubst $(OUTPUTDIR)/%, %, $@))
 128         $(call MakeDir, $(@D))
 129         $(RM) $@ $@.tmp
 130         $(ECHO) "static unsigned char sAWTIconData[] = { " >> $@.tmp
 131         $(CAT) $< | $(TOOL_OSX_TOBIN) >> $@.tmp
 132         $(ECHO) "};" >> $@.tmp
 133         $(MV) $@.tmp $@
 134 
 135   GENSRC_JAVA_DESKTOP += $(GENSRC_OSX_ICONS)
 136 endif
< prev index next >