From 4bf9dd6ca362a4e5065b8edde8797257fc61b1b2 Mon Sep 17 00:00:00 2001 From: Zoltan Somogyi Date: Tue, 25 Jun 2019 14:22:53 +0200 Subject: [PATCH] Build more directories in stages 2 and 3. tools/bootcheck: Build the deep_profiler and mfilterjavac directories in stage 2. Build the slice, profiler, deep_profiler and mfilterjavac directories in stage 3. (We already used to build slice and profiler in stage 2.) Compare target language files in the stage 2 and stage 3 versions of the slice, profiler, deep_profiler and mfilterjavac directories, to make bootcheck a tougher test. This requires copying these directories to stage 3, instead of just linking them. Don't make dependencies in a directory if we had already done them earlier. mfilterjavac/Mmakefile: Add targets for building C# and Java files. slice/Mmakefile: Include the modules of the mcov and mtc_diff programs in the existing targets for building C, C# and Java files. deep_profiler/Mmakefile: profiler/Mmakefile: These makefiles already had targets for building C# and Java files. Fix grammar and/or indentation. compiler/Mmakefile: Fix grammar and/or indentation. --- compiler/Mmakefile | 6 +- deep_profiler/Mmakefile | 16 ++--- mfilterjavac/Mmakefile | 16 +++-- profiler/Mmakefile | 9 +-- slice/Mmakefile | 46 +++++++++--- tools/bootcheck | 153 +++++++++++++++++++++++++++++++++++----- 6 files changed, 194 insertions(+), 52 deletions(-) diff --git a/compiler/Mmakefile b/compiler/Mmakefile index 98b602806..578f31003 100644 --- a/compiler/Mmakefile +++ b/compiler/Mmakefile @@ -78,9 +78,9 @@ endif #-----------------------------------------------------------------------------# -# targets +# Targets. -# specify the name of the top-level module to build +# Specify the name of the top-level module to build. MC_PROG = mercury_compile # mercury_compile @@ -175,7 +175,7 @@ dates: #-----------------------------------------------------------------------------# -# Note that the cs and os targets don't build mercury_compile_init.{c,o} +# Note that the cs and os targets don't build mercury_compile_init.{c,o}. .PHONY: os cs css javas opts ifneq ($(MMAKE_USE_MMC_MAKE),yes) os: $($(MC_PROG).os) diff --git a/deep_profiler/Mmakefile b/deep_profiler/Mmakefile index 726f78aa3..30da771f2 100644 --- a/deep_profiler/Mmakefile +++ b/deep_profiler/Mmakefile @@ -1,5 +1,5 @@ #-----------------------------------------------------------------------------# -# vim: ts=8 sw=8 noexpandtab +# vim: ts=8 sw=8 noexpandtab ft=make #-----------------------------------------------------------------------------# # Copyright (C) 1995-2012 The University of Melbourne. # This file may only be copied under the terms of the GNU General @@ -26,12 +26,12 @@ C2INITFLAGS = --trace-init-file $(BROWSER_DIR)/$(BROWSER_LIB_NAME).init -include Mmake.deep.params -# Override the default rule in `mmake --use-mmc-make' that asks `mmc' to -# create a missing optional params file. +# Override the default rule in `mmake --use-mmc-make' that asks `mmc' +# to create a missing optional params file. Mmake.deep.params: -# Module-specific options should go in Mercury.options so they -# can be found by `mmc --make'. +# Module-specific options should go in Mercury.options so they can be found +# by `mmc --make'. include Mercury.options MAIN_TARGET = all @@ -114,9 +114,9 @@ depend: $(MDBCOMP_MODULES) $(DEPEND) $(DEPEND): DEEP_FLAGS $(MDBCOMP_MODULES) Mercury.modules -# This directory contains source files for which the module -# name doesn't match the file name, so smart recompilation -# won't work without the Mercury.modules file. +# This directory contains source files for which the module name +# does not match the file name, so smart recompilation won't work +# without the Mercury.modules file. .PHONY: Mercury.modules Mercury.modules: DEEP_FLAGS $(MC) $(ALL_GRADEFLAGS) $(ALL_MCFLAGS) -f *.m diff --git a/mfilterjavac/Mmakefile b/mfilterjavac/Mmakefile index 5e7e6369d..84730d033 100644 --- a/mfilterjavac/Mmakefile +++ b/mfilterjavac/Mmakefile @@ -1,5 +1,5 @@ #-----------------------------------------------------------------------------# -# vim: ts=8 sw=8 noexpandtab +# vim: ts=8 sw=8 noexpandtab ft=make #-----------------------------------------------------------------------------# # Copyright (C) 2013 The University of Melbourne. # This file may only be copied under the terms of the GNU General @@ -20,9 +20,9 @@ include $(MERCURY_DIR)/Mmake.common # create a missing optional params file. Mmake.mfilterjavac.params: -# Module-specific options should go in Mercury.options so they -# can be found by `mmc --make'. But this hasn't been used in this directory -# so it's commented out. +# Module-specific options should go in Mercury.options so they can be found +# by `mmc --make'. But this hasn't been used in this directory so far, +# so it is commented out. # include Mercury.options MAIN_TARGET = all @@ -78,7 +78,7 @@ mfilterjavac: $(RUNTIME_DIR)/lib$(RT_LIB_NAME).$A mfilterjavac: $(LIBRARY_DIR)/lib$(STD_LIB_NAME).$A endif -$(cs_subdir)mfilterjavac.c: $(UTIL_DIR)/mkinit$(EXT_FOR_EXE) +$(cs_subdir)mfilterjavac.c: $(UTIL_DIR)/mkinit$(EXT_FOR_EXE) #-----------------------------------------------------------------------------# @@ -121,9 +121,11 @@ dates: #-----------------------------------------------------------------------------# -.PHONY: os cs +.PHONY: os cs css javas os: $(mfilterjavac.os) $(os_subdir)mfilterjavac_init.o cs: $(mfilterjavac.cs) $(cs_subdir)mfilterjavac_init.c +css: $(mfilterjavac.css) +javas: $(mfilterjavac.javas) #-----------------------------------------------------------------------------# @@ -133,7 +135,7 @@ realclean_local: #-----------------------------------------------------------------------------# -# Installation target +# Installation target. # See the comment above the 'install_compiler' target in compiler/Mmakefile # for the reasons why we handle the java grade specially here. diff --git a/profiler/Mmakefile b/profiler/Mmakefile index f3e874138..ddb9547e3 100644 --- a/profiler/Mmakefile +++ b/profiler/Mmakefile @@ -1,5 +1,5 @@ #-----------------------------------------------------------------------------# -# vim: ts=8 sw=8 noexpandtab +# vim: ts=8 sw=8 noexpandtab ft=make #-----------------------------------------------------------------------------# # Copyright (C) 1995-2000, 2002-2003, 2005, 2007, 2009-2010, 2012 The University of Melbourne. # This file may only be copied under the terms of the GNU General @@ -12,8 +12,8 @@ MERCURY_DIR=.. LINK_STATIC=yes include $(MERCURY_DIR)/Mmake.common -# Module-specific options should go in Mercury.options so they -# can be found by `mmc --make'. +# Module-specific options should go in Mercury.options so they can be found +# by `mmc --make'. include Mercury.options MAIN_TARGET=all @@ -41,7 +41,8 @@ depend: mercury_profile.depend # it does not compile anymore. # # NOTE: if you add any programs here, you will need to modify the rule -# for dep_profiler_aux in ../Mmakefile. +# for dep_profiler_aux in ../Mmakefile, and the rules for os, cs, css and javas +# below. aux: demangle_test depend_aux: demangle_test.depend diff --git a/slice/Mmakefile b/slice/Mmakefile index e538ce4df..ad7bea30e 100644 --- a/slice/Mmakefile +++ b/slice/Mmakefile @@ -1,5 +1,5 @@ #-----------------------------------------------------------------------------# -# vim: ts=8 sw=8 noexpandtab +# vim: ts=8 sw=8 noexpandtab ft=make #-----------------------------------------------------------------------------# # Copyright (C) 2005-2007, 2009-2012 The University of Melbourne. # This file may only be copied under the terms of the GNU General @@ -16,7 +16,7 @@ include $(MERCURY_DIR)/Mmake.common # Override some settings from ../Mmake.workspace so that in debugging grades # we do not include mer_mdbcomp.init when creating the _init.c files in -# this directory. We copy the mdbcomp modules into this directory so if we +# this directory. We copy the mdbcomp modules into this directory so if we # do include mer_mdbcomp.init we will end up with duplicate entries in the # _init.c files. @@ -36,7 +36,8 @@ include Mercury.options MAIN_TARGET = all -# If you add more modules, you'll also have to modify ../Mmakefile. +# If you add more modules, you will also have to modify the os, cs, css +# and java targets below, as well as ../Mmakefile. MERCURY_MAIN_MODULES = mslice mdice mtc_union mcov mtc_diff DEPENDS = $(patsubst %,%.depend,$(MERCURY_MAIN_MODULES)) @@ -193,16 +194,39 @@ dates: #-----------------------------------------------------------------------------# .PHONY: os cs css javas -os: $(mslice.os) $(mdice.os) $(mtc_union.os) \ - $(os_subdir)mslice_init.o $(os_subdir)mdice_init.o \ - $(os_subdir)mtc_union.o $(os_subdir)mcov.o \ +os: $(mslice.os) \ + $(mdice.os) \ + $(mtc_union.os) \ + $(mcov.os) \ + $(mtc_diff.os) \ + $(os_subdir)mslice_init.o \ + $(os_subdir)mdice_init.o \ + $(os_subdir)mtc_union.o \ + $(os_subdir)mcov.o \ $(os_subdir)mtc_diff.o -cs: $(mslice.cs) $(mdice.cs) $(mtc_union.cs) \ - $(cs_subdir)mslice_init.c $(cs_subdir)mdice_init.c \ - $(cs_subdir)mtc_union.c $(cs_subdir)mcov.c \ + +cs: $(mslice.cs) \ + $(mdice.cs) \ + $(mtc_union.cs) \ + $(mcov.cs) \ + $(mtc_diff.cs) \ + $(cs_subdir)mslice_init.c \ + $(cs_subdir)mdice_init.c \ + $(cs_subdir)mtc_union.c \ + $(cs_subdir)mcov.c \ $(cs_subdir)mtc_diff.c -css: $(mslice.css) $(mdice.css) $(mtc_union.css) -javas: $(mslice.javas) $(mdice.javas) $(mtc_union.javas) + +css: $(mslice.css) \ + $(mdice.css) \ + $(mtc_union.css) \ + $(mcov.css) \ + $(mtc_diff.css) + +javas: $(mslice.javas) \ + $(mdice.javas) \ + $(mtc_union.javas) \ + $(mcov.javas) \ + $(mtc_diff.javas) #-----------------------------------------------------------------------------# diff --git a/tools/bootcheck b/tools/bootcheck index cc2fd51b0..9cd087fff 100755 --- a/tools/bootcheck +++ b/tools/bootcheck @@ -449,7 +449,7 @@ case "$grade" in ;; esac case $use_subdirs in - yes) + yes) cs_subdir=Mercury/cs/ css_subdir=Mercury/css/ javas_subdir=Mercury/javas/jmercury/ @@ -735,7 +735,7 @@ then if $copy_runtime then # Remove symbolic link to the stage 1 runtime - # if it's present, which it can be with the -2 option. + # if it is present, which it can be with the -2 option. rm -f runtime mkdir runtime cd runtime @@ -744,9 +744,8 @@ then $LN_S $root/runtime/*.cs . # We need to use $LN rather than $LN_S for the files # that get processed with Microsoft's tools, since - # Microsoft's tools don't understand Cygwin symbolic - # links (hard links are OK, Cygwin's ln just makes - # copies). + # Microsoft's tools don't understand Cygwin symbolic links + # (hard links are OK, Cygwin's ln just makes copies). rm -f mercury_conf*.h $LN $root/runtime/mercury_conf*.h . $LN_S $root/runtime/*.in . @@ -781,7 +780,7 @@ then if $copy_boehm_gc then # Remove symbolic link to the stage 1 gc - # if it's present, which it can be with the -2 option. + # if it is present, which it can be with the -2 option. rm -f boehm_gc mkdir boehm_gc cd boehm_gc @@ -1055,7 +1054,6 @@ then unset MMAKE_DIR && \ unset MERCURY_CONFIG_DIR && \ unset MERCURY_STDLIB_DIR && \ - mmake $mmake_opts depend && \ mmake $mmake_opts $jfactor all $ENVGRADE) then echo "building of stage 2 slice successful" @@ -1070,7 +1068,6 @@ then unset MMAKE_DIR && \ unset MERCURY_CONFIG_DIR && \ unset MERCURY_STDLIB_DIR && \ - mmake $mmake_opts depend depend_aux && \ mmake $mmake_opts $jfactor all aux $ENVGRADE) then echo "building of stage 2 profiler successful" @@ -1079,6 +1076,34 @@ then exit 1 fi + if (cd $stage2dir/deep_profiler && \ + unset MMAKE && \ + unset MMAKE_VPATH && \ + unset MMAKE_DIR && \ + unset MERCURY_CONFIG_DIR && \ + unset MERCURY_STDLIB_DIR && \ + mmake $mmake_opts $jfactor all $ENVGRADE) + then + echo "building of stage 2 deep profiler successful" + else + echo "building of stage 2 deep profiler not successful" + exit 1 + fi + + if (cd $stage2dir/mfilterjavac && \ + unset MMAKE && \ + unset MMAKE_VPATH && \ + unset MMAKE_DIR && \ + unset MERCURY_CONFIG_DIR && \ + unset MERCURY_STDLIB_DIR && \ + mmake $mmake_opts $jfactor all $ENVGRADE) + then + echo "building of stage 2 mfilterjavac successful" + else + echo "building of stage 2 mfilterjavac not successful" + exit 1 + fi + if (cd $stage2dir && \ $MMAKE $mmake_opts MMAKEFLAGS=$jfactor all $ENVGRADE) then @@ -1190,9 +1215,9 @@ then cd $root fi - # In the java grade replace the generated mercury_compile wrapper script - # will not set the CLASSPATH correctly when building stage 3. Replace it - # with one that will. + # In the java grade, the generated mercury_compile wrapper script + # will not set the CLASSPATH correctly when building stage 3. + # Replace it with one that will. # if test "$grade" = "java" then @@ -1303,7 +1328,6 @@ EOF cp $root/ssdb/.mgnu* . $LN_S $root/ssdb/$SSDB_LIB_NAME.init . cd $root/$stage3dir - cd $root/$stage3dir $LN_S $root/$stage2dir/boehm_gc . $LN_S $root/$stage2dir/java . $LN_S $root/bindist . @@ -1314,10 +1338,34 @@ EOF $LN_S $root/scripts . $LN_S $root/tools . $LN_S $root/util . - $LN_S $root/$stage2dir/slice . - $LN_S $root/$stage2dir/profiler . - $LN_S $root/$stage2dir/deep_profiler . - $LN_S $root/$stage2dir/mfilterjavac . + mkdir slice + cd slice + $LN_S $root/slice/*.m . + cp $root/slice/Mmake* $root/slice/Mercury.options . + cp $root/slice/*_FLAGS.in . + cp $root/slice/.mgnu* . + cd $root/$stage3dir + mkdir profiler + cd profiler + $LN_S $root/profiler/*.m . + cp $root/profiler/Mmake* $root/profiler/Mercury.options . + cp $root/profiler/*_FLAGS.in . + cp $root/profiler/.mgnu* . + cd $root/$stage3dir + mkdir deep_profiler + cd deep_profiler + $LN_S $root/deep_profiler/*.m . + cp $root/deep_profiler/Mmake* $root/deep_profiler/Mercury.options . + cp $root/deep_profiler/*_FLAGS.in . + cp $root/deep_profiler/.mgnu* . + cd $root/$stage3dir + mkdir mfilterjavac + cd mfilterjavac + $LN_S $root/mfilterjavac/*.m . + cp $root/mfilterjavac/Mmake* $root/mfilterjavac/Mercury.options . + cp $root/mfilterjavac/*_FLAGS.in . + cp $root/mfilterjavac/.mgnu* . + cd $root/$stage3dir $LN_S $root/conf* . $LN_S $root/aclocal.m4 . $LN_S $root/m4 . @@ -1354,8 +1402,17 @@ EOF cp /dev/null "$type_stats" fi - if (cd $stage3dir && $MMAKE $mmake_opts dep_library dep_mdbcomp \ - dep_browser_all dep_ssdb dep_compiler) + if (cd $stage3dir && \ + $MMAKE $mmake_opts \ + dep_library \ + dep_mdbcomp \ + dep_browser dep_browser_aux \ + dep_ssdb \ + dep_compiler \ + dep_slice \ + dep_profiler dep_profiler_aux \ + dep_deep_profiler \ + dep_mfilterjavac) then echo "building of stage 3 dependencies successful" else @@ -1472,6 +1529,62 @@ EOF fi fi + if (cd $stage3dir/slice && \ + unset MMAKE && \ + unset MMAKE_VPATH && \ + unset MMAKE_DIR && \ + unset MERCURY_CONFIG_DIR && \ + unset MERCURY_STDLIB_DIR && \ + mmake $mmake_opts $jfactor ${target_ext}s) + then + echo "building of stage 3 slice successful" + else + echo "building of stage 3 slice not successful" + exit 1 + fi + + if (cd $stage3dir/profiler && \ + unset MMAKE && \ + unset MMAKE_VPATH && \ + unset MMAKE_DIR && \ + unset MERCURY_CONFIG_DIR && \ + unset MERCURY_STDLIB_DIR && \ + mmake $mmake_opts $jfactor ${target_ext}s) + then + echo "building of stage 3 profiler successful" + else + echo "building of stage 3 profiler not successful" + exit 1 + fi + + if (cd $stage3dir/deep_profiler && \ + unset MMAKE && \ + unset MMAKE_VPATH && \ + unset MMAKE_DIR && \ + unset MERCURY_CONFIG_DIR && \ + unset MERCURY_STDLIB_DIR && \ + mmake $mmake_opts $jfactor ${target_ext}s) + then + echo "building of stage 3 deep profiler successful" + else + echo "building of stage 3 deep profiler not successful" + exit 1 + fi + + if (cd $stage3dir/mfilterjavac && \ + unset MMAKE && \ + unset MMAKE_VPATH && \ + unset MMAKE_DIR && \ + unset MERCURY_CONFIG_DIR && \ + unset MERCURY_STDLIB_DIR && \ + mmake $mmake_opts $jfactor ${target_ext}s) + then + echo "building of stage 3 mfilterjavac successful" + else + echo "building of stage 3 mfilterjavac not successful" + exit 1 + fi + if test "$type_stats" != "" then echo "Saving stage 3 stats in $type_stats.stage3.$$" @@ -1487,7 +1600,9 @@ EOF exec > "$outfile" # redirect stdout to $outfile fi - for dir in library mdbcomp browser ssdb compiler; do + for dir in library mdbcomp browser ssdb compiler \ + slice profiler deep_profiler mfilterjavac + do # `mmake cs' in the compiler directory doesn't build # `mercury_compile_init.c', so we only compare the `.c' # files present in the stage 3 directory.