1
0
mirror of https://github.com/golang/go synced 2024-11-22 00:14:42 -07:00

5l, 6l, 8l: accept only one object file

(package main; others are pulled in automatically)

R=ken2
CC=golang-dev
https://golang.org/cl/194069
This commit is contained in:
Russ Cox 2010-01-25 17:53:43 -08:00
parent dc061ffcbe
commit 3b1a0355b6
4 changed files with 13 additions and 15 deletions

View File

@ -80,7 +80,7 @@ linkername[] =
void
usage(void)
{
fprint(2, "usage: 5l [-options] objects\n");
fprint(2, "usage: 5l [-options] main.5\n");
errorexit();
}
@ -144,7 +144,7 @@ main(int argc, char *argv[])
USED(argc);
if(*argv == 0)
if(argc != 1)
usage();
libinit();
@ -258,8 +258,8 @@ main(int argc, char *argv[])
firstp = prg();
lastp = firstp;
while(*argv)
objfile(*argv++, "main");
objfile(argv[0], "main");
if(!debug['l'])
loadlib();

View File

@ -76,7 +76,7 @@ isobjfile(char *f)
void
usage(void)
{
fprint(2, "usage: 6l [-options] [-E entry] [-H head] [-L dir] [-T text] [-R rnd] [-o out] files...\n");
fprint(2, "usage: 6l [-options] [-E entry] [-H head] [-L dir] [-T text] [-R rnd] [-o out] main.6\n");
exits("usage");
}
@ -136,8 +136,8 @@ main(int argc, char *argv[])
readundefs(ARGF(), SIMPORT);
break;
} ARGEND
USED(argc);
if(*argv == 0)
if(argc != 1)
usage();
libinit();
@ -346,8 +346,7 @@ main(int argc, char *argv[])
firstp = prg();
lastp = firstp;
while(*argv)
objfile(*argv++, "main");
objfile(argv[0], "main");
if(!debug['l'])
loadlib();

View File

@ -81,7 +81,7 @@ isobjfile(char *f)
void
usage(void)
{
fprint(2, "usage: 8l [-options] [-E entry] [-H head] [-L dir] [-T text] [-R rnd] [-o out] files...\n");
fprint(2, "usage: 8l [-options] [-E entry] [-H head] [-L dir] [-T text] [-R rnd] [-o out] main.8\n");
exits("usage");
}
@ -142,8 +142,8 @@ main(int argc, char *argv[])
readundefs(ARGF(), SIMPORT);
break;
} ARGEND
USED(argc);
if(*argv == 0)
if(argc != 1)
usage();
mywhatsys(); // get goos
@ -384,8 +384,7 @@ main(int argc, char *argv[])
firstp = prg();
lastp = firstp;
while(*argv)
objfile(*argv++, "main");
objfile(argv[0], "main");
if(!debug['l'])
loadlib();

View File

@ -1,4 +1,4 @@
// $G $D/bug160.dir/x.go && $G $D/bug160.dir/y.go && $L y.$A x.$A && ./$A.out
// $G $D/bug160.dir/x.go && $G $D/bug160.dir/y.go && $L y.$A && ./$A.out
// Copyright 2009 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style