|
1 # |
|
2 # Copyright (c) 2011, 2012, 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 |
|
23 # questions. |
|
24 # |
|
25 |
|
26 GENSRC_ICONS := |
|
27 GENSRC_ICONS_SRC := |
|
28 GENSRC_ICONS_TMP := $(JDK_OUTPUTDIR)/gensrc_icons |
|
29 GENSRC_ICONS_DST := $(GENSRC_ICONS_TMP)/sun/awt/X11 |
|
30 |
|
31 ifdef OPENJDK |
|
32 ICONS_PATH_PREFIX := $(JDK_TOPDIR)/src/$(LEGACY_HOST_OS_API) |
|
33 else |
|
34 ICONS_PATH_PREFIX := $(JDK_TOPDIR)/src/closed/solaris |
|
35 endif |
|
36 |
|
37 GENSRC_ICONS_SRC += \ |
|
38 $(ICONS_PATH_PREFIX)/classes/sun/awt/X11/java-icon16.png \ |
|
39 $(ICONS_PATH_PREFIX)/classes/sun/awt/X11/java-icon24.png \ |
|
40 $(ICONS_PATH_PREFIX)/classes/sun/awt/X11/java-icon32.png \ |
|
41 $(ICONS_PATH_PREFIX)/classes/sun/awt/X11/java-icon48.png |
|
42 |
|
43 |
|
44 ICONPATH := $(JDK_TOPDIR)/src/$(LEGACY_HOST_OS_API)/classes/sun/awt/X11 |
|
45 |
|
46 GENSRC_ICONS_SRC += \ |
|
47 $(ICONPATH)/security-icon-bw16.png \ |
|
48 $(ICONPATH)/security-icon-interim16.png \ |
|
49 $(ICONPATH)/security-icon-yellow16.png \ |
|
50 $(ICONPATH)/security-icon-bw24.png \ |
|
51 $(ICONPATH)/security-icon-interim24.png \ |
|
52 $(ICONPATH)/security-icon-yellow24.png \ |
|
53 $(ICONPATH)/security-icon-bw32.png \ |
|
54 $(ICONPATH)/security-icon-interim32.png \ |
|
55 $(ICONPATH)/security-icon-yellow32.png \ |
|
56 $(ICONPATH)/security-icon-bw48.png \ |
|
57 $(ICONPATH)/security-icon-interim48.png \ |
|
58 $(ICONPATH)/security-icon-yellow48.png |
|
59 |
|
60 GENSRC_ICONS_FILES := $(notdir $(GENSRC_ICONS_SRC)) |
|
61 |
|
62 GENSRC_ICONS_SHORT_NAME = $(subst .,_,$(subst -,_,$(1))) |
|
63 GENSRC_ICONS_DST_NAME = XAWTIcon$(2)_$(subst .,_,$(subst -,_,$(1))) |
|
64 |
|
65 ### |
|
66 |
|
67 $(GENSRC_ICONS_TMP)/_the.dir : |
|
68 $(ECHO) Generating icon classes |
|
69 $(MKDIR) -p $(GENSRC_ICONS_DST) |
|
70 $(TOUCH) $@ |
|
71 |
|
72 ### |
|
73 |
|
74 define SetupGensrcIcon |
|
75 # param 1 is for src-file |
|
76 # param 2 is for src-dir |
|
77 $1_SHORTNAME := $(call GENSRC_ICONS_SHORT_NAME,$1) |
|
78 $1_NAME32 := $(call GENSRC_ICONS_DST_NAME,$1,32) |
|
79 $1_TARGET32 := $(GENSRC_ICONS_DST)/$$($1_NAME32).java |
|
80 $1_NAME64 := $(call GENSRC_ICONS_DST_NAME,$1,64) |
|
81 $1_TARGET64 := $(GENSRC_ICONS_DST)/$$($1_NAME64).java |
|
82 |
|
83 $$($1_TARGET32) : $2/$1 $(GENSRC_ICONS_TMP)/_the.dir |
|
84 $(RM) $$@ $$@.tmp |
|
85 $(ECHO) "package sun.awt.X11;" > $$@.tmp |
|
86 $(ECHO) "public class $$($1_NAME32) {" >> $$@.tmp |
|
87 $(ECHO) "public static int[] $$($1_SHORTNAME) = { " >> $$@.tmp |
|
88 # TODO FIX FIX FIX |
|
89 ifneq ($(PLATFORM),macosx) |
|
90 $(CAT) $$< | $(TOOL_TOBIN) >> $$@.tmp |
|
91 endif |
|
92 $(ECHO) "}; }" >> $$@.tmp |
|
93 $(MV) $$@.tmp $$@ |
|
94 |
|
95 GENSRC_ICONS += $$($1_TARGET32) |
|
96 |
|
97 $$($1_TARGET64) : $2/$1 $(GENSRC_ICONS_TMP)/_the.dir |
|
98 $(RM) $$@ $$@.tmp |
|
99 $(ECHO) "package sun.awt.X11;" > $$@.tmp |
|
100 $(ECHO) "public class $$($1_NAME64) {" >> $$@.tmp |
|
101 $(ECHO) "public static long[] $$($1_SHORTNAME) = { " >> $$@.tmp |
|
102 # TODO FIX FIX FIX |
|
103 ifneq ($(PLATFORM),macosx) |
|
104 $(CAT) $$< | $(TOOL_TOBIN) >> $$@.tmp |
|
105 endif |
|
106 $(ECHO) "}; }" >> $$@.tmp |
|
107 $(MV) $$@.tmp $$@ |
|
108 |
|
109 GENSRC_ICONS += $$($1_TARGET64) |
|
110 endef |
|
111 |
|
112 $(foreach I,$(GENSRC_ICONS_SRC), $(eval $(call SetupGensrcIcon,$(notdir $(I)),$(dir $(I))))) |