mirror of
https://github.com/Mercury-Language/mercury.git
synced 2025-12-14 13:23:53 +00:00
Estimated hours taken: 12 Branches: main Remove most of the junk from the command lines executed by make when building the compiler and by bootcheck when building test cases. We do this by moving the junk into files consulted via the --flags option. After this change, it is actually possible to see in a glance not just which files are being compiled but also with which options. The size of the output (measured in bytes) from a bootcheck is now only about 40% of what is was before. configure.in: Remember the path to the bootstrap compiler and the flags it should be invoked with separately. Put the flags into the FLAGS files in various directories. Test whether the default install directory actually exists, so that the -L and -R linker options referring to this directory are passed to the C compiler only if it does. Mmake.common.in: Comment out a bunch of additions of MCFLAGS, the ones whose contents are now in FLAGS files. Conform to the changes in configure.in. Add a template rule for the dependencies of the FLAGS files. Mmake.workspace: Comment out a bunch of additions of MCFLAGS, the ones whose contents are now in FLAGS files. In some cases, add references to the FLAGS files. Mmakefile: When rebuilding Mmake.common, rebuild only Mmake.common, not all files created by configure. analysis/ANALYSIS_FLAGS.in: browser/MDB_FLAGS.in: compiler/COMP_FLAGS.in: deep_profiler/PROF_FLAGS.in: library/LIB_FLAGS.in: mdbcomp/MDBCOMP_FLAGS.in: profiler/DEEP_FLAGS.in: slice/SLICE_FLAGS.in: tests/TESTS_FLAGS.in: Add these files, which each contain the junk flags (the flags which are the same on every invocation and mostly just clutter up compiler command lines) that are needed on each compiler invocation in the relevant directory. Besides the results of configuration (word size etc), and the paths to other parts of the system, these files mostly control which warnings are enabled. Restrict the list of directories in -I options to what is sensible; for example, don't specify -I../analysis in the deep_profiler directory. */.nocopyright: Don't require copyright notices in FLAGS files, since that would make them invalid. library/INTER_FLAGS: Add this file, which contains the flags enabled with intermodule optimization. tests/WS_FLAGS.ws: Add this file. Unlike the .in files, which processed by config.status based on the results of autoconfiguration, this one is processed to specify the location of the workspace being tested. analysis/Mmakefile: browser/Mmakefile: compiler/Mmakefile: deep_profiler/Mmakefile: library/Mmakefile: mdbcomp/Mmakefile: profiler/Mmakefile: tests/Mmakefile: Include the relevant directory's FLAGS file on the command line, to replace all the additions to MCFLAGS in ../Mmake.common and in ../Mmake.workspace, and in some cases, the directory-specific Mmakefile itself. Build the directory's FLAGS file before executing the depend target, since most compiler options beyond --generate-dependencies come from there. Delete the FLAGS files generated by config.status when doing "make clean". tests/Mmakefile: Allow the environment to define DIFF_OPTS. runtime/Mmakefile: Use an option to tell config.status what to rebuild, not some environment variables. tests/invalid/Mercury.options: For two test cases, reset an option that is set in tests/WS_FLAGS, to match the options the affected tests were compiled with before. tests/invalid/*.err2: Update these expected files to account for the use of error_util in error messages by previous changes to the compiler. These expected output files are used only with --use-subdirs. tests/warnings/Mmakefile: For all test cases, reset an option that is set in tests/WS_FLAGS, to match the options the tests were compiled with before. scripts/prepare_tmp_dir_grade_part Copy the flags files when creating the subdirectories of tmp_dir. scripts/mgnuc.in: Provide a mechanism, a per-directory .mgnuc_opts file, for specifying the options that are required for every C file in a directory. The intention is to use this for -I../library etc, but this is not done yet; one thing at a time. tools/bootcheck: Copy the FLAGS files when creating stage2 and stage3. Don't specify the compiler options that are now in FLAGS files. Fill in the location of the workspace in tests/WS_FLAGS before running the tests. Provide a mechanism (a file ~/.bootcheck_diff_opts) to allow the user to specify what options to invoke diff with. Move the setting of MMAKE_USE_SUBDIRS and MMAKE_USE_MMC_MAKE after we have built stage1, and always copy the profilers if --use-subdirs is set. The old ways of doing things caused problems if bootcheck was given --use-subdirs but stage1 doesn't use subdirs: the bootcheck modified the stage1 slice, profiler and deep_profiler directories.
55 lines
1.9 KiB
Bash
Executable File
55 lines
1.9 KiB
Bash
Executable File
#!/bin/sh
|
|
#---------------------------------------------------------------------------#
|
|
# Copyright (C) 2005 The University of Melbourne.
|
|
# This file may only be copied under the terms of the GNU General
|
|
# Public License - see the file COPYING in the Mercury distribution.
|
|
#---------------------------------------------------------------------------#
|
|
|
|
rm -fr tmp_dir/boehm_gc
|
|
rm -fr tmp_dir/runtime
|
|
rm -fr tmp_dir/trace
|
|
rm -fr tmp_dir/library
|
|
rm -fr tmp_dir/mdbcomp
|
|
rm -fr tmp_dir/browser
|
|
mkdir tmp_dir/boehm_gc
|
|
mkdir tmp_dir/boehm_gc/Mac_files
|
|
mkdir tmp_dir/boehm_gc/cord
|
|
mkdir tmp_dir/boehm_gc/include
|
|
mkdir tmp_dir/boehm_gc/include/private
|
|
cp boehm_gc/Makefile* tmp_dir/boehm_gc
|
|
cp boehm_gc/Mmake* tmp_dir/boehm_gc
|
|
cp boehm_gc/ac* tmp_dir/boehm_gc
|
|
cp boehm_gc/*.[chsS] tmp_dir/boehm_gc
|
|
cp boehm_gc/Mac_files/*.[ch] tmp_dir/boehm_gc/Mac_files
|
|
cp boehm_gc/cord/*.[ch] tmp_dir/boehm_gc/cord
|
|
cp boehm_gc/include/*.[ch] tmp_dir/boehm_gc/include
|
|
cp boehm_gc/include/private/*.[ch] tmp_dir/boehm_gc/include/private
|
|
mkdir tmp_dir/runtime
|
|
mkdir tmp_dir/runtime/machdeps
|
|
cp runtime/Mmake* tmp_dir/runtime
|
|
cp runtime/*.in tmp_dir/runtime
|
|
cp runtime/*.[ch] tmp_dir/runtime
|
|
cp runtime/*.il tmp_dir/runtime
|
|
cp runtime/machdeps/*.h tmp_dir/runtime/machdeps
|
|
mkdir tmp_dir/trace
|
|
cp trace/Mmake* tmp_dir/trace
|
|
cp trace/*.[ch] tmp_dir/trace
|
|
mkdir tmp_dir/library
|
|
cp library/Mmake* tmp_dir/library
|
|
cp library/Mercury.* tmp_dir/library
|
|
cp library/*FLAGS* tmp_dir/library
|
|
cp library/print_extra_inits tmp_dir/library
|
|
cp library/library_strong_name.sn tmp_dir/library
|
|
cp library/*.m tmp_dir/library
|
|
mkdir tmp_dir/mdbcomp
|
|
cp mdbcomp/Mmake* tmp_dir/mdbcomp
|
|
cp mdbcomp/Mercury.* tmp_dir/mdbcomp
|
|
cp mdbcomp/*FLAGS* tmp_dir/mdbcomp
|
|
cp mdbcomp/*.m tmp_dir/mdbcomp
|
|
mkdir tmp_dir/browser
|
|
cp browser/Mmake* tmp_dir/browser
|
|
cp browser/Mercury.* tmp_dir/browser
|
|
cp browser/*FLAGS* tmp_dir/browser
|
|
cp browser/*.m tmp_dir/browser
|
|
exit 0
|