jdk/make/tools/reorder/Makefile
author tbell
Mon, 22 Sep 2008 22:37:31 -0700
changeset 1245 b23505b07d80
parent 2 90ce3da70b43
child 5506 202f599c92aa
permissions -rw-r--r--
Merge
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
     2
# Copyright 2000-2005 Sun Microsystems, Inc.  All Rights Reserved.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     3
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     4
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
     5
# This code is free software; you can redistribute it and/or modify it
90ce3da70b43 Initial load
duke
parents:
diff changeset
     6
# under the terms of the GNU General Public License version 2 only, as
90ce3da70b43 Initial load
duke
parents:
diff changeset
     7
# published by the Free Software Foundation.  Sun designates this
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
# particular file as subject to the "Classpath" exception as provided
90ce3da70b43 Initial load
duke
parents:
diff changeset
     9
# by Sun in the LICENSE file that accompanied this code.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    10
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    11
# This code is distributed in the hope that it will be useful, but WITHOUT
90ce3da70b43 Initial load
duke
parents:
diff changeset
    12
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    13
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
90ce3da70b43 Initial load
duke
parents:
diff changeset
    14
# version 2 for more details (a copy is included in the LICENSE file that
90ce3da70b43 Initial load
duke
parents:
diff changeset
    15
# accompanied this code).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    16
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    17
# You should have received a copy of the GNU General Public License version
90ce3da70b43 Initial load
duke
parents:
diff changeset
    18
# 2 along with this work; if not, write to the Free Software Foundation,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    19
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    20
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    21
# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    22
# CA 95054 USA or visit www.sun.com if you need additional information or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    23
# have any questions.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    24
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    25
90ce3da70b43 Initial load
duke
parents:
diff changeset
    26
# This Makefile is intended to produce new reordering files for the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
# reordering of jar files and shared libraries.  This is not part of the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
# standard build.  The objects produced by this Makefile must be copied
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
# into their standard locations and checked in.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
BUILDDIR = ../..
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
PACKAGE = tools.reorder
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
PRODUCT = tools
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
include $(BUILDDIR)/common/Defs.gmk
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
OUTDIR = $(OUTPUTDIR)/reorder
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
PRELOAD_DIR = $(ABS_OUTPUTDIR)/reorder/$(ARCH)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
ifeq ($(PLATFORM), windows)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
SEP = \\
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
else
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
SEP = /
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
CLASSDIR = $(OUTDIR)/classes
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
OBJDIR = $(OUTDIR)/$(ARCH)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
TESTS = Null Exit Hello Sleep IntToString \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
	LoadToolkit LoadFrame LoadJFrame JHello
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
TEST_CLASSES = $(TESTS:%=$(CLASSDIR)/%.class)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
SWINGSET2 = $(OUTPUTDIR)/demo/jfc/SwingSet2/SwingSet2.jar
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
# Run java from the JRE image because using rt.jar requires a
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
# larger list of classes, and these should appear in the list.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
#   FIXUP: adding rt.jar into bootclasspath?
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
JRE_LIB = $(JRE_IMAGE_DIR)/lib
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
BOOTPATH = -Xbootclasspath:$(JRE_LIB)/rt.jar:$(JRE_LIB)/charsets.jar
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
JRE_JAVA = $(JRE_IMAGE_DIR)/bin/java
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
JAVA_BIN = $(BINDIR)/java
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
all : jars.reorder libs.reorder
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
tools : $(OBJDIR) $(OBJDIR)/libmcount.so $(OBJDIR)/remove_mcount
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
copy : jars.copy libs.copy
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
clean : 
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
	$(RM) $(REORDER_JAR)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
clobber : clean
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
	$(RM) -r $(OUTDIR)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
jars.reorder :
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
	$(MAKE) JARFILE=rt.jar   reorder.jar
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
	$(MAKE) JARFILE=charsets.jar reorder.jar
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
jars.copy:
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
	$(CP) $(OUTDIR)/reorder_rt_jar-$(PLATFORM)    reorder_rt_jar-$(PLATFORM)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
	$(CP) $(OUTDIR)/reorder_charsets_jar-$(PLATFORM)  reorder_charsets_jar-$(PLATFORM)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
REORDER_JAR = $(OUTDIR)/reorder_$(subst .,_,$(JARFILE))-$(PLATFORM)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
reorder.jar : $(REORDER_JAR)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
libs.reorder :
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
ifeq ($(PLATFORM), solaris)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
	$(MAKE) LIBBLDDIR=java/zip        LIBTMPDIR=sun/java.util.zip/zip   reorder.lib
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
	$(MAKE) LIBBLDDIR=java/hpi/native LIBTMPDIR=java/hpi/native_threads reorder.lib
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
	$(MAKE) LIBBLDDIR=java/java       LIBTMPDIR=java/java.lang/java     reorder.lib
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
	$(MAKE) LIBBLDDIR=java/nio        LIBTMPDIR=java/java.nio/nio       reorder.lib
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
	$(MAKE) LIBBLDDIR=sun/font        LIBTMPDIR=sun/sun.awt.font/fontmanager reorder.lib
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
	$(MAKE) LIBBLDDIR=sun/jpeg        LIBTMPDIR=sun/sun.awt/jpeg        reorder.lib
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
	$(MAKE) LIBBLDDIR=java/verify     LIBTMPDIR=java/verify             reorder.lib
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
libs.copy:
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
ifeq ($(PLATFORM), solaris)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
	$(CP) $(OUTDIR)/reorder_java_zip-$(ARCH) ../../java/zip/reorder-$(ARCH)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
	$(CP) $(OUTDIR)/reorder_java_hpi_native-$(ARCH) ../../java/hpi/native/reorder-$(ARCH)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
	$(CP) $(OUTDIR)/reorder_java_java-$(ARCH) ../../java/java/reorder-$(ARCH)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
	$(CP) $(OUTDIR)/reorder_sun_font-$(ARCH) ../../sun/font/reorder-$(ARCH)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
	$(CP) $(OUTDIR)/reorder_sun_jpeg-$(ARCH) ../../sun/jpeg/reorder-$(ARCH)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
	$(CP) $(OUTDIR)/reorder_java_verify-$(ARCH) ../../java/verify/reorder-$(ARCH)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
REORDER_LIB = $(OUTDIR)/reorder_$(subst /,_,$(LIBBLDDIR))-$(ARCH)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
reorder.lib : $(OBJDIR) $(REORDER_LIB)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
# This target 'test_classes' also used by hotspot reordering.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
test_classes : $(TEST_CLASSES)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
90ce3da70b43 Initial load
duke
parents:
diff changeset
   113
# This target 'tool_classes' also used by hotspot reordering.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   114
tool_classes : $(CLASSDIR) $(CLASSDIR)/Combine.class $(CLASSDIR)/MaxTime.class
90ce3da70b43 Initial load
duke
parents:
diff changeset
   115
90ce3da70b43 Initial load
duke
parents:
diff changeset
   116
$(REORDER_JAR) : $(CLASSDIR) test_classes tool_classes
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
	$(RM) $(REORDER_JAR)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
90ce3da70b43 Initial load
duke
parents:
diff changeset
   119
	@$(ECHO) "# Ordered list of files to include in $(JARFILE)." > $(REORDER_JAR)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
	@$(ECHO) "# This is a generated file - do not edit."	    >> $(REORDER_JAR)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   121
	@$(ECHO) "#"						    >> $(REORDER_JAR)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   122
90ce3da70b43 Initial load
duke
parents:
diff changeset
   123
	@# Run each of a set of tests, extract the classes required and
90ce3da70b43 Initial load
duke
parents:
diff changeset
   124
	@# append the new classes to the ClassList.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   125
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
	@for f in $(TESTS) ; do						  \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   127
	    $(ECHO) Running test $$f.;					  \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
	    $(RM) $(REORDER_JAR)_tmp1;					  \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   129
	    echo "# Test $$f" >> $(REORDER_JAR);			  \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   130
	    $(JRE_JAVA) -verbose -classpath $(CLASSDIR) $$f |		  \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   131
	      $(SED) -n -e 's=\[Loaded \(.*\) from .*$(SEP)lib$(SEP)$(JARFILE)]=\1=p' | \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   132
	      $(SED) -e 's=\.=/=g' -e 's=$$=.class='			  \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   133
		 > $(REORDER_JAR)_tmp1;					  \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   134
	    $(JRE_JAVA) -classpath $(CLASSDIR) Combine			  \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   135
		$(REORDER_JAR) $(REORDER_JAR)_tmp1			  \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   136
		 > $(REORDER_JAR)_tmp2;					  \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   137
	    $(MV) $(REORDER_JAR)_tmp2 $(REORDER_JAR);			  \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   138
	    $(RM) $(REORDER_JAR)_tmp1;					  \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   139
	done
90ce3da70b43 Initial load
duke
parents:
diff changeset
   140
90ce3da70b43 Initial load
duke
parents:
diff changeset
   141
	@# Run SwingSet2, extract the classes required and
90ce3da70b43 Initial load
duke
parents:
diff changeset
   142
	@# append the new classes to the ClassList.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   143
90ce3da70b43 Initial load
duke
parents:
diff changeset
   144
	@$(RM) $(REORDER_JAR)_tmp1
90ce3da70b43 Initial load
duke
parents:
diff changeset
   145
	@$(RM) $(REORDER_JAR)_tmp2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   146
	@$(ECHO) "# SwingSet2" >> $(REORDER_JAR)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   147
90ce3da70b43 Initial load
duke
parents:
diff changeset
   148
	@$(ECHO) ""
90ce3da70b43 Initial load
duke
parents:
diff changeset
   149
	@$(ECHO) ""
90ce3da70b43 Initial load
duke
parents:
diff changeset
   150
	@$(ECHO) "When SwingSet2 has finished drawing, " \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   151
		 "you may terminate it (with your mouse)."
90ce3da70b43 Initial load
duke
parents:
diff changeset
   152
	@$(ECHO) "Otherwise, it should be automatically terminated in 2 minutes."
90ce3da70b43 Initial load
duke
parents:
diff changeset
   153
	@$(ECHO) ""
90ce3da70b43 Initial load
duke
parents:
diff changeset
   154
	@$(ECHO) ""
90ce3da70b43 Initial load
duke
parents:
diff changeset
   155
90ce3da70b43 Initial load
duke
parents:
diff changeset
   156
	$(JRE_JAVA) -verbose -classpath $(CLASSDIR) MaxTime $(SWINGSET2) 120 \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   157
		 > $(REORDER_JAR)_tmp2 
90ce3da70b43 Initial load
duke
parents:
diff changeset
   158
90ce3da70b43 Initial load
duke
parents:
diff changeset
   159
	$(SED) -n -e 's=\[Loaded \(.*\) from .*$(SEP)lib$(SEP)$(JARFILE)]=\1=p'	   \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   160
	    < $(REORDER_JAR)_tmp2 |					   \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   161
	$(SED) -e 's=\.=/=g' -e 's=$$=.class=' > $(REORDER_JAR)_tmp1
90ce3da70b43 Initial load
duke
parents:
diff changeset
   162
90ce3da70b43 Initial load
duke
parents:
diff changeset
   163
	$(RM) $(REORDER_JAR)_tmp2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   164
	$(JRE_JAVA) -classpath $(CLASSDIR) Combine			  \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   165
	    $(REORDER_JAR) $(REORDER_JAR)_tmp1 > $(REORDER_JAR)_tmp2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   166
	$(MV) $(REORDER_JAR)_tmp2 $(REORDER_JAR)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   167
	$(RM) $(REORDER_JAR)_tmp1
90ce3da70b43 Initial load
duke
parents:
diff changeset
   168
90ce3da70b43 Initial load
duke
parents:
diff changeset
   169
$(CLASSDIR) :
90ce3da70b43 Initial load
duke
parents:
diff changeset
   170
	$(MKDIR) -p $(CLASSDIR)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   171
90ce3da70b43 Initial load
duke
parents:
diff changeset
   172
$(CLASSDIR)/%.class : tools/%.java
90ce3da70b43 Initial load
duke
parents:
diff changeset
   173
	$(JAVAC_CMD) -d $(CLASSDIR) $<
90ce3da70b43 Initial load
duke
parents:
diff changeset
   174
$(CLASSDIR)/%.class : tests/%.java
90ce3da70b43 Initial load
duke
parents:
diff changeset
   175
	$(JAVAC_CMD) -d $(CLASSDIR) $<
90ce3da70b43 Initial load
duke
parents:
diff changeset
   176
90ce3da70b43 Initial load
duke
parents:
diff changeset
   177
$(OBJDIR) :
90ce3da70b43 Initial load
duke
parents:
diff changeset
   178
	$(MKDIR) -p $(OBJDIR)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   179
90ce3da70b43 Initial load
duke
parents:
diff changeset
   180
90ce3da70b43 Initial load
duke
parents:
diff changeset
   181
MCOUNT_SRC = mcount.c
90ce3da70b43 Initial load
duke
parents:
diff changeset
   182
MCOUNT_OBJ = $(MCOUNT_SRC:%.c=$(OBJDIR)/%.o)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   183
vpath %.c tools
90ce3da70b43 Initial load
duke
parents:
diff changeset
   184
90ce3da70b43 Initial load
duke
parents:
diff changeset
   185
$(OBJDIR)/%.o : %.c tools/util-$(ARCH).il
90ce3da70b43 Initial load
duke
parents:
diff changeset
   186
	$(COMPILE.c) $(CC_OBJECT_OUTPUT_FLAG)$@ $^
90ce3da70b43 Initial load
duke
parents:
diff changeset
   187
90ce3da70b43 Initial load
duke
parents:
diff changeset
   188
# This library 'libmcount.so' also used by hotspot reordering.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   189
$(OBJDIR)/libmcount.so : $(MCOUNT_OBJ)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   190
	$(CC) -G -mt -zdefs -o $@ $^ -ldl -lelf $(EXTRA_LIBS)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   191
90ce3da70b43 Initial load
duke
parents:
diff changeset
   192
# This library 'libmcount.so' also used by hotspot reordering.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   193
$(OBJDIR)/remove_mcount : remove_mcount.c
90ce3da70b43 Initial load
duke
parents:
diff changeset
   194
	$(CC) -g -o $@ $^ -ldl -lelf $(EXTRA_LIBS)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   195
90ce3da70b43 Initial load
duke
parents:
diff changeset
   196
90ce3da70b43 Initial load
duke
parents:
diff changeset
   197
# Reorder libraries.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   198
# + Delete all of the library's object files, and recompile them for profiling.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   199
# + Run the test sequence using libmcount to produce the mapfile.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   200
# + Delete all of the library's object files, and recompile them normally.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   201
90ce3da70b43 Initial load
duke
parents:
diff changeset
   202
$(REORDER_LIB): $(OBJDIR)/libmcount.so $(OBJDIR)/remove_mcount \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   203
		test_classes tool_classes
90ce3da70b43 Initial load
duke
parents:
diff changeset
   204
90ce3da70b43 Initial load
duke
parents:
diff changeset
   205
ifeq ($(ARCH), i586)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   206
	@# On Solaris-i586 we need to remove the symbol _mcount from the command
90ce3da70b43 Initial load
duke
parents:
diff changeset
   207
	$(OBJDIR)/remove_mcount $(BINDIR)/java
90ce3da70b43 Initial load
duke
parents:
diff changeset
   208
endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   209
90ce3da70b43 Initial load
duke
parents:
diff changeset
   210
	$(RM) $(OUTPUTDIR)/tmp/$(LIBTMPDIR)/$(OBJDIRNAME)/*.o
90ce3da70b43 Initial load
duke
parents:
diff changeset
   211
	$(CD) $(BUILDDIR)/$(LIBBLDDIR) ; \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   212
	  $(MAKE) PARTIAL_GPROF=true LDNOMAP=true NO_ROBOT=true all
90ce3da70b43 Initial load
duke
parents:
diff changeset
   213
90ce3da70b43 Initial load
duke
parents:
diff changeset
   214
	$(RM) $(REORDER_LIB)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   215
	@$(ECHO) "data = R0x2000;" > $(REORDER_LIB)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   216
	@$(ECHO) "text = LOAD ?RXO;" >> $(REORDER_LIB)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   217
90ce3da70b43 Initial load
duke
parents:
diff changeset
   218
	@# Run each of a set of tests, extract the classes required and
90ce3da70b43 Initial load
duke
parents:
diff changeset
   219
	@# append the new classes to the ClassList.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   220
90ce3da70b43 Initial load
duke
parents:
diff changeset
   221
	for f in $(TESTS) ; do						  \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   222
	    $(ECHO) Running test $$f.;					  \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   223
	    $(RM) $(REORDER_LIB)_tmp1;					  \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   224
	    $(ECHO) "# Test $$f" >> $(REORDER_LIB);			  \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   225
	    LD_PRELOAD=$(PRELOAD_DIR)/libmcount.so			  \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   226
	      $(SETENV)							  \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   227
	      $(JAVA_BIN) $(BOOTPATH) -classpath $(CLASSDIR) $$f 	  \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   228
		 2> $(REORDER_LIB)_tmp1;				  \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   229
	    $(SED) -n -e 's=[./]*$(OUTPUTDIR)=OUTPUTDIR=' -e '/^text:/p'  \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   230
		 $(REORDER_LIB)_tmp1 > $(REORDER_LIB)_tmp2;		  \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   231
	    $(SED) -e '/^text:/d' $(REORDER_LIB)_tmp1;	 		  \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   232
	    $(JRE_JAVA) -classpath $(CLASSDIR) Combine			  \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   233
		$(REORDER_LIB) $(REORDER_LIB)_tmp2			  \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   234
		 > $(REORDER_LIB)_tmp3;					  \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   235
	    $(MV) $(REORDER_LIB)_tmp3 $(REORDER_LIB);			  \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   236
	    $(RM) $(REORDER_LIB)_tmp2;					  \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   237
	    $(RM) $(REORDER_LIB)_tmp1;					  \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   238
	done
90ce3da70b43 Initial load
duke
parents:
diff changeset
   239
90ce3da70b43 Initial load
duke
parents:
diff changeset
   240
	@# Run SwingSet2, extract the classes required and
90ce3da70b43 Initial load
duke
parents:
diff changeset
   241
	@# append the new classes to the ClassList.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   242
90ce3da70b43 Initial load
duke
parents:
diff changeset
   243
	@$(RM) $(REORDER_LIB)_tmp1
90ce3da70b43 Initial load
duke
parents:
diff changeset
   244
	@$(RM) $(REORDER_JAR)_tmp2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   245
	@$(ECHO) "# SwingSet2" >> $(REORDER_LIB)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   246
90ce3da70b43 Initial load
duke
parents:
diff changeset
   247
	@$(ECHO) ""
90ce3da70b43 Initial load
duke
parents:
diff changeset
   248
	@$(ECHO) ""
90ce3da70b43 Initial load
duke
parents:
diff changeset
   249
	@$(ECHO) "When SwingSet2 has finished drawing, " \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   250
		 "you may terminate it (with your mouse)."
90ce3da70b43 Initial load
duke
parents:
diff changeset
   251
	@$(ECHO) "Otherwise, it should be automatically terminated in 2 minutes."
90ce3da70b43 Initial load
duke
parents:
diff changeset
   252
	@$(ECHO) ""
90ce3da70b43 Initial load
duke
parents:
diff changeset
   253
	@$(ECHO) ""
90ce3da70b43 Initial load
duke
parents:
diff changeset
   254
90ce3da70b43 Initial load
duke
parents:
diff changeset
   255
	LD_PRELOAD=$(PRELOAD_DIR)/libmcount.so				   \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   256
	  $(SETENV)							   \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   257
	  $(JAVA_BIN) $(BOOTPATH) -classpath $(CLASSDIR) MaxTime	   \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   258
		$(SWINGSET2) 120  2> $(REORDER_LIB)_tmp1
90ce3da70b43 Initial load
duke
parents:
diff changeset
   259
90ce3da70b43 Initial load
duke
parents:
diff changeset
   260
	$(SED) -n -e 's=[./]*$(OUTPUTDIR)=OUTPUTDIR=' -e '/^text:/p'	  \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   261
	    $(REORDER_LIB)_tmp1 > $(REORDER_LIB)_tmp2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   262
	$(SED) -e '/^text:/d' $(REORDER_LIB)_tmp1
90ce3da70b43 Initial load
duke
parents:
diff changeset
   263
	$(JRE_JAVA) -classpath $(CLASSDIR) Combine			  \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   264
	    $(REORDER_LIB) $(REORDER_LIB)_tmp2				  \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   265
	     > $(REORDER_LIB)_tmp3
90ce3da70b43 Initial load
duke
parents:
diff changeset
   266
	$(MV) $(REORDER_LIB)_tmp3 $(REORDER_LIB)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   267
	$(RM) $(REORDER_LIB)_tmp2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   268
	$(RM) $(REORDER_LIB)_tmp1
90ce3da70b43 Initial load
duke
parents:
diff changeset
   269
90ce3da70b43 Initial load
duke
parents:
diff changeset
   270
	$(RM) $(OUTPUTDIR)/tmp/$(LIBTMPDIR)/$(OBJDIRNAME)/*.o
90ce3da70b43 Initial load
duke
parents:
diff changeset
   271
	$(CD) $(BUILDDIR)/$(LIBBLDDIR) ; $(MAKE) all
90ce3da70b43 Initial load
duke
parents:
diff changeset
   272
90ce3da70b43 Initial load
duke
parents:
diff changeset
   273
.PHONY: test_classes tool_classes