From owner-cvs-all Sat Oct 10 03:20:57 1998 Return-Path: Received: (from daemon@localhost) by hub.freebsd.org (8.8.8/8.8.8) id DAA18537 for cvs-all-outgoing; Sat, 10 Oct 1998 03:20:57 -0700 (PDT) (envelope-from owner-cvs-all) Received: from spinner.netplex.com.au (spinner.netplex.com.au [202.12.86.3]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id DAA18472; Sat, 10 Oct 1998 03:20:34 -0700 (PDT) (envelope-from peter@netplex.com.au) Received: from spinner.netplex.com.au (localhost [127.0.0.1]) by spinner.netplex.com.au (8.9.1/8.9.1/Spinner) with ESMTP id RAA15045; Sat, 10 Oct 1998 17:48:24 +0800 (WST) (envelope-from peter@spinner.netplex.com.au) Message-Id: <199810100948.RAA15045@spinner.netplex.com.au> X-Mailer: exmh version 2.0.2 2/24/98 To: Robert Nordier 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 In-reply-to: Your message of "Sat, 10 Oct 1998 11:52:55 +0200." <199810100952.LAA10684@ceia.nordier.com> Date: Sat, 10 Oct 1998 17:48:23 +0800 From: Peter Wemm Sender: owner-cvs-all@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk 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 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 # get definition of $LIBDIR, read /etc/make.conf .if exists(${LIBDIR}/libfoo.a) xxx .endif .include 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