From owner-freebsd-hackers Sat Jul 13 20:18:57 1996 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id UAA29464 for hackers-outgoing; Sat, 13 Jul 1996 20:18:57 -0700 (PDT) Received: from godzilla.zeta.org.au (godzilla.zeta.org.au [203.2.228.19]) by freefall.freebsd.org (8.7.5/8.7.3) with SMTP id UAA29425 for ; Sat, 13 Jul 1996 20:18:34 -0700 (PDT) Received: (from bde@localhost) by godzilla.zeta.org.au (8.6.12/8.6.9) id NAA11262; Sun, 14 Jul 1996 13:08:48 +1000 Date: Sun, 14 Jul 1996 13:08:48 +1000 From: Bruce Evans Message-Id: <199607140308.NAA11262@godzilla.zeta.org.au> To: bde@zeta.org.au, mark@linus.demon.co.uk, pst@freefall.freebsd.org Subject: Re: cvs commit: src/share/mk bsd.obj.mk Cc: hackers@freebsd.org Sender: owner-hackers@freebsd.org X-Loop: FreeBSD.org Precedence: bulk >> > Modified: share/mk bsd.obj.mk >> > Log: >> > Add whereobj target to find that pesky obj dir BTW, this doesn't actually work. There are a couple of errors in the sh command. >> I still think that this is important enough to justify builtin support. >> E.g., `make -P variable' could print make's idea of the value of `variable'. >> Then `make -P .OBJDIR' would show where the obj dir is. >Yes! I'd been puzzling over a way to do this which wasn't a special purpose >hack. So, here's an implementation (the man page patch also includes a small >bug fix for the description of the -D option). -P was (sort of) taken, so I >used -V. >(This patch is against -current's make; I actually compiled and lightly tested >a variant of this - against a slightly older make [prior to jkh's changes].) Thanks for the implementation. I can hardly object to it :-). I will commit it in a day or two if there are no problems. Here are some fixes for new and old bugs in the options processing and synopsis printing (and one hunk of whitespace changes). The missing colon on D: is most important. === *** make.1~~ Sun Jul 14 11:44:30 1996 --- make.1 Sun Jul 14 12:07:47 1996 *************** *** 40,44 **** .Sh SYNOPSIS .Nm make ! .Op Fl eiknqrstv .Op Fl D Ar variable .Op Fl d Ar flags --- 40,44 ---- .Sh SYNOPSIS .Nm make ! .Op Fl eiknqrst .Op Fl D Ar variable .Op Fl d Ar flags *** main.c~~ Sun Jul 14 11:44:30 1996 --- main.c Sun Jul 14 12:12:02 1996 *************** *** 158,162 **** # define OPTFLAGS "BD:I:L:PSVd:ef:ij:knqrst" #else ! # define OPTFLAGS "DV:I:d:ef:ij:knqrst" #endif rearg: while((c = getopt(argc, argv, OPTFLAGS)) != EOF) { --- 158,162 ---- # define OPTFLAGS "BD:I:L:PSVd:ef:ij:knqrst" #else ! # define OPTFLAGS "D:I:V:d:ef:ij:knqrst" #endif rearg: while((c = getopt(argc, argv, OPTFLAGS)) != EOF) { *************** *** 640,645 **** ln = Lst_Succ(ln)) { char *value = Var_Value((char *)Lst_Datum(ln), ! VAR_GLOBAL, &p1); ! printf("%s\n", value? value : ""); if (p1) free(p1); --- 640,646 ---- ln = Lst_Succ(ln)) { char *value = Var_Value((char *)Lst_Datum(ln), ! VAR_GLOBAL, &p1); ! ! printf("%s\n", value ? value : ""); if (p1) free(p1); *************** *** 946,951 **** { (void)fprintf(stderr, ! "usage: make [-eiknqrst] [-D variable] [-d flags] [-f makefile ]\n\ ! [-I directory] [-j max_jobs] [variable=value]\n"); exit(2); } --- 947,952 ---- { (void)fprintf(stderr, ! "usage: make [-eiknqrst] [-D variable] [-d flags] [-f makefile] [-I directory]\n\ ! [-j max_jobs] [-V variable] [variable=value] [target ...]\n"); exit(2); } === >For example, for /usr/src/games/boggle/Makefile: > MKDICTOBJ != cd ${.CURDIR}/mkdict; make -V .OBJDIR > MKINDXOBJ != cd ${.CURDIR}/mkindex; make -V .OBJDIR > MKDICT = ${MKDICTOBJ}/mkdict > MKINDX = ${MKINDXOBJ}/mkindex >The old version of the Makefile failed for most obj directory configurations; >the -current version of the Makefile (and the new build system in general) only >allows one (broken) way to do obj directories. I think the old way worked provided the source directories contained the correct obj links. I think the above method is too slow except in special cases. It is probably most useful for nightmare cases like tn3270. Bruce