Added a new fancy build system feature called "build profiles".
Especially people building various kinds of images with different settings may want to have a look at the respective section in the UserBuildConfig.ReadMe. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24757 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
+50
-24
@@ -43,37 +43,63 @@ HAIKU_CONTAINER_GRIST on $(HAIKU_CD_BOOT_IMAGE_CONTAINER_NAME) = CDBootImage ;
|
||||
HAIKU_INSTALL_TARGETS_VAR on $(HAIKU_CD_BOOT_IMAGE_CONTAINER_NAME)
|
||||
= HAIKU_CD_BOOT_IMAGE_INSTALL_TARGETS ;
|
||||
|
||||
# Haiku image/install defaults
|
||||
HAIKU_DEFAULT_IMAGE_NAME = haiku.image ;
|
||||
HAIKU_DEFAULT_IMAGE_DIR = $(HAIKU_OUTPUT_DIR) ;
|
||||
HAIKU_DEFAULT_VMWARE_IMAGE_NAME = haiku.vmdk ;
|
||||
HAIKU_DEFAULT_INSTALL_DIR = /Haiku ;
|
||||
HAIKU_DEFAULT_IMAGE_SIZE ?= 100 ; # 100 MB
|
||||
|
||||
|
||||
# analyze an optionally replace jam's target parameters
|
||||
HAIKU_ORIGINAL_JAM_TARGETS = $(JAM_TARGETS) ;
|
||||
HAIKU_BUILD_PROFILE = ;
|
||||
if $(JAM_TARGETS) {
|
||||
# If the target to be built is "all" (i.e. the default) and we're in the
|
||||
# output directory, the root directory of the build system, or in "src/", we
|
||||
# change the target to be built to "haiku-image".
|
||||
if $(JAM_TARGETS) = all {
|
||||
if ! $(INVOCATION_SUBDIR) || $(INVOCATION_SUBDIR) = src {
|
||||
JAM_TARGETS = haiku-image ;
|
||||
switch $(JAM_TARGETS[1]) {
|
||||
# If the target to be built is "all" (i.e. the default) and we're in
|
||||
# the output directory, the root directory of the build system, or
|
||||
# in "src/", we change the target to be built to "haiku-image".
|
||||
case all : {
|
||||
if ! $(INVOCATION_SUBDIR) || $(INVOCATION_SUBDIR) = src {
|
||||
JAM_TARGETS = haiku-image ;
|
||||
}
|
||||
}
|
||||
|
||||
# The "run" target allows for running arbitrary command lines containing
|
||||
# build system targets, which are built and replaced accordingly.
|
||||
} else if $(JAM_TARGETS[1]) = run && $(JAM_TARGETS[2]) {
|
||||
local run = [ RunCommandLine $(JAM_TARGETS[2-]) ] ;
|
||||
JAM_TARGETS = $(run) ;
|
||||
# The "run" target allows for running arbitrary command lines containing
|
||||
# build system targets, which are built and replaced accordingly.
|
||||
case run : {
|
||||
if $(JAM_TARGETS[2]) {
|
||||
JAM_TARGETS = [ RunCommandLine $(JAM_TARGETS[2-]) ] ;
|
||||
} else {
|
||||
Exit "\"jam run\" requires parameters!" ;
|
||||
}
|
||||
}
|
||||
|
||||
# "update-image", "update-vmware-image", and "update-install" targets allow
|
||||
# for updating only specific targets in the image/installation dir.
|
||||
} else if $(JAM_TARGETS[1]) = update-image
|
||||
|| $(JAM_TARGETS[1]) = update-vmware-image
|
||||
|| $(JAM_TARGETS[1]) = update-install {
|
||||
SetUpdateHaikuImageOnly 1 ;
|
||||
HAIKU_INCLUDE_IN_IMAGE on $(JAM_TARGETS[2-]) = 1 ;
|
||||
# A target starting with "@" is a build profile.
|
||||
case @* : {
|
||||
HAIKU_BUILD_PROFILE = [ Match "@(.*)" : $(JAM_TARGETS[1]) ] ;
|
||||
HAIKU_BUILD_PROFILE_ACTION = $(JAM_TARGETS[2]:E=build) ;
|
||||
HAIKU_BUILD_PROFILE_PARAMETERS = $(JAM_TARGETS[3-]) ;
|
||||
HAIKU_BUILD_PROFILE_DEFINED = ;
|
||||
}
|
||||
|
||||
if $(JAM_TARGETS[1]) = update-image {
|
||||
JAM_TARGETS = haiku-image ;
|
||||
} else if $(JAM_TARGETS[1]) = update-vmware-image {
|
||||
JAM_TARGETS = haiku-vmware-image ;
|
||||
} else {
|
||||
JAM_TARGETS = install-haiku ;
|
||||
case * : {
|
||||
# "update-image", "update-vmware-image", and "update-install"
|
||||
# targets allow for updating only specific targets in the
|
||||
# image/installation dir.
|
||||
if $(JAM_TARGETS[1]) in update-image update-vmware-image
|
||||
update-install {
|
||||
SetUpdateHaikuImageOnly 1 ;
|
||||
HAIKU_INCLUDE_IN_IMAGE on $(JAM_TARGETS[2-]) = 1 ;
|
||||
|
||||
if $(JAM_TARGETS[1]) = update-image {
|
||||
JAM_TARGETS = haiku-image ;
|
||||
} else if $(JAM_TARGETS[1]) = update-vmware-image {
|
||||
JAM_TARGETS = haiku-vmware-image ;
|
||||
} else {
|
||||
JAM_TARGETS = install-haiku ;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user