From 7d0c5ef77395a44a316bb822170543b533db239c Mon Sep 17 00:00:00 2001 From: Mohammad Akhlaghi Date: Sat, 29 Feb 2020 21:26:54 +0000 Subject: IMPORTANT: re-preparation can only be done with --prepare-redo Until now, the preparation phase was always executed before the final build phase when running `./project make'. But when it becomes necessary, project preparation can be slow and will un-necessarily slow down the project while the project is growing (focus is on the analysis that is done after preparation). With this commit, preparation will be done automatically the first time that the project is run (`.build/software/preparation-done.mk' doesn't exist). However, after preperation is complete once, future runs of `./project make' won't do preparation any more (by calling `top-prepare.mk'). They will directly call `top-make.mk' for the analysis. To manually invoke preparation after the first attempt, the `./project make' script should be run with the new `--prepare-redo' option. Also, since the preparation phase is now automatically done before the analysis phase, the long notice that describes running `./project make' at the end of the preparation phase has been removed in `top-prepare.mk'. It now just prints a short line, saying the preparation has been complete. Finally, when the project has not been run with the proper group configuration, it ends with an `exit 1' so the main `./project' script doesn't proceed any further. --- project | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) (limited to 'project') diff --git a/project b/project index 3241ede..e2d4c66 100755 --- a/project +++ b/project @@ -37,6 +37,7 @@ check_config= make_targets= software_dir= clean_texdir=0 +prepare_redo=0 existing_conf=0 scriptname="./project" minmapsize=10000000000 @@ -108,6 +109,7 @@ Configure and Make options: Make options: -d, --debug=FLAGS Print various types of debugging information. + -p, --prepare-redo Re-do preparation (only done automatically once). Mandatory or optional arguments to long options are also mandatory or optional for any corresponding short options. @@ -184,12 +186,17 @@ do -'?'|--help) print_help; exit 0;; -'?'*|--help=*) on_off_option_error --help -?;; - # Make options (note that Make's `debug' can take values, but when called - # without any value, it is like giving it a value of `a'): + # Make options + # ------------ + # + # Note that Make's `debug' can take values, but when called without any + # value, it is like giving it a value of `a'): -d|--debug) if [ x"$2" = x ]; then debug=a; shift; else debug="$2"; check_v debug "$debug"; shift;shift; fi;; -d=*|--debug=*) debug="${1#*=}"; check_v debug "$debug"; shift;; -d*) debug=$(echo "$1" | sed -e's/-d//'); check_v debug "$debug"; shift;; + -p|--prepare-redo) prepare_redo=1; shift;; + -p=*|--prepare-redo=*) on_off_option_error --prepare-redo; shift;; # Unrecognized option: -*) echo "$scriptname: unknown option '$1'"; exit 1;; @@ -386,9 +393,16 @@ EOF exit 1 fi - # Run input-preparations (optionally build Makefiles with special - # values for optimizing the main `top-make.mk'). - controlled_env reproduce/analysis/make/top-prepare.mk + # Run data preparation phase (optionally build Makefiles with + # special values for optimizing the main `top-make.mk'). But note + # that data preparation is only done automatically the first time + # the project is built (when `.build/software/preparation-done.mk' + # doesn't yet exist). After that, if the user wants to re-do the + # preparation they have to use the `--prepare-redo' option. + if ! [ -f .build/software/preparation-done.mk ] \ + || [ x"$prepare_redo" = x1 ]; then + controlled_env reproduce/analysis/make/top-prepare.mk + fi # Run the actual project. controlled_env reproduce/analysis/make/top-make.mk -- cgit v1.2.1