Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 1 Apr 1996 20:44:34 +1000
From:      Bruce Evans <bde@zeta.org.au>
To:        current@freebsd.org, fenner@parc.xerox.com
Subject:   Re: Another "does LINT compile?" question
Message-ID:  <199604011044.UAA14428@godzilla.zeta.org.au>

next in thread | raw e-mail | index | archive | help
>The "make" released with 2.1 doesn't appear to ever do much with the
>"$<" makefile variable when the target doesn't have a suffix; if I do

>foo:	foo.c
>	echo $<

>I get

>% make
>echo

>%

>The only difference in "make" from 2.1 to -current is

>revision 1.5
>...

The difference is actually in sys.mk.  The 2.1 make works if the null
suffix `.c:' rule in sys.mk is uncommented.  There used to be bugs in
make that stopped this rule from working.  However, these bugs were
fixed long before 2.1R.  The rule is still commented out in -stable.
Sigh.

>/sys/compile/LINT/Makefile ends up using $< when building linux_genassym:

>linux_genassym: $S/i386/linux/linux_genassym.c $S/i386/linux/linux.h
>        ${CC} ${CFLAGS} -o $@ $<

This is a bug in the Makefile.  In the original version of make, `$<'
was only valid for targets generated by a suffix rule.  Some versions
of make, e.g., gnu make, generate a useful `$<' for explicit rules.
Our make doesn't.  E.g., the makefile

bar: foo.c
	echo $<

works "right" for gnu make but not for BSD make.

The linux_genassym rule works right in -current because the null suffix
rule is matched and is bogusly not completely overridden by the explict
rule.

The genassym rule works right even in 2.1 because it uses genassym.o
and not $<.  See the cvs log for revision 1.48 for why the intermediate
file genassym.o is built.

`$<' is also bogus for hundreds of other explicit rules in the kernel
Makefile.  E.g., in ${NORMAL_C} it works because the implicit .c.o rule
is matched and is bogusly not completely overridden by the explicit
rule.

>I have a shell script that tries to build LINT nightly and sends me email
>if it fails.  Perhaps this output should go to the mailing list?

Only once a week until all the warnings are fixed.

Bruce



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199604011044.UAA14428>