jdk/makefiles/GensrcIcons.gmk
changeset 20547 453837141fac
parent 18241 3e009b5be123
equal deleted inserted replaced
20546:5e40a295cce2 20547:453837141fac
    42 
    42 
    43 
    43 
    44 AWT_ICONPATH := $(JDK_TOPDIR)/src/share/classes/sun/awt/resources
    44 AWT_ICONPATH := $(JDK_TOPDIR)/src/share/classes/sun/awt/resources
    45 
    45 
    46 GENSRC_AWT_ICONS_SRC += \
    46 GENSRC_AWT_ICONS_SRC += \
    47    $(AWT_ICONPATH)/security-icon-bw16.png \
    47     $(AWT_ICONPATH)/security-icon-bw16.png \
    48    $(AWT_ICONPATH)/security-icon-interim16.png \
    48     $(AWT_ICONPATH)/security-icon-interim16.png \
    49    $(AWT_ICONPATH)/security-icon-yellow16.png \
    49     $(AWT_ICONPATH)/security-icon-yellow16.png \
    50    $(AWT_ICONPATH)/security-icon-bw24.png \
    50     $(AWT_ICONPATH)/security-icon-bw24.png \
    51    $(AWT_ICONPATH)/security-icon-interim24.png \
    51     $(AWT_ICONPATH)/security-icon-interim24.png \
    52    $(AWT_ICONPATH)/security-icon-yellow24.png \
    52     $(AWT_ICONPATH)/security-icon-yellow24.png \
    53    $(AWT_ICONPATH)/security-icon-bw32.png \
    53     $(AWT_ICONPATH)/security-icon-bw32.png \
    54    $(AWT_ICONPATH)/security-icon-interim32.png \
    54     $(AWT_ICONPATH)/security-icon-interim32.png \
    55    $(AWT_ICONPATH)/security-icon-yellow32.png \
    55     $(AWT_ICONPATH)/security-icon-yellow32.png \
    56    $(AWT_ICONPATH)/security-icon-bw48.png \
    56     $(AWT_ICONPATH)/security-icon-bw48.png \
    57    $(AWT_ICONPATH)/security-icon-interim48.png \
    57     $(AWT_ICONPATH)/security-icon-interim48.png \
    58    $(AWT_ICONPATH)/security-icon-yellow48.png
    58     $(AWT_ICONPATH)/security-icon-yellow48.png
    59 
    59 
    60 GENSRC_AWT_ICONS_FILES := $(notdir $(GENSRC_AWT_ICONS_SRC))
    60 GENSRC_AWT_ICONS_FILES := $(notdir $(GENSRC_AWT_ICONS_SRC))
    61 
    61 
    62 GENSRC_AWT_ICONS_SHORT_NAME = $(subst .,_,$(subst -,_,$(1)))
    62 GENSRC_AWT_ICONS_SHORT_NAME = $(subst .,_,$(subst -,_,$(1)))
    63 GENSRC_AWT_ICONS_DST_NAME = AWTIcon$(2)_$(subst .,_,$(subst -,_,$(1)))
    63 GENSRC_AWT_ICONS_DST_NAME = AWTIcon$(2)_$(subst .,_,$(subst -,_,$(1)))
    64 
    64 
    65 ###
    65 ###
    66 
    66 
    67 $(GENSRC_AWT_ICONS_TMP)/_the.icons.dir :
    67 $(GENSRC_AWT_ICONS_TMP)/_the.icons.dir:
    68 	$(ECHO) Generating icon classes
    68 	$(ECHO) Generating icon classes
    69 	$(MKDIR) -p $(GENSRC_AWT_ICONS_DST)
    69 	$(MKDIR) -p $(GENSRC_AWT_ICONS_DST)
    70 	$(TOUCH) $@
    70 	$(TOUCH) $@
    71 
    71 
    72 ###
    72 ###
    73 
    73 
    74 define SetupGensrcAWTIcon
    74 define SetupGensrcAWTIcon
    75         # param 1 is for src-file
    75   # param 1 is for src-file
    76         # param 2 is for src-dir
    76   # param 2 is for src-dir
    77 	$1_SHORTNAME := $(call GENSRC_AWT_ICONS_SHORT_NAME,$1)
    77   $1_SHORTNAME := $(call GENSRC_AWT_ICONS_SHORT_NAME,$1)
    78 	$1_NAME32 := $(call GENSRC_AWT_ICONS_DST_NAME,$1,32)
    78   $1_NAME32 := $(call GENSRC_AWT_ICONS_DST_NAME,$1,32)
    79 	$1_TARGET32 := $(GENSRC_AWT_ICONS_DST)/$$($1_NAME32).java
    79   $1_TARGET32 := $(GENSRC_AWT_ICONS_DST)/$$($1_NAME32).java
    80 	$1_NAME64 := $(call GENSRC_AWT_ICONS_DST_NAME,$1,64)
    80   $1_NAME64 := $(call GENSRC_AWT_ICONS_DST_NAME,$1,64)
    81 	$1_TARGET64 := $(GENSRC_AWT_ICONS_DST)/$$($1_NAME64).java
    81   $1_TARGET64 := $(GENSRC_AWT_ICONS_DST)/$$($1_NAME64).java
    82 
    82 
    83 $$($1_TARGET32) : $2/$1 $(GENSRC_AWT_ICONS_TMP)/_the.icons.dir
    83   $$($1_TARGET32): $2/$1 $(GENSRC_AWT_ICONS_TMP)/_the.icons.dir
    84 	$(RM) $$@ $$@.tmp
    84 	$(RM) $$@ $$@.tmp
    85 	$(ECHO) "package sun.awt;" > $$@.tmp
    85 	$(ECHO) "package sun.awt;" > $$@.tmp
    86 	$(ECHO) "public class $$($1_NAME32) {" >> $$@.tmp
    86 	$(ECHO) "public class $$($1_NAME32) {" >> $$@.tmp
    87 	$(ECHO) "public static int[] $$($1_SHORTNAME) = { " >> $$@.tmp
    87 	$(ECHO) "public static int[] $$($1_SHORTNAME) = { " >> $$@.tmp
    88 	$(CAT) $$< | $(TOOL_AWT_TOBIN) >> $$@.tmp
    88 	$(CAT) $$< | $(TOOL_AWT_TOBIN) >> $$@.tmp
    89 	$(ECHO) "}; }" >> $$@.tmp
    89 	$(ECHO) "}; }" >> $$@.tmp
    90 	$(MV) $$@.tmp $$@
    90 	$(MV) $$@.tmp $$@
    91 
    91 
    92 GENSRC_AWT_ICONS += $$($1_TARGET32)
    92   GENSRC_AWT_ICONS += $$($1_TARGET32)
    93 
    93 
    94 $$($1_TARGET64) : $2/$1 $(GENSRC_AWT_ICONS_TMP)/_the.icons.dir
    94   $$($1_TARGET64): $2/$1 $(GENSRC_AWT_ICONS_TMP)/_the.icons.dir
    95 	$(RM) $$@ $$@.tmp
    95 	$(RM) $$@ $$@.tmp
    96 	$(ECHO) "package sun.awt;" > $$@.tmp
    96 	$(ECHO) "package sun.awt;" > $$@.tmp
    97 	$(ECHO) "public class $$($1_NAME64) {" >> $$@.tmp
    97 	$(ECHO) "public class $$($1_NAME64) {" >> $$@.tmp
    98 	$(ECHO) "public static long[] $$($1_SHORTNAME) = { " >> $$@.tmp
    98 	$(ECHO) "public static long[] $$($1_SHORTNAME) = { " >> $$@.tmp
    99 	$(CAT) $$< | $(TOOL_AWT_TOBIN) >> $$@.tmp
    99 	$(CAT) $$< | $(TOOL_AWT_TOBIN) >> $$@.tmp
   100 	$(ECHO) "}; }" >> $$@.tmp
   100 	$(ECHO) "}; }" >> $$@.tmp
   101 	$(MV) $$@.tmp $$@
   101 	$(MV) $$@.tmp $$@
   102 
   102 
   103 GENSRC_AWT_ICONS += $$($1_TARGET64)
   103   GENSRC_AWT_ICONS += $$($1_TARGET64)
   104 endef
   104 endef
   105 
   105 
   106 $(foreach I,$(GENSRC_AWT_ICONS_SRC), $(eval $(call SetupGensrcAWTIcon,$(notdir $(I)),$(dir $(I)))))
   106 $(foreach I, $(GENSRC_AWT_ICONS_SRC), $(eval $(call SetupGensrcAWTIcon,$(notdir $(I)),$(dir $(I)))))
   107 
   107 
   108 ###
   108 ###
   109 
   109 
   110 ifeq ($(OPENJDK_TARGET_OS),macosx)
   110 ifeq ($(OPENJDK_TARGET_OS), macosx)
   111 
   111 
   112   GENSRC_OSX_ICONS_TMP  := $(JDK_OUTPUTDIR)/gensrc
   112   GENSRC_OSX_ICONS_TMP := $(JDK_OUTPUTDIR)/gensrc
   113   GENSRC_OSX_ICONS_DST  := $(GENSRC_OSX_ICONS_TMP)/sun/osxapp
   113   GENSRC_OSX_ICONS_DST := $(GENSRC_OSX_ICONS_TMP)/sun/osxapp
   114   GENSRC_OSX_ICONS      := $(GENSRC_OSX_ICONS_DST)/AWTIconData.h
   114   GENSRC_OSX_ICONS := $(GENSRC_OSX_ICONS_DST)/AWTIconData.h
   115 
   115 
   116   ifdef OPENJDK
   116   ifdef OPENJDK
   117     GENSRC_OSX_ICONS_SRC := $(JDK_TOPDIR)/src/macosx/native/sun/osxapp/resource/icons/JavaApp.icns
   117     GENSRC_OSX_ICONS_SRC := $(JDK_TOPDIR)/src/macosx/native/sun/osxapp/resource/icons/JavaApp.icns
   118   else
   118   else
   119     GENSRC_OSX_ICONS_SRC := $(JDK_TOPDIR)/src/closed/macosx/native/sun/osxapp/resource/icons/JavaApp.icns
   119     GENSRC_OSX_ICONS_SRC := $(JDK_TOPDIR)/src/closed/macosx/native/sun/osxapp/resource/icons/JavaApp.icns
   120   endif
   120   endif
   121 
   121 
   122 $(GENSRC_OSX_ICONS_DST)/AWTIconData.h: $(GENSRC_OSX_ICONS_SRC)
   122   $(GENSRC_OSX_ICONS_DST)/AWTIconData.h: $(GENSRC_OSX_ICONS_SRC)
   123 	$(RM) $@ $@.tmp
   123 	$(RM) $@ $@.tmp
   124 	$(MKDIR) -p $(dir $@)
   124 	$(MKDIR) -p $(dir $@)
   125 	$(ECHO) "static unsigned char sAWTIconData[] = { " >> $@.tmp
   125 	$(ECHO) "static unsigned char sAWTIconData[] = { " >> $@.tmp
   126 	$(CAT) $< | $(TOOL_OSX_TOBIN) >> $@.tmp
   126 	$(CAT) $< | $(TOOL_OSX_TOBIN) >> $@.tmp
   127 	$(ECHO) "};" >> $@.tmp
   127 	$(ECHO) "};" >> $@.tmp
   128 	$(MV) $@.tmp $@
   128 	$(MV) $@.tmp $@
   129 
   129 
   130 endif
   130 endif
   131