1 ;# $Id: order.pl,v 3.0 1993/08/18 12:10:28 ram Exp $
3 ;# Copyright (c) 1991-1993, Raphael Manfredi
5 ;# You may redistribute only under the terms of the Artistic Licence,
6 ;# as specified in the README file that comes with the distribution.
7 ;# You may reuse parts of this distribution only within the terms of
8 ;# that same Artistic Licence; a copy of which may be found at the root
9 ;# of the source tree for dist 3.0.
12 ;# Revision 3.0 1993/08/18 12:10:28 ram
13 ;# Baseline for dist 3.0 netwide release.
16 ;# The @cmdwanted array records the output of the makefile (pick commands only).
17 ;# The shell commands are executed right away.
18 ;# @cmdwanted records the output of the make process (solving dependencies)
19 # Solve dependencies by saving the 'pick' command in @cmdwanted
20 sub solve_dependencies {
21 local(%unitseen); # Record already picked units (avoid duplicates)
22 print "Determining the correct order for the units...\n" unless $opt_s;
23 chdir('.MT') || die "Can't chdir to .MT: $!.\n";
24 open(MAKE, "make -n |") || die "Can't run make";
26 s|^\s+||; # Some make print tabs before command
27 print "\t$_" if $opt_v;
29 ($pick,$cmd,$symbol,$unit) = split(' ');
30 push(@cmdwanted,"$cmd $symbol $unit")
31 unless $unitseen{"$cmd:$unit"}++;
33 # Ignore conditional symbol request
39 chdir($WD) || die "Can't chdir to $WD: $!.\n";