makeGoldenMipsy.pl
2.97 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
#!/usr/local/bin/perl
#
# Copyright (C) 1996-1998 by the Board of Trustees
# of Leland Stanford Junior University.
#
# This file is part of the SimOS distribution.
# See LICENSE file for terms of the license.
#
# mkg -- installs mipsy files in golden copy directory
#
# John Heinlein
# Stolen liberally from
# Joel Baxter
# This version is much lower-tech than Joel's version for flashlite.
# This script assumes you're already built in the standard simtools hierarchy.
# To modify, change the variables below & the code in the "set up" sections
# of the various make_golden subroutines. If the golden source directory
# locations change, more extensive changes in this script are required.
$simtools = "$ENV{SIMTOOLS}";
$golden_dir = "/roadkill/rk5/dash2/Golden/libraries";
# Check that the correct environment variables exist, and that the
# correct user is running this script.
&checkenv();
# Get the command line options.
$version = shift;
if ($version !~ /\d+\.\d+/) {
&Usage();
}
if (-e "$golden_dir/Mipsy/ver_$version") {
# fatal("Version $version already exists in $golden_dir/Mipsy");
}
print "Making version $version: $golden_dir/Mipsy/ver_$version...\n";
mkdir("$golden_dir/Mipsy/ver_$version",0755);
print "Copying 2levellib.a...\n";
system("cp", "$simtools/caches/2Level/SOLO/2levellib.a",
"$golden_dir/Mipsy/ver_$version");
print "Copying flashlitelib.a...\n";
system("cp", "$simtools/memsystems/flashlite/SOLO/flashlitelib.a",
"$golden_dir/Mipsy/ver_$version");
print "Copying memsysmisc.a...\n";
system("cp", "$simtools/memsystems/misc/SOLO/memsysmisc.a",
"$golden_dir/Mipsy/ver_$version");
print "Copying mipsylib.a...\n";
system("cp", "$simtools/cpus/mipsy/SOLO/mipsylib.a",
"$golden_dir/Mipsy/ver_$version");
print "Copying common.a...\n";
system("cp", "$simtools/common/SOLO/common.a",
"$golden_dir/Mipsy/ver_$version");
print "Copying tcl.a...\n";
system("cp", "$simtools/common/tcl/SOLO/tcl.a",
"$golden_dir/Mipsy/ver_$version");
print "Copying symbols.a...\n";
system("cp", "$simtools/common/symbols/SOLO/symbols.a",
"$golden_dir/Mipsy/ver_$version");
print "Copying stats.a...\n";
system("cp", "$simtools/common/stats/SOLO/stats.a",
"$golden_dir/Mipsy/ver_$version");
print "Copying solo.a...\n";
system("cp", "$simtools/solo/solo.a",
"$golden_dir/Mipsy/ver_$version");
print "Copying supportlib.a...\n";
system("cp", "$simtools/solo/supportlib.a",
"$golden_dir/Mipsy/ver_$version");
sub checkenv {
$< = $>;
$login = (getpwuid($>))[0] || "Who the hell are you?";
if ($login ne "dash2") {
&fatal("You need to be the user \"dash2\".");
}
if ($ENV{CPU} ne "SGI") {
&fatal("The only supported CPU type is \"SGI\".");
}
}
sub fatal {
local($message) = @_;
$!=1;die "$0: $message\n";
}
sub Usage {
print("\n");
print("usage: makeGoldenMipsy version\n");
print("\n");
print("\tversion is a version number to be attached to the mipsy libraries\n");
exit(0);
}