Problems with ALT_OUTPUTDIR in debug build
volker.simonis at gmail.com
Thu Jan 10 03:09:48 PST 2008
me again. I' found that the additional "-fastdebug" directories are
created unconditionally by the top-level makefile, in the setup-step:
$(MKDIR) -p $(OUTPUTDIR)/j2sdk-image
$(MKDIR) -p $(ABS_OUTPUTDIR)/j2sdk-image
$(MKDIR) -p $(OUTPUTDIR)-fastdebug/j2sdk-image
$(MKDIR) -p $(ABS_OUTPUTDIR)-fastdebug/j2sdk-image
Is this really necessary?
Morever I found that I can create a debug build that honours the ALT_OUTPUTDIR
setting and leaves me with only one bogus "-fastdebug" directory as follows:
make SKIP_DEBUG_BUILD=false SKIP_FASTDEBUG_BUILD=true DEBUG_NAME=debug
This will create the following two directories in /build:
and put all the stuff into "my_debug_build" as desired. After the
build I can remove "my_debug_build-fastdebug" and be happy.
Any comments if this is the right way to do a debug build?
On 1/10/08, Volker Simonis <volker.simonis at gmail.com> wrote:
> 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:
> include $(JDK_MAKE_SHARED_DIR)/Defs-control.gmk
> COMMON_DEBUG_FLAGS= \
> DEBUG_NAME=$(DEBUG_NAME) \
> ALT_OUTPUTDIR=$(_OUTPUTDIR)-$(DEBUG_NAME) \
> @$(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):
> # Default output directory
> 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:
> 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:
> 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:
> 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.
More information about the build-dev