trick/bin/mis_dep
Alex Lin 14a75508a3 Cleaning up once include variables and copyright cleanup.
Changed all header file once include variables to follow the same naming
convention and not start with any underscores.  Also deleted old
incorrect copyright notices.  Also removed $Id: tags from all files.

Fixes #14.  Fixes #22.
2015-03-23 16:03:14 -05:00

58 lines
1.4 KiB
Perl
Executable File
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#! /usr/bin/perl
#
# Usage: mis_dep <src file>
#
# Description: Given a source file, this program will find all library
# dependencies that this source file's object will depend on.
# The dependency tree is built using the library dependencies
# from the TRICK HEADERs in the source files. TRICK_CFLAGS
# are used to actually find all files in the dependency tree.
use lib $ENV{"TRICK_HOME"} . "/bin/pm" ;
use Cwd ;
use File::Basename ;
use strict ;
use mis_dep ;
my ($all_mis_depends, %rcs_tags) ;
my ($k , $a) ;
my @all_depends ;
my %temp_hash ;
my $wd ;
# prepend current dir name if none given
$wd = cwd() ;
foreach (@ARGV) {
$_ = $wd . "/" . $_ if ( !/^\// ) ;
}
$all_mis_depends = mis_dep(\%rcs_tags , @ARGV) ;
print "\n" ;
foreach $a ( sort keys %$all_mis_depends ) {
traverse_tree($a, 0, %{$$all_mis_depends{$a}} );
print "\n" ;
}
foreach $a ( sort keys %$all_mis_depends ) {
print "$a\n";
@all_depends = () ;
# push all depends for all files onto one array
foreach $k ( sort keys %{$$all_mis_depends{$a}} ) {
if ( $k ne "last_look" ) {
push @all_depends , @{$$all_mis_depends{$a}{$k}} ;
}
}
# remove duplicate elements
%temp_hash = {};
@all_depends = grep ++$temp_hash{$_} < 2, @all_depends ;
foreach $k ( sort @all_depends ) {
print " $k\n";
}
}