jdk/make/tools/reorder/Makefile
author ohair
Wed, 06 Apr 2011 22:06:11 -0700
changeset 9035 1255eb81cc2f
parent 7967 aa85f513e8f2
child 12047 320a714614e9
permissions -rw-r--r--
7033660: Update copyright year to 2011 on any files changed in 2011 Reviewed-by: dholmes
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
#
9035
1255eb81cc2f 7033660: Update copyright year to 2011 on any files changed in 2011
ohair
parents: 7967
diff changeset
     2
# Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
2
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
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
     7
# published by the Free Software Foundation.  Oracle designates this
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
# particular file as subject to the "Classpath" exception as provided
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
     9
# by Oracle in the LICENSE file that accompanied this code.
2
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
#
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    21
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    22
# or visit www.oracle.com if you need additional information or have any
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    23
# questions.
2
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/java       LIBTMPDIR=java/java.lang/java     reorder.lib
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
	$(MAKE) LIBBLDDIR=java/nio        LIBTMPDIR=java/java.nio/nio       reorder.lib
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
	$(MAKE) LIBBLDDIR=sun/font        LIBTMPDIR=sun/sun.awt.font/fontmanager reorder.lib
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
	$(MAKE) LIBBLDDIR=sun/jpeg        LIBTMPDIR=sun/sun.awt/jpeg        reorder.lib
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
	$(MAKE) LIBBLDDIR=java/verify     LIBTMPDIR=java/verify             reorder.lib
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
libs.copy:
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
ifeq ($(PLATFORM), solaris)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
	$(CP) $(OUTDIR)/reorder_java_zip-$(ARCH) ../../java/zip/reorder-$(ARCH)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
	$(CP) $(OUTDIR)/reorder_java_java-$(ARCH) ../../java/java/reorder-$(ARCH)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
	$(CP) $(OUTDIR)/reorder_sun_font-$(ARCH) ../../sun/font/reorder-$(ARCH)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
	$(CP) $(OUTDIR)/reorder_sun_jpeg-$(ARCH) ../../sun/jpeg/reorder-$(ARCH)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
	$(CP) $(OUTDIR)/reorder_java_verify-$(ARCH) ../../java/verify/reorder-$(ARCH)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
REORDER_LIB = $(OUTDIR)/reorder_$(subst /,_,$(LIBBLDDIR))-$(ARCH)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
reorder.lib : $(OBJDIR) $(REORDER_LIB)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
# This target 'test_classes' also used by hotspot reordering.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
test_classes : $(TEST_CLASSES)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
# This target 'tool_classes' also used by hotspot reordering.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
tool_classes : $(CLASSDIR) $(CLASSDIR)/Combine.class $(CLASSDIR)/MaxTime.class
90ce3da70b43 Initial load
duke
parents:
diff changeset
   113
90ce3da70b43 Initial load
duke
parents:
diff changeset
   114
$(REORDER_JAR) : $(CLASSDIR) test_classes tool_classes
90ce3da70b43 Initial load
duke
parents:
diff changeset
   115
	$(RM) $(REORDER_JAR)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   116
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
	@$(ECHO) "# Ordered list of files to include in $(JARFILE)." > $(REORDER_JAR)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
	@$(ECHO) "# This is a generated file - do not edit."	    >> $(REORDER_JAR)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   119
	@$(ECHO) "#"						    >> $(REORDER_JAR)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
90ce3da70b43 Initial load
duke
parents:
diff changeset
   121
	@# Run each of a set of tests, extract the classes required and
90ce3da70b43 Initial load
duke
parents:
diff changeset
   122
	@# append the new classes to the ClassList.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   123
90ce3da70b43 Initial load
duke
parents:
diff changeset
   124
	@for f in $(TESTS) ; do						  \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   125
	    $(ECHO) Running test $$f.;					  \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
	    $(RM) $(REORDER_JAR)_tmp1;					  \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   127
	    echo "# Test $$f" >> $(REORDER_JAR);			  \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
	    $(JRE_JAVA) -verbose -classpath $(CLASSDIR) $$f |		  \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   129
	      $(SED) -n -e 's=\[Loaded \(.*\) from .*$(SEP)lib$(SEP)$(JARFILE)]=\1=p' | \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   130
	      $(SED) -e 's=\.=/=g' -e 's=$$=.class='			  \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   131
		 > $(REORDER_JAR)_tmp1;					  \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   132
	    $(JRE_JAVA) -classpath $(CLASSDIR) Combine			  \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   133
		$(REORDER_JAR) $(REORDER_JAR)_tmp1			  \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   134
		 > $(REORDER_JAR)_tmp2;					  \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   135
	    $(MV) $(REORDER_JAR)_tmp2 $(REORDER_JAR);			  \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   136
	    $(RM) $(REORDER_JAR)_tmp1;					  \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   137
	done
90ce3da70b43 Initial load
duke
parents:
diff changeset
   138
90ce3da70b43 Initial load
duke
parents:
diff changeset
   139
	@# Run SwingSet2, extract the classes required and
90ce3da70b43 Initial load
duke
parents:
diff changeset
   140
	@# append the new classes to the ClassList.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   141
90ce3da70b43 Initial load
duke
parents:
diff changeset
   142
	@$(RM) $(REORDER_JAR)_tmp1
90ce3da70b43 Initial load
duke
parents:
diff changeset
   143
	@$(RM) $(REORDER_JAR)_tmp2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   144
	@$(ECHO) "# SwingSet2" >> $(REORDER_JAR)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   145
90ce3da70b43 Initial load
duke
parents:
diff changeset
   146
	@$(ECHO) ""
90ce3da70b43 Initial load
duke
parents:
diff changeset
   147
	@$(ECHO) ""
90ce3da70b43 Initial load
duke
parents:
diff changeset
   148
	@$(ECHO) "When SwingSet2 has finished drawing, " \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   149
		 "you may terminate it (with your mouse)."
90ce3da70b43 Initial load
duke
parents:
diff changeset
   150
	@$(ECHO) "Otherwise, it should be automatically terminated in 2 minutes."
90ce3da70b43 Initial load
duke
parents:
diff changeset
   151
	@$(ECHO) ""
90ce3da70b43 Initial load
duke
parents:
diff changeset
   152
	@$(ECHO) ""
90ce3da70b43 Initial load
duke
parents:
diff changeset
   153
90ce3da70b43 Initial load
duke
parents:
diff changeset
   154
	$(JRE_JAVA) -verbose -classpath $(CLASSDIR) MaxTime $(SWINGSET2) 120 \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   155
		 > $(REORDER_JAR)_tmp2 
90ce3da70b43 Initial load
duke
parents:
diff changeset
   156
90ce3da70b43 Initial load
duke
parents:
diff changeset
   157
	$(SED) -n -e 's=\[Loaded \(.*\) from .*$(SEP)lib$(SEP)$(JARFILE)]=\1=p'	   \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   158
	    < $(REORDER_JAR)_tmp2 |					   \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   159
	$(SED) -e 's=\.=/=g' -e 's=$$=.class=' > $(REORDER_JAR)_tmp1
90ce3da70b43 Initial load
duke
parents:
diff changeset
   160
90ce3da70b43 Initial load
duke
parents:
diff changeset
   161
	$(RM) $(REORDER_JAR)_tmp2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   162
	$(JRE_JAVA) -classpath $(CLASSDIR) Combine			  \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   163
	    $(REORDER_JAR) $(REORDER_JAR)_tmp1 > $(REORDER_JAR)_tmp2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   164
	$(MV) $(REORDER_JAR)_tmp2 $(REORDER_JAR)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   165
	$(RM) $(REORDER_JAR)_tmp1
90ce3da70b43 Initial load
duke
parents:
diff changeset
   166
90ce3da70b43 Initial load
duke
parents:
diff changeset
   167
$(CLASSDIR) :
90ce3da70b43 Initial load
duke
parents:
diff changeset
   168
	$(MKDIR) -p $(CLASSDIR)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   169
90ce3da70b43 Initial load
duke
parents:
diff changeset
   170
$(CLASSDIR)/%.class : tools/%.java
90ce3da70b43 Initial load
duke
parents:
diff changeset
   171
	$(JAVAC_CMD) -d $(CLASSDIR) $<
90ce3da70b43 Initial load
duke
parents:
diff changeset
   172
$(CLASSDIR)/%.class : tests/%.java
90ce3da70b43 Initial load
duke
parents:
diff changeset
   173
	$(JAVAC_CMD) -d $(CLASSDIR) $<
90ce3da70b43 Initial load
duke
parents:
diff changeset
   174
90ce3da70b43 Initial load
duke
parents:
diff changeset
   175
$(OBJDIR) :
90ce3da70b43 Initial load
duke
parents:
diff changeset
   176
	$(MKDIR) -p $(OBJDIR)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   177
90ce3da70b43 Initial load
duke
parents:
diff changeset
   178
90ce3da70b43 Initial load
duke
parents:
diff changeset
   179
MCOUNT_SRC = mcount.c
90ce3da70b43 Initial load
duke
parents:
diff changeset
   180
MCOUNT_OBJ = $(MCOUNT_SRC:%.c=$(OBJDIR)/%.o)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   181
vpath %.c tools
90ce3da70b43 Initial load
duke
parents:
diff changeset
   182
90ce3da70b43 Initial load
duke
parents:
diff changeset
   183
$(OBJDIR)/%.o : %.c tools/util-$(ARCH).il
90ce3da70b43 Initial load
duke
parents:
diff changeset
   184
	$(COMPILE.c) $(CC_OBJECT_OUTPUT_FLAG)$@ $^
90ce3da70b43 Initial load
duke
parents:
diff changeset
   185
90ce3da70b43 Initial load
duke
parents:
diff changeset
   186
# This library 'libmcount.so' also used by hotspot reordering.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   187
$(OBJDIR)/libmcount.so : $(MCOUNT_OBJ)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   188
	$(CC) -G -mt -zdefs -o $@ $^ -ldl -lelf $(EXTRA_LIBS)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   189
90ce3da70b43 Initial load
duke
parents:
diff changeset
   190
# This library 'libmcount.so' also used by hotspot reordering.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   191
$(OBJDIR)/remove_mcount : remove_mcount.c
90ce3da70b43 Initial load
duke
parents:
diff changeset
   192
	$(CC) -g -o $@ $^ -ldl -lelf $(EXTRA_LIBS)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   193
90ce3da70b43 Initial load
duke
parents:
diff changeset
   194
90ce3da70b43 Initial load
duke
parents:
diff changeset
   195
# Reorder libraries.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   196
# + Delete all of the library's object files, and recompile them for profiling.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   197
# + Run the test sequence using libmcount to produce the mapfile.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   198
# + Delete all of the library's object files, and recompile them normally.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   199
90ce3da70b43 Initial load
duke
parents:
diff changeset
   200
$(REORDER_LIB): $(OBJDIR)/libmcount.so $(OBJDIR)/remove_mcount \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   201
		test_classes tool_classes
90ce3da70b43 Initial load
duke
parents:
diff changeset
   202
90ce3da70b43 Initial load
duke
parents:
diff changeset
   203
ifeq ($(ARCH), i586)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   204
	@# On Solaris-i586 we need to remove the symbol _mcount from the command
90ce3da70b43 Initial load
duke
parents:
diff changeset
   205
	$(OBJDIR)/remove_mcount $(BINDIR)/java
90ce3da70b43 Initial load
duke
parents:
diff changeset
   206
endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   207
90ce3da70b43 Initial load
duke
parents:
diff changeset
   208
	$(RM) $(OUTPUTDIR)/tmp/$(LIBTMPDIR)/$(OBJDIRNAME)/*.o
90ce3da70b43 Initial load
duke
parents:
diff changeset
   209
	$(CD) $(BUILDDIR)/$(LIBBLDDIR) ; \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   210
	  $(MAKE) PARTIAL_GPROF=true LDNOMAP=true NO_ROBOT=true all
90ce3da70b43 Initial load
duke
parents:
diff changeset
   211
90ce3da70b43 Initial load
duke
parents:
diff changeset
   212
	$(RM) $(REORDER_LIB)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   213
	@$(ECHO) "data = R0x2000;" > $(REORDER_LIB)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   214
	@$(ECHO) "text = LOAD ?RXO;" >> $(REORDER_LIB)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   215
90ce3da70b43 Initial load
duke
parents:
diff changeset
   216
	@# Run each of a set of tests, extract the classes required and
90ce3da70b43 Initial load
duke
parents:
diff changeset
   217
	@# append the new classes to the ClassList.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   218
90ce3da70b43 Initial load
duke
parents:
diff changeset
   219
	for f in $(TESTS) ; do						  \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   220
	    $(ECHO) Running test $$f.;					  \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   221
	    $(RM) $(REORDER_LIB)_tmp1;					  \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   222
	    $(ECHO) "# Test $$f" >> $(REORDER_LIB);			  \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   223
	    LD_PRELOAD=$(PRELOAD_DIR)/libmcount.so			  \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   224
	      $(SETENV)							  \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   225
	      $(JAVA_BIN) $(BOOTPATH) -classpath $(CLASSDIR) $$f 	  \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   226
		 2> $(REORDER_LIB)_tmp1;				  \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   227
	    $(SED) -n -e 's=[./]*$(OUTPUTDIR)=OUTPUTDIR=' -e '/^text:/p'  \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   228
		 $(REORDER_LIB)_tmp1 > $(REORDER_LIB)_tmp2;		  \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   229
	    $(SED) -e '/^text:/d' $(REORDER_LIB)_tmp1;	 		  \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   230
	    $(JRE_JAVA) -classpath $(CLASSDIR) Combine			  \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   231
		$(REORDER_LIB) $(REORDER_LIB)_tmp2			  \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   232
		 > $(REORDER_LIB)_tmp3;					  \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   233
	    $(MV) $(REORDER_LIB)_tmp3 $(REORDER_LIB);			  \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   234
	    $(RM) $(REORDER_LIB)_tmp2;					  \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   235
	    $(RM) $(REORDER_LIB)_tmp1;					  \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   236
	done
90ce3da70b43 Initial load
duke
parents:
diff changeset
   237
90ce3da70b43 Initial load
duke
parents:
diff changeset
   238
	@# Run SwingSet2, extract the classes required and
90ce3da70b43 Initial load
duke
parents:
diff changeset
   239
	@# append the new classes to the ClassList.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   240
90ce3da70b43 Initial load
duke
parents:
diff changeset
   241
	@$(RM) $(REORDER_LIB)_tmp1
90ce3da70b43 Initial load
duke
parents:
diff changeset
   242
	@$(RM) $(REORDER_JAR)_tmp2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   243
	@$(ECHO) "# SwingSet2" >> $(REORDER_LIB)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   244
90ce3da70b43 Initial load
duke
parents:
diff changeset
   245
	@$(ECHO) ""
90ce3da70b43 Initial load
duke
parents:
diff changeset
   246
	@$(ECHO) ""
90ce3da70b43 Initial load
duke
parents:
diff changeset
   247
	@$(ECHO) "When SwingSet2 has finished drawing, " \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   248
		 "you may terminate it (with your mouse)."
90ce3da70b43 Initial load
duke
parents:
diff changeset
   249
	@$(ECHO) "Otherwise, it should be automatically terminated in 2 minutes."
90ce3da70b43 Initial load
duke
parents:
diff changeset
   250
	@$(ECHO) ""
90ce3da70b43 Initial load
duke
parents:
diff changeset
   251
	@$(ECHO) ""
90ce3da70b43 Initial load
duke
parents:
diff changeset
   252
90ce3da70b43 Initial load
duke
parents:
diff changeset
   253
	LD_PRELOAD=$(PRELOAD_DIR)/libmcount.so				   \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   254
	  $(SETENV)							   \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   255
	  $(JAVA_BIN) $(BOOTPATH) -classpath $(CLASSDIR) MaxTime	   \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   256
		$(SWINGSET2) 120  2> $(REORDER_LIB)_tmp1
90ce3da70b43 Initial load
duke
parents:
diff changeset
   257
90ce3da70b43 Initial load
duke
parents:
diff changeset
   258
	$(SED) -n -e 's=[./]*$(OUTPUTDIR)=OUTPUTDIR=' -e '/^text:/p'	  \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   259
	    $(REORDER_LIB)_tmp1 > $(REORDER_LIB)_tmp2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   260
	$(SED) -e '/^text:/d' $(REORDER_LIB)_tmp1
90ce3da70b43 Initial load
duke
parents:
diff changeset
   261
	$(JRE_JAVA) -classpath $(CLASSDIR) Combine			  \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   262
	    $(REORDER_LIB) $(REORDER_LIB)_tmp2				  \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   263
	     > $(REORDER_LIB)_tmp3
90ce3da70b43 Initial load
duke
parents:
diff changeset
   264
	$(MV) $(REORDER_LIB)_tmp3 $(REORDER_LIB)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   265
	$(RM) $(REORDER_LIB)_tmp2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   266
	$(RM) $(REORDER_LIB)_tmp1
90ce3da70b43 Initial load
duke
parents:
diff changeset
   267
90ce3da70b43 Initial load
duke
parents:
diff changeset
   268
	$(RM) $(OUTPUTDIR)/tmp/$(LIBTMPDIR)/$(OBJDIRNAME)/*.o
90ce3da70b43 Initial load
duke
parents:
diff changeset
   269
	$(CD) $(BUILDDIR)/$(LIBBLDDIR) ; $(MAKE) all
90ce3da70b43 Initial load
duke
parents:
diff changeset
   270
90ce3da70b43 Initial load
duke
parents:
diff changeset
   271
.PHONY: test_classes tool_classes