From owner-freebsd-hackers Thu Nov 12 14:03:43 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id OAA28202 for freebsd-hackers-outgoing; Thu, 12 Nov 1998 14:03:43 -0800 (PST) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from gershwin.tera.com (gershwin.tera.com [207.224.230.28]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id OAA28191 for ; Thu, 12 Nov 1998 14:03:40 -0800 (PST) (envelope-from kline@tao.thought.org) Received: from tao.thought.org (tao.tera.com [207.108.223.55]) by gershwin.tera.com (8.8.8/8.8.8) with ESMTP id OAA18458; Thu, 12 Nov 1998 14:03:17 -0800 (PST) Received: (from kline@localhost) by tao.thought.org (8.8.8/8.7.3) id OAA09722; Thu, 12 Nov 1998 14:03:06 -0800 (PST) Message-ID: <19981112140306.A9591@thought.org> Date: Thu, 12 Nov 1998 14:03:06 -0800 From: Gary Kline To: David Holland Cc: joelh@gnu.org, kline@tao.thought.org, hackers@FreeBSD.ORG Subject: Re: bsd make to gnu make conversion, anyone?? References: <19981112122005.C7958@thought.org> <98Nov12.163233edt.37768-2936@qew.cs.toronto.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.93.2i In-Reply-To: <98Nov12.163233edt.37768-2936@qew.cs.toronto.edu>; from David Holland on Thu, Nov 12, 1998 at 04:32:30PM -0500 Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Thu, Nov 12, 1998 at 04:32:30PM -0500, David Holland wrote: > > > Another thing you can do is > > support.mk: Makefile > echo $(LANGS) | awk '{ for (i=1; i<=NF; i++) print $$i;}' |\ > awk '{ printf "%s.mv.cat $$(.CURDIR)/nls/%s/mv.msg\n", $$1, $$1}' |\ > awk '{ printf "%s: %s\n\tgencat -new %s %s\n\n", \ > $$1, $$2, $$1, $$2}' > support.mk > include support.mk > > There are assorted possible variations on this... > Something like this crossed my mind; either in each utility makefile or in a separate file. Putting it in a ``bsd.support.mk'' would be cleaner. Good idea! > > So yeah, here's how you do subdirectories in gmake, in case anyone's > interested: > > SUBDIRS=a b c d > TARGETS=all install depend clean > > > TMP1:=$(foreach dir, $(SUBDIRS), $(TARGETS)) > TMP2:=$(foreach dir, $(SUBDIRS), $(foreach tgt, $(TARGETS), $(dir)/)) > TMP3:=$(join $(TMP2), $(TMP1)) > TMP4:=$(patsubst %, %/%, $(SUBDIRS)) > > $(TARGETS): %: $(TMP4) > > $(TMP3): %: > @echo $(MAKE) -C $(patsubst %/, %, $(dir $@)) $(notdir $@) > > Now where have I seen this syntax before! gary -- Gary D. Kline kline@tao.thought.org Public service uNix To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message