jdk/makefiles/GensrcIcons.gmk
author amurillo
Wed, 15 Aug 2012 16:49:38 -0700
changeset 13465 d3fc5d192448
parent 13164 72c5d01a857d
child 13702 efd6a05935b2
permissions -rw-r--r--
7191765: make jdk8 the default jprt release for hs24 Reviewed-by: jcoomes
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
12892
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
     1
#
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
     2
# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
     3
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
     4
#
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
     5
# This code is free software; you can redistribute it and/or modify it
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
     6
# under the terms of the GNU General Public License version 2 only, as
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
     7
# published by the Free Software Foundation.  Oracle designates this
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
     8
# particular file as subject to the "Classpath" exception as provided
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
     9
# by Oracle in the LICENSE file that accompanied this code.
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
    10
#
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
    11
# This code is distributed in the hope that it will be useful, but WITHOUT
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
    12
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
    13
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
    14
# version 2 for more details (a copy is included in the LICENSE file that
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
    15
# accompanied this code).
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
    16
#
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
    17
# You should have received a copy of the GNU General Public License version
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
    18
# 2 along with this work; if not, write to the Free Software Foundation,
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
    19
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
    20
#
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
    21
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
    22
# or visit www.oracle.com if you need additional information or have any
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
    23
# questions.
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
    24
#
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
    25
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
    26
GENSRC_ICONS :=
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
    27
GENSRC_ICONS_SRC :=
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
    28
GENSRC_ICONS_TMP := $(JDK_OUTPUTDIR)/gensrc_icons
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
    29
GENSRC_ICONS_DST := $(GENSRC_ICONS_TMP)/sun/awt/X11
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
    30
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
    31
ifdef OPENJDK
13164
72c5d01a857d 7181504: Update of latest build-infra Makefiles
erikj
parents: 12892
diff changeset
    32
	ICONS_PATH_PREFIX := $(JDK_TOPDIR)/src/$(LEGACY_OPENJDK_TARGET_OS_API)
12892
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
    33
else
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
    34
	ICONS_PATH_PREFIX := $(JDK_TOPDIR)/src/closed/solaris
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
    35
endif
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
    36
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
    37
GENSRC_ICONS_SRC += \
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
    38
    $(ICONS_PATH_PREFIX)/classes/sun/awt/X11/java-icon16.png \
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
    39
    $(ICONS_PATH_PREFIX)/classes/sun/awt/X11/java-icon24.png \
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
    40
    $(ICONS_PATH_PREFIX)/classes/sun/awt/X11/java-icon32.png \
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
    41
    $(ICONS_PATH_PREFIX)/classes/sun/awt/X11/java-icon48.png
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
    42
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
    43
13164
72c5d01a857d 7181504: Update of latest build-infra Makefiles
erikj
parents: 12892
diff changeset
    44
ICONPATH := $(JDK_TOPDIR)/src/$(LEGACY_OPENJDK_TARGET_OS_API)/classes/sun/awt/X11
12892
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
    45
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
    46
GENSRC_ICONS_SRC += \
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
    47
   $(ICONPATH)/security-icon-bw16.png \
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
    48
   $(ICONPATH)/security-icon-interim16.png \
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
    49
   $(ICONPATH)/security-icon-yellow16.png \
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
    50
   $(ICONPATH)/security-icon-bw24.png \
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
    51
   $(ICONPATH)/security-icon-interim24.png \
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
    52
   $(ICONPATH)/security-icon-yellow24.png \
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
    53
   $(ICONPATH)/security-icon-bw32.png \
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
    54
   $(ICONPATH)/security-icon-interim32.png \
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
    55
   $(ICONPATH)/security-icon-yellow32.png \
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
    56
   $(ICONPATH)/security-icon-bw48.png \
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
    57
   $(ICONPATH)/security-icon-interim48.png \
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
    58
   $(ICONPATH)/security-icon-yellow48.png
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
    59
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
    60
GENSRC_ICONS_FILES := $(notdir $(GENSRC_ICONS_SRC))
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
    61
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
    62
GENSRC_ICONS_SHORT_NAME = $(subst .,_,$(subst -,_,$(1)))
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
    63
GENSRC_ICONS_DST_NAME = XAWTIcon$(2)_$(subst .,_,$(subst -,_,$(1)))
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
    64
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
    65
###
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
    66
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
    67
$(GENSRC_ICONS_TMP)/_the.dir :
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
    68
	$(ECHO) Generating icon classes
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
    69
	$(MKDIR) -p $(GENSRC_ICONS_DST)
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
    70
	$(TOUCH) $@
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
    71
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
    72
###
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
    73
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
    74
define SetupGensrcIcon
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
    75
        # param 1 is for src-file
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
    76
        # param 2 is for src-dir
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
    77
	$1_SHORTNAME := $(call GENSRC_ICONS_SHORT_NAME,$1)
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
    78
	$1_NAME32 := $(call GENSRC_ICONS_DST_NAME,$1,32)
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
    79
	$1_TARGET32 := $(GENSRC_ICONS_DST)/$$($1_NAME32).java
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
    80
	$1_NAME64 := $(call GENSRC_ICONS_DST_NAME,$1,64)
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
    81
	$1_TARGET64 := $(GENSRC_ICONS_DST)/$$($1_NAME64).java
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
    82
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
    83
$$($1_TARGET32) : $2/$1 $(GENSRC_ICONS_TMP)/_the.dir
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
    84
	$(RM) $$@ $$@.tmp
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
    85
	$(ECHO) "package sun.awt.X11;" > $$@.tmp
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
    86
	$(ECHO) "public class $$($1_NAME32) {" >> $$@.tmp
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
    87
	$(ECHO) "public static int[] $$($1_SHORTNAME) = { " >> $$@.tmp
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
    88
# TODO FIX FIX FIX
13164
72c5d01a857d 7181504: Update of latest build-infra Makefiles
erikj
parents: 12892
diff changeset
    89
ifneq ($(OPENJDK_TARGET_OS),macosx)
12892
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
    90
	$(CAT) $$< | $(TOOL_TOBIN) >> $$@.tmp
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
    91
endif
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
    92
	$(ECHO) "}; }" >> $$@.tmp
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
    93
	$(MV) $$@.tmp $$@
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
    94
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
    95
GENSRC_ICONS += $$($1_TARGET32)
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
    96
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
    97
$$($1_TARGET64) : $2/$1 $(GENSRC_ICONS_TMP)/_the.dir
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
    98
	$(RM) $$@ $$@.tmp
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
    99
	$(ECHO) "package sun.awt.X11;" > $$@.tmp
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
   100
	$(ECHO) "public class $$($1_NAME64) {" >> $$@.tmp
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
   101
	$(ECHO) "public static long[] $$($1_SHORTNAME) = { " >> $$@.tmp
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
   102
# TODO FIX FIX FIX
13164
72c5d01a857d 7181504: Update of latest build-infra Makefiles
erikj
parents: 12892
diff changeset
   103
ifneq ($(OPENJDK_TARGET_OS),macosx)
12892
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
   104
	$(CAT) $$< | $(TOOL_TOBIN) >> $$@.tmp
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
   105
endif
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
   106
	$(ECHO) "}; }" >> $$@.tmp
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
   107
	$(MV) $$@.tmp $$@
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
   108
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
   109
GENSRC_ICONS += $$($1_TARGET64)
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
   110
endef
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
   111
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
   112
$(foreach I,$(GENSRC_ICONS_SRC), $(eval $(call SetupGensrcIcon,$(notdir $(I)),$(dir $(I)))))