diff --git a/usr.bin/whereis/makefile.mk b/usr.bin/whereis/makefile.mk index 206af58..3676a71 100644 --- a/usr.bin/whereis/makefile.mk +++ b/usr.bin/whereis/makefile.mk @@ -1,15 +1,28 @@ -# makefile.mk generated by makedmake v0.22 (Gno v1.1) +# Makefile.mk generated by makedmake (Gno) v1.1.1 for Dennis Vadura's dmake -# development flags: Undefine __GNO__ to get a more Orca compatible version. -# CFLAGS = -i -w -s1023 -G25 -DDEBUG -DCASEFLAG -D__GNO__ -# LDLIBS = /usr/lib/stack.a -# LDFLAGS = +BINDIR = 17 +MANDIR = /usr/man -# distribution flags: Undefine __GNO__ to get a more Orca compatible version. -CFLAGS = -i -w -s1023 -O -DCASEFLAG -D__GNO__ -LDLIBS = -LDFLAGS = +# development flags +# DEFINES += -DDEBUG -DCASEFLAG +# CFLAGS += -w -s1023 -G25 $(DEFINES) +# LDFLAGS += +# LDLIBS = /usr/lib/stack.a +# distribution flags +DEFINES += -DCASEFLAG +CFLAGS += -w -s1023 -O $(DEFINES) +LDFLAGS += +LDLIBS = + +all: + echo Targets ... + echo + echo dmake install ... to copy executable file to $(BINDIR) and manual + echo page to $(MANDIR) + echo + echo dmake whereis ... to compile source code. This should not be + echo necessary. whereis : whereis.o $(CC) $(LDFLAGS) -o whereis whereis.o $(LDLIBS) @@ -18,6 +31,9 @@ whereis.o : whereis.c $(CC) $(CFLAGS) -c whereis.c install : - /bin/cp -f Gno/whereis /usr/bin - /bin/cp -f Orca/whereis 17 - /bin/cp -f whereis.1 /usr/man/man1 + -$(RM) /usr/bin/whereis + -$(RM) 17/whereis + /bin/cp -f whereis $(BINDIR) + /bin/cp -f whereis.1 $(MANDIR)/man1 + +.SILENT: all diff --git a/usr.bin/whereis/whereis.c b/usr.bin/whereis/whereis.c index dc07f1b..76445da 100644 --- a/usr.bin/whereis/whereis.c +++ b/usr.bin/whereis/whereis.c @@ -52,9 +52,21 @@ static char sccsid[] = "@(#)whereis.c 5.5 (Berkeley) 4/18/91"; #include #include #include +#include -#ifdef __GNO__ /* define this to use pathnames _without_ the leading 31/ */ -static char *bindirs[] = { +/* + * Pointers that will correspond to the GNO_* or ORCA_* structs, below + */ + +static char **bindirs; +static char **mandirs; +static char **srcdirs; + +/* + * These are the directories to check when running under the Gno shell + */ + +static char *GNO_bindirs[] = { "/bin", "/usr/bin", "/usr/sbin", @@ -68,7 +80,7 @@ static char *bindirs[] = { 0 }; /* This needs to be redone - man pages live with sources */ -static char *mandirs[] = { +static char *GNO_mandirs[] = { /* These are disabled since /man is not usually present; this eliminates @@ -111,16 +123,18 @@ static char *mandirs[] = { "17/help", 0 }; -static char *srcdirs[] = { +static char *GNO_srcdirs[] = { "/usr/src/bin", "/usr/src/etc", /* still need libs */ 0 }; -#else /* not __GNO__ */ +/* + * These are the directories to check when running under the Orca shell + */ -static char *bindirs[] = { +static char *ORCA_bindirs[] = { "31/bin", "31/usr/bin", "31/usr/sbin", @@ -134,7 +148,7 @@ static char *bindirs[] = { 0 }; /* This needs to be redone - man pages live with sources */ -static char *mandirs[] = { +static char *ORCA_mandirs[] = { /* These are disabled since /man is not usually present; this eliminates @@ -177,14 +191,13 @@ static char *mandirs[] = { "17/help", 0 }; -static char *srcdirs[] = { +static char *ORCA_srcdirs[] = { "31/usr/src/bin", "31/usr/src/etc", /* still need libs */ 0 }; -#endif /* not __GNO__ */ #ifdef CASEFLAG int cflag = 0; @@ -201,11 +214,7 @@ char **Mflag; int Mcnt; char uflag; -#ifdef __GNO__ -char *verstring = "whereis -- Gno/ME Version 1.1"; -#else -char *verstring = "whereis -- Orca Version 1.1"; -#endif +char *verstring = "whereis -- Apple IIgs Version 1.2"; void getlist (int *argcp, char ***argvp, char ***flagp, int *cntp); void zerof(void); @@ -251,6 +260,18 @@ usage: exit(1); } + + /* select which directory structures we're going to use */ + if (needsgno()) { + bindirs = GNO_bindirs; + mandirs = GNO_mandirs; + srcdirs = GNO_srcdirs; + } else { + bindirs = ORCA_bindirs; + mandirs = ORCA_mandirs; + srcdirs = ORCA_srcdirs; + } + do if (argv[0][0] == '-') { register char *cp = argv[0] + 1;