From owner-freebsd-current Wed Jul 23 11:02:48 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id LAA03455 for current-outgoing; Wed, 23 Jul 1997 11:02:48 -0700 (PDT) Received: from genesis.atrad.adelaide.edu.au (genesis.atrad.adelaide.edu.au [129.127.96.120]) by hub.freebsd.org (8.8.5/8.8.5) with ESMTP id LAA03439 for ; Wed, 23 Jul 1997 11:02:40 -0700 (PDT) Received: (from msmith@localhost) by genesis.atrad.adelaide.edu.au (8.8.5/8.7.3) id DAA10803; Thu, 24 Jul 1997 03:32:18 +0930 (CST) From: Michael Smith Message-Id: <199707231802.DAA10803@genesis.atrad.adelaide.edu.au> Subject: Re: who broke libedit ?? In-Reply-To: from Mikael Hybsch at "Jul 23, 97 07:32:48 pm" To: micke@dynas.se (Mikael Hybsch) Date: Thu, 24 Jul 1997 03:32:17 +0930 (CST) Cc: sos@sos.freebsd.dk, freebsd-current@FreeBSD.ORG X-Mailer: ELM [version 2.4ME+ PL28 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-current@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk Mikael Hybsch stands accused of saying: > I had the same problem some says ago. > > The real problem is some odd code in the shell-script makeline. > When used with -h, it tries to extract the basename of the file without > extention by first splitting the full path filename on '.' and then calling > `basename $1` instead of the reverse. Yay! Shimon has the same problem too. How does the follwing alternate logic look : FILES="$@" case $FLAG in -h) fn=`basename $FILES` OIFS="$IFS" IFS=".$IFS" set - $fn IFS="$OIFS" hdr="_h_$1_$2" cat $FILES | $AWK ' BEGIN { printf("/* Automatically generated file, do not edit */\n"); printf("#ifndef %s\n#define %s\n", "'$hdr'", "'$hdr'"); } Any complaints? I give you time to make a coffee and I commit. -- ]] Mike Smith, Software Engineer msmith@gsoft.com.au [[ ]] Genesis Software genesis@gsoft.com.au [[ ]] High-speed data acquisition and (GSM mobile) 0411-222-496 [[ ]] realtime instrument control. (ph) +61-8-8267-3493 [[ ]] Unix hardware collector. "Where are your PEZ?" The Tick [[