tools: more verbose information
authorJean-Sebastien Gelinas <calestar@gmail.com>
Tue, 23 Jun 2009 18:21:46 +0000 (14:21 -0400)
committerJean Privat <jean@pryen.org>
Fri, 26 Jun 2009 19:27:17 +0000 (15:27 -0400)
Signed-off-by: Jean-Sebastien Gelinas <calestar@gmail.com>
Signed-off-by: Jean Privat <jean@pryen.org>

bin/gccx
src/abstracttool.nit
src/compiling/compiling.nit
src/nitdoc.nit
src/syntax/syntax.nit

index 935c77a..5cafc01 100755 (executable)
--- a/bin/gccx
+++ b/bin/gccx
@@ -88,6 +88,13 @@ fi
 
 for i in "$@"; do
        j=`basename "$i" .c`
+       transformed=`echo "$i" | sed "
+               /\.nit_compile\/.*_sep\.c/s/\.nit_compile\/\(.*\)\._sep\.c/Module \1/
+               /\/nit_main\.c/s/.*\/nit_main\.c/Main/
+               /\.nit_compile\/.*\._tables\.c/s/.*/Tables/
+               /\/\/.*_nit\.c/s/.*\/\/\(.*\)_nit.c/Native \1/
+       "`
+
        found="false"
        # We remove starting # to be path independent (after preprocess, there are the only # remainings)
        cksum=`gcc -E $OPTS $i 2> /dev/null | grep -v "^#" | $CKSUM`
@@ -97,6 +104,9 @@ for i in "$@"; do
                if [ -f "$cksumfile" -a -f "$o" ]; then
                        cksumtry=`cat $cksumfile`
                        if [ "x$cksum" = "x$cksumtry" ]; then
+                               if [ $vverbose = true  ] ; then
+                                       echo "* $transformed up-to-date"
+                               fi
                                found=true
                                break
                        fi
@@ -106,6 +116,8 @@ for i in "$@"; do
                if [ $verbose = true  ] ; then
                        if [ $vverbose = true  ] ; then
                                echo "* $CC $OPTS -c $i -o $o" >&2
+                       else
+                               echo "* $transformed"
                        fi
                fi
                if $CC $OPTS -c $i -o $o; then
index e6a5dbf..cbf42ce 100644 (file)
@@ -60,6 +60,7 @@ special ToolContext
 
                var rest = option_context.rest
                var to_do = new Array[MMModule]
+               info("Syntax analysis",1)
                for i in [0..rest.length[ do
                        var mod = get_module_from_filename(rest[i])
                        to_do.add(mod)
index b731b1c..a713e15 100644 (file)
@@ -28,11 +28,14 @@ redef class MMSrcModule
        # Then execute the build.sh
        fun compile_prog_to_c(tc: ToolContext)
        do
+               tc.info("Building tables",1)
                for m in mhe.greaters_and_self do
                        assert m isa MMSrcModule
+                       tc.info("Building tables for module: {m.name}",2)
                        m.local_analysis(tc)
                end
 
+               tc.info("Merging all tables",2)
                var ga = global_analysis(tc)
 
                tc.compdir.mkdir
@@ -40,9 +43,11 @@ redef class MMSrcModule
                var files = new Array[String]
                var includes = new ArraySet[String]
                files.add("$CLIBDIR/nit_main.c")
+               tc.info("Generating C code",1)
                for m in mhe.greaters_and_self do
                        assert m isa MMSrcModule
                        files.add("{tc.compdir}/{m.name}._sep.c")
+                       tc.info("Generating C code for module: {m.name}",2)
                        m.compile_separate_module(tc, ga)
                        var native_name = m.filename.strip_extension(".nit")
                        if (native_name + "_nit.h").file_exists then
@@ -52,6 +57,7 @@ redef class MMSrcModule
                        if native_name.file_exists then files.add(native_name)
                end
 
+               tc.info("Generating main, tables and makefile ...",1)
                files.add("{tc.compdir}/{name}._tables.c")
                compile_main(tc, ga)
 
@@ -80,6 +86,7 @@ redef class MMSrcModule
                f.close
 
                if not tc.no_cc then 
+                       tc.info("Building",1)
                        sys.system("sh {fn}")
                end
        end
index 5434df0..17f5145 100644 (file)
@@ -58,7 +58,6 @@ special AbstractCompiler
        # Write the content to a new file
        fun write_to(filename: String)
        do
-               print "Generate {filename}"
                var f = new OFStream.open(filename)
                for s in _stage_context.content do
                        f.write(s)
@@ -96,6 +95,7 @@ special AbstractCompiler
        # Generate common files (frames, index, overview)
        fun extract_other_doc
        do
+               info("Generating other files",1)
                _module = null
                inside_mode = false
                intrude_mode = false
@@ -521,6 +521,7 @@ redef class MMSrcModule
        # Extract and generate html file for the module
        fun extract_module_doc(dctx: DocContext)
        do
+               dctx.info("Generating HTML for module {name}",1)
                dctx.register(self)
 
                dctx.clear
index 72989bd..e89e30d 100644 (file)
@@ -49,6 +49,7 @@ special ModuleLoader
        redef fun process_metamodel(context, module)
        do
                module.process_supermodules(context)
+               context.info("Syntax analysis for module: {module.name}", 2)
                module.process_syntax(context)
        end