directory per package ?
Simon J Gerraty
sjg at juniper.net
Sat Oct 24 22:50:06 UTC 2020
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
More information about the freebsd-pkgbase
mailing list