X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/611d822b02f836d7abe031cced6adc4281ef4356..cdd4d20278cbee5a9f11f9f455bff8836410568c:/tools/doxygen/xbt_log_extract_hierarchy.pl diff --git a/tools/doxygen/xbt_log_extract_hierarchy.pl b/tools/doxygen/xbt_log_extract_hierarchy.pl index baa3b8d352..2a0d365de6 100755 --- a/tools/doxygen/xbt_log_extract_hierarchy.pl +++ b/tools/doxygen/xbt_log_extract_hierarchy.pl @@ -1,6 +1,6 @@ #!/usr/bin/env perl -# Copyright (c) 2008-2018. The SimGrid Team. +# Copyright (c) 2008-2019. The SimGrid Team. # All rights reserved. # This program is free software; you can redistribute it and/or modify it @@ -27,7 +27,7 @@ sub cleanup_ctn { my $ctn = shift; # cleanup the content of a macro call $ctn =~ s/^\s*(.*)\s*$/$1/gs; my @elms; - print "ctn=$ctn\n" if $debug > 1; + print STDERR "ctn=$ctn\n" if $debug > 1; if ($ctn =~ m/^(\w+)\s*,\s*(\w+)\s*,\s*"?([^"]*)"?$/s) { # Perfect, we got 0->name; 1->anc; 2->desc $elms[0] = $1; @@ -50,7 +50,7 @@ sub parse_file { my $data = ""; - print "Parse $filename\n" if $debug; + print STDERR "Parse $filename\n" if $debug; open IN, "$filename" || die "Cannot read $filename: $!\n"; while () { $data .= $_; @@ -72,17 +72,17 @@ sub parse_file { $ancestor{$name}=$anc; $desc{$name}=$desc; - print " $name -> $anc\n" if $debug; + print STDERR " $name -> $anc\n" if $debug; } } -# Retrieve all the file names, and add their content to $data -my $data; -open FILES, "find ../src/ ../tools/ ../include/ -name '*.c' -o -name '*.cpp' |" || die "Cannot search for the source file names: $!\n"; +# Retrieve all the file names +my $path = $ARGV[0] // ".."; +open FILES, "find $path/src/ $path/tools/ $path/include/ -name '*.c' -o -name '*.cpp' |" || die "Cannot search for the source file names: $!\n"; while (my $file=) { chomp $file; parse_file($file); } -parse_file("../include/xbt/sysdep.h"); +parse_file("$path/include/xbt/sysdep.h"); close FILES; # Display the tree, looking for disconnected elems