6630878: clean target in sun/xawt is incomplete
Summary: clean target should remove .gen_icons
Reviewed-by: yan
## Copyright 2002-2008 Sun Microsystems, Inc. All Rights Reserved.# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.## This code is free software; you can redistribute it and/or modify it# under the terms of the GNU General Public License version 2 only, as# published by the Free Software Foundation. Sun designates this# particular file as subject to the "Classpath" exception as provided# by Sun in the LICENSE file that accompanied this code.## This code is distributed in the hope that it will be useful, but WITHOUT# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License# version 2 for more details (a copy is included in the LICENSE file that# accompanied this code).## You should have received a copy of the GNU General Public License version# 2 along with this work; if not, write to the Free Software Foundation,# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.## Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,# CA 95054 USA or visit www.sun.com if you need additional information or# have any questions.#BUILDDIR = ../..PACKAGE = sun.awt.X11LIBRARY = mawtLIBRARY_OUTPUT = xawtLIB_LOCATION = $(LIBDIR)/$(LIBARCH)/xawtPRODUCT = suninclude $(BUILDDIR)/common/Defs.gmkGEN_DIR=$(GENSRCDIR)/sun/awt/X11CLASSES_INIT += $(TEMPDIR)/.gen.wrappers $(TEMPDIR)/.gen_icons touch.wrappers.PHONY: generated.clean## Files#include FILES_c_unix.gmkinclude FILES_export_unix.gmkAUTO_FILES_JAVA_DIRS = sun/awt/X11AUTO_JAVA_PRUNE = WrapperGenerator.javaLDFLAGS += -L$(OPENWIN_LIB)ifeq ($(PLATFORM), linux)LDFLAGS += -lpthreaddummy := $(shell $(MKDIR) -p $(LIB_LOCATION))endif# Since this library will be living in a subdirectory below the other libraries# we need to add an extra runpath so that libraries in the upper directory# are found at runtime.LD_RUNPATH_EXTRAS = ..## Rules.#include $(BUILDDIR)/common/Mapfile-vers.gmkinclude $(BUILDDIR)/common/Library.gmk## Add to the ambient vpath to pick up files in subdirectories#vpath %.c $(SHARE_SRC)/native/sunawt/alphacompositevpath %.c $(PLATFORM_SRC)/native/sun/xawtvpath %.c $(PLATFORM_SRC)/native/sun/awtvpath %.c $(SHARE_SRC)/native/sun/awt/debugvpath %.c $(SHARE_SRC)/native/sun/awt/imagevpath %.c $(SHARE_SRC)/native/sun/awt/image/gifvpath %.c $(SHARE_SRC)/native/sun/awt/image/cvutilsvpath %.c $(SHARE_SRC)/native/sun/awt/shellvpath %.c $(SHARE_SRC)/native/sun/java2dvpath %.c $(SHARE_SRC)/native/sun/java2d/loopsvpath %.c $(SHARE_SRC)/native/sun/java2d/pipevpath %.c $(SHARE_SRC)/native/sun/awt/medialibvpath %.cpp $(SHARE_SRC)/native/sun/imagevpath %.c $(SHARE_SRC)/native/sun/fontvpath %.c $(PLATFORM_SRC)/native/sun/awt/robot_childvpath %.c $(SHARE_SRC)/native/sun/java2d/openglvpath %.c $(PLATFORM_SRC)/native/sun/java2d/openglvpath %.c $(PLATFORM_SRC)/native/sun/java2d/x11OTHER_LDLIBS = $(LIBM) -lawt -lXext -lX11 -ldl \ $(LDFLAGS_COMMON) $(AWT_RUNPATH) $(OTHER_LDFLAGS) -lXtst -lXiifeq ($(PLATFORM), solaris)CPPFLAGS += -DFUNCPROTO=15dummy := $(shell $(MKDIR) -p $(LIB_LOCATION))endifCPPFLAGS += -I$(CUPS_HEADERS_PATH)CPPFLAGS += -DXAWT -DXAWT_HACK \ -I$(TEMPDIR)/../../sun.awt/awt/CClassHeaders \ -I$(PLATFORM_SRC)/native/sun/awt \ -I$(PLATFORM_SRC)/native/sun/xawt \ -I$(PLATFORM_SRC)/native/sun/jdga \ -I$(SHARE_SRC)/native/sun/awt/debug \ -I$(SHARE_SRC)/native/sun/awt/image/cvutils \ -I$(SHARE_SRC)/native/sun/java2d \ -I$(SHARE_SRC)/native/sun/java2d/loops \ -I$(SHARE_SRC)/native/sun/awt/image/cvutils \ -I$(SHARE_SRC)/native/sun/awt/image \ -I$(SHARE_SRC)/native/sun/font \ -I$(PLATFORM_SRC)/native/sun/java2d \ -I$(SHARE_SRC)/native/sun/java2d/pipe \ -I$(SHARE_SRC)/native/sun/java2d/opengl \ -I$(PLATFORM_SRC)/native/sun/java2d/opengl \ -I$(PLATFORM_SRC)/native/sun/java2d/x11 \ -I$(SHARE_SRC)/native/sun/dc/path \ -I$(SHARE_SRC)/native/sun/dc/doe \ -I$(SHARE_SRC)/native/sun/awt/alphacomposite \ -I$(SHARE_SRC)/native/sun/awt/medialib \ -I$(PLATFORM_SRC)/native/sun/awt/medialib \ -I$(PLATFORM_SRC)/native/sun/font \ -I$(SHARE_SRC)/native/sun/awt \ -I$(PLATFORM_SRC)/native/sun/awt ifeq ($(PLATFORM), linux)# Allows for builds on Debian GNU Linux, X11 is in a different place CPPFLAGS += -I/usr/X11R6/include/X11/extensions \ -I/usr/include/X11/extensions \ -I$(OPENWIN_HOME)/include endififeq ($(PLATFORM), solaris) CPPFLAGS += -I$(OPENWIN_HOME)/include/X11/extensionsendififeq ($(MILESTONE), internal) CPPFLAGS += -DINTERNAL_BUILDendif## Generation of wrappers#SIZER_DIR=$(GEN_DIR)/generatorSIZER = $(SIZER_DIR)/sizerSIZER_32_C = $(SIZER).32.cSIZER_64_C = $(SIZER).64.cCFLAGS_32=$(CFLAGS)CFLAGS_64=$(CFLAGS)ifeq ($(PLATFORM), solaris)isalist:=$(shell $(ISAINFO))ifneq (,$(findstring sparcv9, $(isalist)))# On sparcv9 we generate both 32 and 64-bit sizers in spite of ARCH_DATA_MODEL.# On sparcv9 CFLAGS already contain $(XARCH_OPTION/64), so to generate 32-bit sizer we need to change this option.CFLAGS_32=$(subst $(XARCH_OPTION/64),$(XARCH_OPTION/32),$(CFLAGS))SIZERS = $(SIZER).32 $(SIZER).64SIZERS_C = $(SIZER_32_C) $(SIZER_64_C)SIZES = $(WRAPPER_GENERATOR_DIR)/sizes.32 $(WRAPPER_GENERATOR_DIR)/sizes.64CFLAGS_64=$(CFLAGS) $(XARCH_OPTION/64)elseifneq (,$(findstring amd64, $(isalist)))# On amd64 we generate both 32 and 64-bit sizers in spite of ARCH_DATA_MODEL.# On amd64 CFLAGS already contain $(XARCH_OPTION/64), so to generate 32-bit sizer we need to change this option.CFLAGS_32=$(subst $(XARCH_OPTION/64),$(XARCH_OPTION/32),$(CFLAGS))SIZERS = $(SIZER).32 $(SIZER).64SIZERS_C = $(SIZER_32_C) $(SIZER_64_C)SIZES = $(WRAPPER_GENERATOR_DIR)/sizes.32 $(WRAPPER_GENERATOR_DIR)/sizes.64CFLAGS_64=$(CFLAGS) $(XARCH_OPTION/64)else # !sparcv9 : includes (32-bit) sparc, i586SIZERS = $(SIZER).32SIZERS_C = $(SIZER_32_C)SIZES = $(WRAPPER_GENERATOR_DIR)/sizes.32endif # amd64endif # sparcv9else # !solarisifeq ($(ARCH_DATA_MODEL), 32)SIZERS = $(SIZER).32SIZERS_C = $(SIZER_32_C)SIZES = $(WRAPPER_GENERATOR_DIR)/sizes.32else # !32SIZERS = $(SIZER).64SIZERS_C = $(SIZER_64_C)SIZES = $(WRAPPER_GENERATOR_DIR)/sizes.64endif # 32endif # solaris# XXX Hack for 6185483 - use hard-coded sizes.# Add the 64-bit platforms that need to be included into 32-bit build# and have sizes.64-$(PLATFORM)-$(LIBARCH) hardcoded in the workspaceifeq ($(PLATFORM)-$(LIBARCH), solaris-i386)# If you define DOHACK=true for some combination of $(PLATFORM)-$(LIBARCH),# make sure you have sizes.64-$(PLATFORM)-$(LIBARCH) pre-generated in# $(PLATFORM_SRC)/classes/sun/awt/X11/generator/DOHACK=trueendif # Hackifeq ($(DOHACK), true)PREDEFINED_SIZES_TMPL=$(PLATFORM_SRC)/classes/sun/awt/X11/generator/sizes.64-$(PLATFORM)-$(LIBARCH)PREDEFINED_SIZES=$(WRAPPER_GENERATOR_DIR)/sizes.64SIZES += $(WRAPPER_GENERATOR_DIR)/sizes.64endififeq ($(PLATFORM)-$(LIBARCH), solaris-amd64)DOCOMPARE=trueendif# 64 bit sizers are generated on platform-libarch (left) for use # on platform-libarch (right) and stored under the latter name.# Do compare manually stored and automatically generated pair(s) # if DOCOMPARE=true, just after the generation.STORED_SIZES_TMPL_solaris_amd64=$(PLATFORM_SRC)/classes/sun/awt/X11/generator/sizes.64-solaris-i386WRAPPER_GENERATOR_JAVA=$(PLATFORM_SRC)/classes/sun/awt/X11/generator/WrapperGenerator.javaWRAPPER_GENERATOR_DIR=$(GENSRCDIR)/sun/awt/X11/generatorWRAPPER_GENERATOR_TEMPDIR=$(TEMPDIR)/sun/awt/X11/generatorWRAPPER_GENERATOR_CLASS=$(WRAPPER_GENERATOR_TEMPDIR)/WrapperGenerator.class XLIBTYPES=$(PLATFORM_SRC)/classes/sun/awt/X11/generator/xlibtypes.txt$(SIZERS): $(SIZERS_C) $(prep-target) $(CC) $(CFLAGS_$(subst .,,$(suffix $@))) $(CPPFLAGS) -o $@ $(SIZER)$(suffix $@).c$(WRAPPER_GENERATOR_CLASS): $(WRAPPER_GENERATOR_JAVA) $(prep-target) $(BOOT_JAVAC_CMD) -d $(WRAPPER_GENERATOR_TEMPDIR) $(WRAPPER_GENERATOR_JAVA)$(SIZERS_C): $(WRAPPER_GENERATOR_CLASS) $(XLIBTYPES) $(prep-target) $(MKDIR) -p $(WRAPPER_GENERATOR_TEMPDIR) $(BOOT_JAVA_CMD) -cp $(WRAPPER_GENERATOR_TEMPDIR) WrapperGenerator \ $(SIZER_DIR) $(XLIBTYPES) "sizer" $(subst .,,$(suffix $(basename $@)))$(SIZES): $(SIZERS) @if [ "$(DOHACK)$@" = "true$(PREDEFINED_SIZES)" ]; then \ $(ECHO) COPYING $(PREDEFINED_SIZES_TMPL) into $@; \ $(CP) $(PREDEFINED_SIZES_TMPL) $@; \ $(CHMOD) +w $@;\ else \ $(ECHO) GENERATING $@; \ $(WRAPPER_GENERATOR_DIR)/sizer$(suffix $@) > $@; \ fi @if [ "$(DOCOMPARE)$(suffix $@)" = "true.64" ]; then \ $(ECHO) COMPARING $@ and $(STORED_SIZES_TMPL_$(PLATFORM)_$(LIBARCH)); \ $(DIFF) $@ $(STORED_SIZES_TMPL_$(PLATFORM)_$(LIBARCH)); \ fi$(TEMPDIR)/.gen.wrappers: $(SIZES) $(WRAPPER_GENERATOR_CLASS) $(XLIBTYPES) $(BOOT_JAVA_CMD) -cp $(WRAPPER_GENERATOR_TEMPDIR) WrapperGenerator \ $(GEN_DIR) $(XLIBTYPES) "gen" $(WRAPPER_GENERATOR_DIR)/sizestouch.wrappers: $(TEMPDIR)/.gen.wrappers $(MKDIR) -p $(TEMPDIR) $(TOUCH) $(TEMPDIR)/.gen.wrappersgenerated.clean: $(RM) -r $(WRAPPER_GENERATOR_TEMPDIR) $(RM) -r $(WRAPPER_GENERATOR_DIR) $(RM) -r $(GEN_DIR)/*.java $(RM) -r $(TEMPDIR)/.gen_iconsifdef OPENJDK ICONS_PATH_PREFIX=$(PLATFORM_SRC)else ICONS_PATH_PREFIX=$(CLOSED_SRC)/solarisendifICONS = \ $(ICONS_PATH_PREFIX)/classes/sun/awt/X11/java-icon16.png \ $(ICONS_PATH_PREFIX)/classes/sun/awt/X11/java-icon24.png \ $(ICONS_PATH_PREFIX)/classes/sun/awt/X11/java-icon32.png \ $(ICONS_PATH_PREFIX)/classes/sun/awt/X11/java-icon48.pngTEMPDIR_CLASSES = $(TEMPDIR)/classes$(TEMPDIR_CLASSES)/sun/awt/X11/ToBin.class: ToBin.java @$(prep-target) $(BOOT_JAVAC_CMD) -d $(TEMPDIR_CLASSES) $<$(TEMPDIR)/.gen_icons: $(TEMPDIR_CLASSES)/sun/awt/X11/ToBin.class $(ICONS) $(prep-target) for i in $(ICONS); do \ filename=`basename $$i`; \ name=`$(ECHO) $$filename | $(TR) '\-.' '__'`; \ classname=$(GEN_DIR)/XAWTIcon32_$$name.java; \ $(RM) $$classname; \ $(ECHO) "package sun.awt.X11;" >> $$classname ; \ $(ECHO) "public class XAWTIcon32_$$name {" >> $$classname; \ $(ECHO) "public static int[] $$name = { " >> $$classname; \ $(CAT) $$i | \ $(BOOT_JAVA_CMD) -cp $(TEMPDIR_CLASSES) \ -Djava.awt.headless=true \ sun.awt.X11.ToBin >> $$classname; \ $(ECHO) "}; }" >> $$classname; \ classname=$(GEN_DIR)/XAWTIcon64_$$name.java; \ $(RM) $$classname; \ $(ECHO) "package sun.awt.X11;" >> $$classname ; \ $(ECHO) "public class XAWTIcon64_$$name {" >> $$classname; \ $(ECHO) "public static long[] $$name = { " >> $$classname; \ $(CAT) $$i | \ $(BOOT_JAVA_CMD) -cp $(TEMPDIR_CLASSES) \ -Djava.awt.headless=true \ sun.awt.X11.ToBin >> $$classname; \ $(ECHO) "}; }" >> $$classname; \ done $(TOUCH) $@clean clobber:: generated.clean.PHONY: generated.clean robot_child