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`
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
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
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)
# 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
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
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)
f.close
if not tc.no_cc then
+ tc.info("Building",1)
sys.system("sh {fn}")
end
end
# 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)
# Generate common files (frames, index, overview)
fun extract_other_doc
do
+ info("Generating other files",1)
_module = null
inside_mode = false
intrude_mode = false
# 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
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