Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 24 Oct 2020 15:07:15 -0700
From:      Simon J Gerraty <sjg@juniper.net>
To:        <freebsd-pkgbase@freebsd.org>
Cc:        <sjg@juniper.net>
Subject:   directory per  package ?
Message-ID:  <41616.1603577235@kaos.jnpr.net>

next in thread | raw e-mail | index | archive | help
I'm not currently subscribed to this list, so pls cc me.

I'd like to request a change such that the final step of building each
package for base be done in its own directory.

Why?  So that Makefile.depend can be automatically captured for each
package thus allowing building with DIRDEPS_BUILD.

Apart from simpler and more optimal build, this make it easy to build
just the  package you want - since the directory represents a target
that  can be built from top-level.

As a quick experiment, I grep'd PACKAGE= from all the Makefiles
then from that list grabbed all those with PACKAGE= runtime
and turned that into targets/runtime/Makefile.depend

% head targets/runtime/Makefile.depend
DIRDEPS= \
	bin/cat  \
	bin/chflags  \
	bin/chio  \
	bin/chmod  \
	bin/cp  \
	bin/csh  \
	bin/date  \
	bin/dd  \
	bin/df  \
% tail targets/runtime/Makefile.depend

DIRDEPS.i386 += \
	sbin/sconfig  \


DEP_MACHINE?= ${MACHINE}
DIRDEPS+= ${DIRDEPS.${DEP_MACHINE}:U}

.include <dirdeps.mk>
%

And then

make -j8 -C  targets/runtime

built all of  that just fine.

With top-level makefile including dirdeps-targets.mk when
MK_DIRDEPS_BUILD=yes
the above is just

make -j8 runtime

but the above is not a viable way to maintain Makefile.depend for a
package.

Far better to build  the package in its own dir so that Makefile.depend
can be updated automatically like the rest of the tree.

Btw having something like

targets/packages/runtime

with targets/packages/Makefile.inc containing all the common logic for
building packages, would allow subdirs per package with hopefully
minimal change to current logic?

Finally the above hierarchy could exist anywhere, a simple addition to
local.dirdeps-targets.mk to add targets/packages or whatever
to DIRDEPS_TARGETS_DIRS is all that is needed.

Thanks
--sjg



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