Subject: Re: Problems with system makefiles and optimization flags
To: Frederick Bruckman <fredb@immanent.net>
From: Andrew Brown <atatat@atatdot.net>
List: tech-toolchain
Date: 11/07/2002 13:02:02
>> >Use
>> >
>> >.ifndef DESTDIR
>> >.endif
>> >
>> >in /etc/mk.conf perhaps?
>>
>> in the case of GENERIC or INSTALL kernels being built for a snapshot,
>> RELEASEDIR would be set.  DESTDIR, too, i suppose, but RELEASEDIR
>> seems more specific to the task at hand.
>
>Sure, if you do two passes, the second one with UPDATE or NOCLEANDIR.
>Otherwise RELEASEDIR is set for the whole build, including userland
>and sets. That's sub-optimal. I think I'd like something like COPTS
>that only affects userland, something like KOPTS that only affects
>kernels (which defaults to empty in GENERIC &c, so GENERIC &c is
>immune to global setting of, as it doesn't make any sense to customize
>GENERIC), and for the ramdisk in distrib to be immune to both.

so...you have your own userland, your snapshot userland, your own
kernels, kernels for snapshots, pkgsrc...

.ifndef	BSD_PKG_MK
.ifndef		KERNEL_BUILD

.ifndef			DESTDIR
# your own userland settings
.else			# DESTDIR
# snapshot userland settings
.endif			# DESTDIR

.else		# KERNEL_BUILD

.ifdef			RELEASEDIR
# kernel settings for snapshot kernels
.else			# RELEASEDIR
# kernel settings for your own kernels
.endif			# RELEASEDIR

.endif		# KERNEL_BUILD

.else	# BSD_PKG_MK
# pkgsrc settings go here
.endif	# BSD_PKG_MK

yes, it gets a little messy, but you can do it.  :)

-- 
|-----< "CODE WARRIOR" >-----|
codewarrior@daemon.org             * "ah!  i see you have the internet
twofsonet@graffiti.com (Andrew Brown)                that goes *ping*!"
werdna@squooshy.com       * "information is power -- share the wealth."