Problems with ALT_OUTPUTDIR in debug build

Volker Simonis volker.simonis at gmail.com
Thu Jan 10 02:44:17 PST 2008


Hi,
there seems to be a problem with the handling of ALT_OUTPUTDIR for debug and
fastdebug builds. The top-level makefile contains the following definitions:

Makefile
--------

include $(JDK_MAKE_SHARED_DIR)/Defs-control.gmk

COMMON_DEBUG_FLAGS= \
        DEBUG_NAME=$(DEBUG_NAME) \
        ALT_OUTPUTDIR=$(_OUTPUTDIR)-$(DEBUG_NAME) \
        NO_DOCS=true

generic_debug_build:
        @$(ECHO) $@ build started: `$(DATE) '+%y-%m-%d %H:%M'`
        $(MAKE) $(COMMON_DEBUG_FLAGS) setup build
        @$(ECHO) $@ build finished: `$(DATE) '+%y-%m-%d %H:%M'`


As you can see, it always sets the value of ALT_OUTPUTDIR to
"$(_OUTPUTDIR)-$(DEBUG_NAME)" where _OUTPUTDIR is the default value of the
output directory which is defined in "jdk/make/common/shared/Defs-control.gmk"
as follows (i.e. "linux-i586" on x86/Linux):

jdk/make/common/shared/Defs-control.gmk
---------------------------------------
# Default output directory
_OUTPUTDIR=$(CONTROL_TOPDIR)/build/$(PLATFORM)-$(ARCH)

Shouldn't COMMON_DEBUG_FLAGS use $(OUTPUTDIR) instead of $(_OUTPUTDIR) or
am I missing something.


It is also quite confusing that the build always creates
$(OUTPUTDIR)-fastdebug subdirectories, no matter if we do a fastdebug build or
not. I think that only the directories should be created which are used later
on for the build. If I do for example "make debug_build" without specifying
"ALT_OUTPUT_DIR", make will create four output directories as follows:

linux-i586
linux-i586-debug
linux-i586-debug-fastdebug
linux-i586-fastdebug

in the build directory, while the output only goes to "linux-i586-debug".
What are the "-fastdebug"-directories (especially
"linux-i586-debug-fastdebug") good for?

If I do "make debug_build ALT_OUTPUTDIR=/build/xxx" the build creates:

linux-i586-debug
linux-i586-debug-fastdebug
xxx
xxx-fastdebug

but the output goes to "linux-i586-debug" as in the previous case.

If we fix the top-level Makefile as suggested above, we'll get:

xxx
xxx-debug
xxx-debug-fastdebug
xxx-fastdebug

with all the output going to "xxx-debug". That seems much better, but
still we have three unused directories!

In my eyes, the cleanest solution would be if ALT_OUTPUTDIR would be honoured
"as is", as the output directory for everything we built, without anything
appended to it. So the developer should be free to choose whatever he wants as
the output directory. And there should be no additional directories created.

Regards,
Volker



More information about the build-dev mailing list