Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 10 Oct 1998 17:48:23 +0800
From:      Peter Wemm <peter@netplex.com.au>
To:        Robert Nordier <rnordier@nordier.com>
Cc:        jkh@time.cdrom.com (Jordan K. Hubbard), skynyrd@opus.cts.cwu.edu, rnordier@FreeBSD.ORG, committers@FreeBSD.ORG
Subject:   Re: cvs commit: src/sys/boot/i386 Makefile 
Message-ID:  <199810100948.RAA15045@spinner.netplex.com.au>
In-Reply-To: Your message of "Sat, 10 Oct 1998 11:52:55 %2B0200." <199810100952.LAA10684@ceia.nordier.com> 

next in thread | previous in thread | raw e-mail | index | archive | help
Robert Nordier wrote:
> Jordan K. Hubbard wrote:
> > > (I've gone with another of your suggestions, and the new boot2
> > > supports both a.out and ELF, which means an ELF /boot/loader binary
> > > is feasible.)
> > > 
> > > So for /sys/boot/i386/Makefile, I suggest we do something like:
> > > 
> > > .MAKEFLAGS:	BTXLDFMT=${OBJFORMAT} OBJFORMAT=elf
> > 
> > Hmmm.  Is that really the right makefile for it?
> 
> Well, it works.  But (assuming your question was rhetorical), what do
> you prefer?

The cleanest way would be something like this:

# $Id$
#
OBJFORMAT?=foo

PROG=	xx
...

.include <bsd.prog.mk>

However, this requires that bsd.own.mk be included from the other bsd.*.mk 
files instead of sys.mk.  This is a major thing, because all the makefiles 
that do conditional things based on variables would have trouble because 
they wouldn't be defined until later.

ie, something like this would be needed:

# $Id$
OBJFORMAT?=	aout
.include <bsd.own.mk>	# get definition of $LIBDIR, read /etc/make.conf

.if exists(${LIBDIR}/libfoo.a)
xxx
.endif

.include <bsd.prog.mk>

Without the early include of bsd.own.mk, things like $LIBDIR would be 
undefined when it mattered..  This has major pain implications for the 
build tree, we've got loads of such hacks around the place.

But for now, using .MAKEFLAGS: works because it's inherited by the child 
make processes, and the variables in the subdirs will be set correctly.  
It cannot work properly by adding it to a Makefile that builds something 
because too many things will have been already set as a result of sys.mk.

> -- 
> Robert Nordier

Cheers,
-Peter





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