Subject: .mk "subroutine" for getting objdir locations
To: None <email@example.com>
From: Todd Vierling <firstname.lastname@example.org>
Date: 08/06/2001 20:52:35
The following I plan to add as src/share/mk/bsd.getobj.mk by Wednesday
evening if there are no major objections (mainly, I'm testing the waters to
see what people think of the *name* ... I couldn't come up with many good
This .mk file is intended to replace the very ugly, and quite slow,
shellcode hacks that have been used to find out the proper obj subdirectory
of a given source directory. Currently a recursive make is called from a
!=, which is very high overhead, particularly on slower architectures. In
the toolchain hacking I've been doing, there are loads of these !=
constructs, and I want to flatten them.
Feel free to discuss, but I feel this probably doesn't warrant a long
# Subroutine to obtains the object directory of a given subdirectory,
# without the overhead of a subshell invocation. Can be included
# multiple times as needed.
# Set the following:
# GETOBJ_SRC Source directory to resolve to an objdir
# GETOBJ_VAR Variable to set with objdir location
# The following follow the make(1) rules, not those in <bsd.obj.mk> --
# we care what exists, not what the user requested in /etc/mk.conf.
# Fallback to same path.
-- Todd Vierling <email@example.com> * Wasabi NetBSD: Run with it.
-- NetBSD 1.5 now available on CD-ROM -- http://www.wasabisystems.com/