annotate make/sun/xawt/Makefile @ 1245:4fef42eb432c

Merge jdk7-b58 from main OpenJDK repository.
author kurt
date Wed, 20 May 2009 12:01:48 -0400
parents 0cbcc4bdf95a 06d6b91ec96f
children 2827e2508f5f
rev   line source
duke@0 1 #
son@110 2 # Copyright 2002-2008 Sun Microsystems, Inc. All Rights Reserved.
duke@0 3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
duke@0 4 #
duke@0 5 # This code is free software; you can redistribute it and/or modify it
duke@0 6 # under the terms of the GNU General Public License version 2 only, as
duke@0 7 # published by the Free Software Foundation. Sun designates this
duke@0 8 # particular file as subject to the "Classpath" exception as provided
duke@0 9 # by Sun in the LICENSE file that accompanied this code.
duke@0 10 #
duke@0 11 # This code is distributed in the hope that it will be useful, but WITHOUT
duke@0 12 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
duke@0 13 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
duke@0 14 # version 2 for more details (a copy is included in the LICENSE file that
duke@0 15 # accompanied this code).
duke@0 16 #
duke@0 17 # You should have received a copy of the GNU General Public License version
duke@0 18 # 2 along with this work; if not, write to the Free Software Foundation,
duke@0 19 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
duke@0 20 #
duke@0 21 # Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
duke@0 22 # CA 95054 USA or visit www.sun.com if you need additional information or
duke@0 23 # have any questions.
duke@0 24 #
duke@0 25
duke@0 26 BUILDDIR = ../..
duke@0 27 PACKAGE = sun.awt.X11
duke@0 28 LIBRARY = mawt
duke@0 29 LIBRARY_OUTPUT = xawt
duke@0 30 LIB_LOCATION = $(LIBDIR)/$(LIBARCH)/xawt
duke@0 31 PRODUCT = sun
duke@0 32
duke@0 33 include $(BUILDDIR)/common/Defs.gmk
duke@0 34
duke@0 35 GEN_DIR=$(GENSRCDIR)/sun/awt/X11
duke@0 36
duke@0 37 CLASSES_INIT += $(TEMPDIR)/.gen.wrappers $(TEMPDIR)/.gen_icons touch.wrappers
duke@0 38
duke@0 39 .PHONY: generated.clean
duke@0 40
duke@0 41 #
duke@0 42 # Files
duke@0 43 #
duke@0 44 include FILES_c_unix.gmk
duke@0 45 include FILES_export_unix.gmk
duke@0 46 AUTO_FILES_JAVA_DIRS = sun/awt/X11
duke@0 47 AUTO_JAVA_PRUNE = WrapperGenerator.java
duke@0 48
duke@0 49 LDFLAGS += -L$(OPENWIN_LIB)
glewis@834 50 ifeq ($(OS_NAME), netbsd)
glewis@834 51 LDFLAGS += -Wl,-R$(OPENWIN_LIB)
glewis@834 52 endif
duke@0 53
duke@0 54 ifeq ($(PLATFORM), linux)
duke@0 55 LDFLAGS += -lpthread
duke@0 56 dummy := $(shell $(MKDIR) -p $(LIB_LOCATION))
duke@0 57 endif
duke@0 58
mr@489 59 ifeq ($(PLATFORM), bsd)
mr@489 60 LDFLAGS += -pthread
mr@489 61 dummy := $(shell $(MKDIR) -p $(LIB_LOCATION))
mr@489 62 endif
mr@489 63
duke@0 64 # Since this library will be living in a subdirectory below the other libraries
duke@0 65 # we need to add an extra runpath so that libraries in the upper directory
duke@0 66 # are found at runtime.
duke@0 67 LD_RUNPATH_EXTRAS = ..
duke@0 68
duke@0 69 #
duke@0 70 # Rules.
duke@0 71 #
duke@0 72 include $(BUILDDIR)/common/Mapfile-vers.gmk
duke@0 73 include $(BUILDDIR)/common/Library.gmk
duke@0 74
duke@0 75 #
duke@0 76 # Add to the ambient vpath to pick up files in subdirectories
duke@0 77 #
duke@0 78 vpath %.c $(SHARE_SRC)/native/sunawt/alphacomposite
duke@0 79 vpath %.c $(PLATFORM_SRC)/native/sun/xawt
duke@0 80 vpath %.c $(PLATFORM_SRC)/native/sun/awt
duke@0 81 vpath %.c $(SHARE_SRC)/native/sun/awt/debug
duke@0 82 vpath %.c $(SHARE_SRC)/native/sun/awt/image
duke@0 83 vpath %.c $(SHARE_SRC)/native/sun/awt/image/gif
duke@0 84 vpath %.c $(SHARE_SRC)/native/sun/awt/image/cvutils
duke@0 85 vpath %.c $(SHARE_SRC)/native/sun/awt/shell
duke@0 86 vpath %.c $(SHARE_SRC)/native/sun/java2d
duke@0 87 vpath %.c $(SHARE_SRC)/native/sun/java2d/loops
duke@0 88 vpath %.c $(SHARE_SRC)/native/sun/java2d/pipe
duke@0 89 vpath %.c $(SHARE_SRC)/native/sun/awt/medialib
anthony@1116 90 vpath %.c $(SHARE_SRC)/native/sun/awt/utility
duke@0 91 vpath %.cpp $(SHARE_SRC)/native/sun/image
duke@0 92 vpath %.c $(SHARE_SRC)/native/sun/font
duke@0 93 vpath %.c $(PLATFORM_SRC)/native/sun/awt/robot_child
duke@0 94 vpath %.c $(SHARE_SRC)/native/sun/java2d/opengl
duke@0 95 vpath %.c $(PLATFORM_SRC)/native/sun/java2d/opengl
duke@0 96 vpath %.c $(PLATFORM_SRC)/native/sun/java2d/x11
duke@0 97
mr@489 98 ifeq ($(PLATFORM), bsd)
mr@489 99 LIBDL=
mr@489 100 else
mr@489 101 LIBDL=-ldl
mr@489 102 endif
mr@489 103 OTHER_LDLIBS = $(LIBM) -lawt -lXext -lX11 $(LIBDL) \
duke@0 104 $(LDFLAGS_COMMON) $(AWT_RUNPATH) $(OTHER_LDFLAGS) -lXtst -lXi
duke@0 105
duke@0 106 ifeq ($(PLATFORM), solaris)
duke@0 107 CPPFLAGS += -DFUNCPROTO=15
duke@0 108 dummy := $(shell $(MKDIR) -p $(LIB_LOCATION))
duke@0 109 endif
duke@0 110
duke@0 111 CPPFLAGS += -DXAWT -DXAWT_HACK \
duke@0 112 -I$(TEMPDIR)/../../sun.awt/awt/CClassHeaders \
duke@0 113 -I$(PLATFORM_SRC)/native/sun/awt \
duke@0 114 -I$(PLATFORM_SRC)/native/sun/xawt \
duke@0 115 -I$(PLATFORM_SRC)/native/sun/jdga \
duke@0 116 -I$(SHARE_SRC)/native/sun/awt/debug \
duke@0 117 -I$(SHARE_SRC)/native/sun/awt/image/cvutils \
duke@0 118 -I$(SHARE_SRC)/native/sun/java2d \
duke@0 119 -I$(SHARE_SRC)/native/sun/java2d/loops \
duke@0 120 -I$(SHARE_SRC)/native/sun/awt/image/cvutils \
duke@0 121 -I$(SHARE_SRC)/native/sun/awt/image \
duke@0 122 -I$(SHARE_SRC)/native/sun/font \
duke@0 123 -I$(PLATFORM_SRC)/native/sun/java2d \
duke@0 124 -I$(SHARE_SRC)/native/sun/java2d/pipe \
duke@0 125 -I$(SHARE_SRC)/native/sun/java2d/opengl \
duke@0 126 -I$(PLATFORM_SRC)/native/sun/java2d/opengl \
duke@0 127 -I$(PLATFORM_SRC)/native/sun/java2d/x11 \
duke@0 128 -I$(SHARE_SRC)/native/sun/dc/path \
duke@0 129 -I$(SHARE_SRC)/native/sun/dc/doe \
duke@0 130 -I$(SHARE_SRC)/native/sun/awt/alphacomposite \
duke@0 131 -I$(SHARE_SRC)/native/sun/awt/medialib \
duke@0 132 -I$(PLATFORM_SRC)/native/sun/awt/medialib \
duke@0 133 -I$(PLATFORM_SRC)/native/sun/font \
duke@0 134 -I$(SHARE_SRC)/native/sun/awt \
duke@0 135 -I$(PLATFORM_SRC)/native/sun/awt
duke@0 136
mr@489 137 CPPFLAGS += -I$(CUPS_HEADERS_PATH)
mr@489 138
duke@0 139 ifeq ($(PLATFORM), linux)
duke@0 140 # Allows for builds on Debian GNU Linux, X11 is in a different place
glewis@491 141 CPPFLAGS += -I$(OPENWIN_HOME)/include/X11/extensions \
duke@0 142 -I/usr/include/X11/extensions \
duke@0 143 -I$(OPENWIN_HOME)/include
duke@0 144 endif
duke@0 145
duke@0 146 ifeq ($(PLATFORM), solaris)
duke@0 147 CPPFLAGS += -I$(OPENWIN_HOME)/include/X11/extensions
duke@0 148 endif
duke@0 149
mr@489 150 ifeq ($(PLATFORM), bsd)
mr@489 151 CPPFLAGS += -I$(OPENWIN_HOME)/include/X11/extensions -I$(OPENWIN_HOME)/include
mr@489 152 endif
mr@489 153
glewis@491 154 ifneq ($(PLATFORM), windows)
kurt@771 155 CPPFLAGS += -DX11_PATH=\"$(X11_PATH)\" -DPACKAGE_PATH=\"$(PACKAGE_PATH)\"
glewis@491 156 endif
glewis@491 157
duke@0 158 ifeq ($(MILESTONE), internal)
duke@0 159 CPPFLAGS += -DINTERNAL_BUILD
duke@0 160 endif
duke@0 161
duke@0 162 #
duke@0 163 # Generation of wrappers
duke@0 164 #
duke@0 165 SIZER_DIR=$(GEN_DIR)/generator
duke@0 166 SIZER = $(SIZER_DIR)/sizer
duke@0 167 SIZER_32_C = $(SIZER).32.c
duke@0 168 SIZER_64_C = $(SIZER).64.c
duke@0 169 CFLAGS_32=$(CFLAGS)
duke@0 170 CFLAGS_64=$(CFLAGS)
duke@0 171
duke@0 172 ifeq ($(PLATFORM), solaris)
duke@0 173
duke@0 174 isalist:=$(shell $(ISAINFO))
duke@0 175
duke@0 176 ifneq (,$(findstring sparcv9, $(isalist)))
duke@0 177 # On sparcv9 we generate both 32 and 64-bit sizers in spite of ARCH_DATA_MODEL.
duke@0 178 # On sparcv9 CFLAGS already contain $(XARCH_OPTION/64), so to generate 32-bit sizer we need to change this option.
duke@0 179 CFLAGS_32=$(subst $(XARCH_OPTION/64),$(XARCH_OPTION/32),$(CFLAGS))
duke@0 180 SIZERS = $(SIZER).32 $(SIZER).64
duke@0 181 SIZERS_C = $(SIZER_32_C) $(SIZER_64_C)
duke@0 182 SIZES = $(WRAPPER_GENERATOR_DIR)/sizes.32 $(WRAPPER_GENERATOR_DIR)/sizes.64
duke@0 183 CFLAGS_64=$(CFLAGS) $(XARCH_OPTION/64)
duke@0 184 else
duke@0 185 ifneq (,$(findstring amd64, $(isalist)))
duke@0 186 # On amd64 we generate both 32 and 64-bit sizers in spite of ARCH_DATA_MODEL.
duke@0 187 # On amd64 CFLAGS already contain $(XARCH_OPTION/64), so to generate 32-bit sizer we need to change this option.
duke@0 188 CFLAGS_32=$(subst $(XARCH_OPTION/64),$(XARCH_OPTION/32),$(CFLAGS))
duke@0 189 SIZERS = $(SIZER).32 $(SIZER).64
duke@0 190 SIZERS_C = $(SIZER_32_C) $(SIZER_64_C)
duke@0 191 SIZES = $(WRAPPER_GENERATOR_DIR)/sizes.32 $(WRAPPER_GENERATOR_DIR)/sizes.64
duke@0 192 CFLAGS_64=$(CFLAGS) $(XARCH_OPTION/64)
duke@0 193 else # !sparcv9 : includes (32-bit) sparc, i586
duke@0 194 SIZERS = $(SIZER).32
duke@0 195 SIZERS_C = $(SIZER_32_C)
duke@0 196 SIZES = $(WRAPPER_GENERATOR_DIR)/sizes.32
duke@0 197 endif # amd64
duke@0 198 endif # sparcv9
duke@0 199
duke@0 200 else # !solaris
duke@0 201
duke@0 202 ifeq ($(ARCH_DATA_MODEL), 32)
duke@0 203 SIZERS = $(SIZER).32
duke@0 204 SIZERS_C = $(SIZER_32_C)
duke@0 205 SIZES = $(WRAPPER_GENERATOR_DIR)/sizes.32
duke@0 206 else # !32
duke@0 207 SIZERS = $(SIZER).64
duke@0 208 SIZERS_C = $(SIZER_64_C)
duke@0 209 SIZES = $(WRAPPER_GENERATOR_DIR)/sizes.64
duke@0 210 endif # 32
duke@0 211
duke@0 212 endif # solaris
duke@0 213
duke@0 214 # XXX Hack for 6185483 - use hard-coded sizes.
duke@0 215 # Add the 64-bit platforms that need to be included into 32-bit build
duke@0 216 # and have sizes.64-$(PLATFORM)-$(LIBARCH) hardcoded in the workspace
duke@0 217 ifeq ($(PLATFORM)-$(LIBARCH), solaris-i386)
duke@0 218 # If you define DOHACK=true for some combination of $(PLATFORM)-$(LIBARCH),
duke@0 219 # make sure you have sizes.64-$(PLATFORM)-$(LIBARCH) pre-generated in
duke@0 220 # $(PLATFORM_SRC)/classes/sun/awt/X11/generator/
duke@0 221 DOHACK=true
duke@0 222 endif # Hack
duke@0 223
duke@0 224 ifeq ($(DOHACK), true)
duke@0 225 PREDEFINED_SIZES_TMPL=$(PLATFORM_SRC)/classes/sun/awt/X11/generator/sizes.64-$(PLATFORM)-$(LIBARCH)
duke@0 226 PREDEFINED_SIZES=$(WRAPPER_GENERATOR_DIR)/sizes.64
duke@0 227 SIZES += $(WRAPPER_GENERATOR_DIR)/sizes.64
duke@0 228 endif
duke@0 229
duke@0 230 ifeq ($(PLATFORM)-$(LIBARCH), solaris-amd64)
duke@0 231 DOCOMPARE=true
duke@0 232 endif
duke@0 233 # 64 bit sizers are generated on platform-libarch (left) for use
duke@0 234 # on platform-libarch (right) and stored under the latter name.
duke@0 235 # Do compare manually stored and automatically generated pair(s)
duke@0 236 # if DOCOMPARE=true, just after the generation.
duke@0 237 STORED_SIZES_TMPL_solaris_amd64=$(PLATFORM_SRC)/classes/sun/awt/X11/generator/sizes.64-solaris-i386
duke@0 238
duke@0 239 WRAPPER_GENERATOR_JAVA=$(PLATFORM_SRC)/classes/sun/awt/X11/generator/WrapperGenerator.java
duke@0 240 WRAPPER_GENERATOR_DIR=$(GENSRCDIR)/sun/awt/X11/generator
duke@0 241 WRAPPER_GENERATOR_TEMPDIR=$(TEMPDIR)/sun/awt/X11/generator
duke@0 242 WRAPPER_GENERATOR_CLASS=$(WRAPPER_GENERATOR_TEMPDIR)/WrapperGenerator.class
duke@0 243 XLIBTYPES=$(PLATFORM_SRC)/classes/sun/awt/X11/generator/xlibtypes.txt
duke@0 244
duke@0 245 $(SIZERS): $(SIZERS_C)
duke@0 246 $(prep-target)
duke@0 247 $(CC) $(CFLAGS_$(subst .,,$(suffix $@))) $(CPPFLAGS) -o $@ $(SIZER)$(suffix $@).c
duke@0 248
duke@0 249 $(WRAPPER_GENERATOR_CLASS): $(WRAPPER_GENERATOR_JAVA)
duke@0 250 $(prep-target)
duke@0 251 $(BOOT_JAVAC_CMD) -d $(WRAPPER_GENERATOR_TEMPDIR) $(WRAPPER_GENERATOR_JAVA)
duke@0 252
duke@0 253 $(SIZERS_C): $(WRAPPER_GENERATOR_CLASS) $(XLIBTYPES)
duke@0 254 $(prep-target)
duke@0 255 $(MKDIR) -p $(WRAPPER_GENERATOR_TEMPDIR)
duke@0 256 $(BOOT_JAVA_CMD) -cp $(WRAPPER_GENERATOR_TEMPDIR) WrapperGenerator \
duke@0 257 $(SIZER_DIR) $(XLIBTYPES) "sizer" $(subst .,,$(suffix $(basename $@)))
duke@0 258
duke@0 259 $(SIZES): $(SIZERS)
duke@0 260 @if [ "$(DOHACK)$@" = "true$(PREDEFINED_SIZES)" ]; then \
duke@0 261 $(ECHO) COPYING $(PREDEFINED_SIZES_TMPL) into $@; \
duke@0 262 $(CP) $(PREDEFINED_SIZES_TMPL) $@; \
duke@0 263 $(CHMOD) +w $@;\
duke@0 264 else \
duke@0 265 $(ECHO) GENERATING $@; \
duke@0 266 $(WRAPPER_GENERATOR_DIR)/sizer$(suffix $@) > $@; \
duke@0 267 fi
duke@0 268 @if [ "$(DOCOMPARE)$(suffix $@)" = "true.64" ]; then \
duke@0 269 $(ECHO) COMPARING $@ and $(STORED_SIZES_TMPL_$(PLATFORM)_$(LIBARCH)); \
duke@0 270 $(DIFF) $@ $(STORED_SIZES_TMPL_$(PLATFORM)_$(LIBARCH)); \
son@110 271 fi
duke@0 272
duke@0 273 $(TEMPDIR)/.gen.wrappers: $(SIZES) $(WRAPPER_GENERATOR_CLASS) $(XLIBTYPES)
duke@0 274 $(BOOT_JAVA_CMD) -cp $(WRAPPER_GENERATOR_TEMPDIR) WrapperGenerator \
duke@0 275 $(GEN_DIR) $(XLIBTYPES) "gen" $(WRAPPER_GENERATOR_DIR)/sizes
duke@0 276
duke@0 277 touch.wrappers: $(TEMPDIR)/.gen.wrappers
duke@0 278 $(MKDIR) -p $(TEMPDIR)
duke@0 279 $(TOUCH) $(TEMPDIR)/.gen.wrappers
duke@0 280
son@110 281 generated.clean:
duke@0 282 $(RM) -r $(WRAPPER_GENERATOR_TEMPDIR)
duke@0 283 $(RM) -r $(WRAPPER_GENERATOR_DIR)
duke@0 284 $(RM) -r $(GEN_DIR)/*.java
son@110 285 $(RM) -r $(TEMPDIR)/.gen_icons
duke@0 286
duke@0 287 ifdef OPENJDK
duke@0 288 ICONS_PATH_PREFIX=$(PLATFORM_SRC)
duke@0 289 else
duke@0 290 ICONS_PATH_PREFIX=$(CLOSED_SRC)/solaris
duke@0 291 endif
duke@0 292
duke@0 293 ICONS = \
duke@0 294 $(ICONS_PATH_PREFIX)/classes/sun/awt/X11/java-icon16.png \
duke@0 295 $(ICONS_PATH_PREFIX)/classes/sun/awt/X11/java-icon24.png \
duke@0 296 $(ICONS_PATH_PREFIX)/classes/sun/awt/X11/java-icon32.png \
duke@0 297 $(ICONS_PATH_PREFIX)/classes/sun/awt/X11/java-icon48.png
duke@0 298
anthony@1116 299
anthony@1116 300 ICONPATH=$(PLATFORM_SRC)/classes/sun/awt/X11
anthony@1116 301
anthony@1116 302 ICONS += \
anthony@1116 303 $(ICONPATH)/security-icon-bw16.png \
anthony@1116 304 $(ICONPATH)/security-icon-interim16.png \
anthony@1116 305 $(ICONPATH)/security-icon-yellow16.png \
anthony@1116 306 $(ICONPATH)/security-icon-bw24.png \
anthony@1116 307 $(ICONPATH)/security-icon-interim24.png \
anthony@1116 308 $(ICONPATH)/security-icon-yellow24.png \
anthony@1116 309 $(ICONPATH)/security-icon-bw32.png \
anthony@1116 310 $(ICONPATH)/security-icon-interim32.png \
anthony@1116 311 $(ICONPATH)/security-icon-yellow32.png \
anthony@1116 312 $(ICONPATH)/security-icon-bw48.png \
anthony@1116 313 $(ICONPATH)/security-icon-interim48.png \
anthony@1116 314 $(ICONPATH)/security-icon-yellow48.png
anthony@1116 315
duke@0 316 TEMPDIR_CLASSES = $(TEMPDIR)/classes
duke@0 317
duke@0 318 $(TEMPDIR_CLASSES)/sun/awt/X11/ToBin.class: ToBin.java
duke@0 319 @$(prep-target)
duke@0 320 $(BOOT_JAVAC_CMD) -d $(TEMPDIR_CLASSES) $<
duke@0 321
duke@0 322 $(TEMPDIR)/.gen_icons: $(TEMPDIR_CLASSES)/sun/awt/X11/ToBin.class $(ICONS)
duke@0 323 $(prep-target)
duke@0 324 for i in $(ICONS); do \
duke@0 325 filename=`basename $$i`; \
duke@0 326 name=`$(ECHO) $$filename | $(TR) '\-.' '__'`; \
duke@0 327 classname=$(GEN_DIR)/XAWTIcon32_$$name.java; \
duke@0 328 $(RM) $$classname; \
duke@0 329 $(ECHO) "package sun.awt.X11;" >> $$classname ; \
duke@0 330 $(ECHO) "public class XAWTIcon32_$$name {" >> $$classname; \
duke@0 331 $(ECHO) "public static int[] $$name = { " >> $$classname; \
duke@0 332 $(CAT) $$i | \
duke@0 333 $(BOOT_JAVA_CMD) -cp $(TEMPDIR_CLASSES) \
duke@0 334 -Djava.awt.headless=true \
duke@0 335 sun.awt.X11.ToBin >> $$classname; \
duke@0 336 $(ECHO) "}; }" >> $$classname; \
duke@0 337 classname=$(GEN_DIR)/XAWTIcon64_$$name.java; \
duke@0 338 $(RM) $$classname; \
duke@0 339 $(ECHO) "package sun.awt.X11;" >> $$classname ; \
duke@0 340 $(ECHO) "public class XAWTIcon64_$$name {" >> $$classname; \
duke@0 341 $(ECHO) "public static long[] $$name = { " >> $$classname; \
duke@0 342 $(CAT) $$i | \
duke@0 343 $(BOOT_JAVA_CMD) -cp $(TEMPDIR_CLASSES) \
duke@0 344 -Djava.awt.headless=true \
duke@0 345 sun.awt.X11.ToBin >> $$classname; \
duke@0 346 $(ECHO) "}; }" >> $$classname; \
duke@0 347 done
duke@0 348 $(TOUCH) $@
duke@0 349
duke@0 350 clean clobber:: generated.clean
duke@0 351
duke@0 352 .PHONY: generated.clean robot_child
duke@0 353