2009-02-24 01:33:09 +03:00
|
|
|
# Rules related to processing of jam command line arguments.
|
|
|
|
|
|
|
|
rule ProcessCommandLineArguments
|
|
|
|
{
|
|
|
|
# analyze and optionally replace jam's target parameters
|
|
|
|
HAIKU_ORIGINAL_JAM_TARGETS = $(JAM_TARGETS) ;
|
|
|
|
HAIKU_BUILD_PROFILE = ;
|
|
|
|
if $(JAM_TARGETS) {
|
|
|
|
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 ;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
# Print usage text.
|
|
|
|
case help : {
|
|
|
|
Echo "Individual targets (applications, libraries, drivers,...)"
|
|
|
|
" can be built by just" ;
|
|
|
|
Echo "passing them as arguments to jam. The recommended method"
|
|
|
|
"to build or update a" ;
|
|
|
|
Echo "Haiku image or installation is to use a build profile"
|
|
|
|
"with one of the build" ;
|
|
|
|
Echo "profile actions. Typical command lines using a build"
|
|
|
|
"profile looks like this:" ;
|
|
|
|
Echo " jam @image" ;
|
|
|
|
Echo " jam @install update libbe.so" ;
|
|
|
|
Echo " jam @vmware-image mount" ;
|
|
|
|
Echo ;
|
|
|
|
Echo "Default build profiles:" ;
|
|
|
|
Echo " image - A raw disk image." ;
|
2010-05-05 22:20:43 +04:00
|
|
|
Echo " anyboot-image - A custom image for either CD or disk." ;
|
2010-05-04 01:51:58 +04:00
|
|
|
Echo " cd-image - An ISO9660 CD image." ;
|
2009-02-24 01:33:09 +03:00
|
|
|
Echo " vmware-image - A VMware disk image." ;
|
|
|
|
Echo " install - A Haiku installation in a directory." ;
|
|
|
|
Echo ;
|
|
|
|
Echo "Build profile actions:" ;
|
|
|
|
Echo " build - Build a Haiku"
|
|
|
|
"image/installation. This is the default" ;
|
|
|
|
Echo " action, i.e. it can be"
|
|
|
|
"omitted." ;
|
|
|
|
Echo " update <target> ... - Update the specified targets in"
|
|
|
|
" the Haiku" ;
|
|
|
|
Echo " image/installation." ;
|
|
|
|
Echo " update-all - Update all targets in the Haiku"
|
|
|
|
"image/installation." ;
|
|
|
|
Echo " mount - Mount the Haiku image in the"
|
|
|
|
"bfs_shell." ;
|
|
|
|
Echo ;
|
|
|
|
Echo "For more details on how to customize Haiku builds read" ;
|
|
|
|
Echo "build/jam/UserBuildConfig.ReadMe." ;
|
|
|
|
Exit ;
|
|
|
|
}
|
|
|
|
|
|
|
|
# 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!" ;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-09-14 21:51:09 +04:00
|
|
|
# Copy the given set of local package files to the remote repository
|
|
|
|
# and create a new version of that remote repository.
|
|
|
|
case build-remote-repository : {
|
|
|
|
BuildRemoteHaikuPortsRepository $(JAM_TARGETS[1])
|
|
|
|
: $(JAM_TARGETS[2-]) ;
|
|
|
|
JAM_TARGETS = $(JAM_TARGETS[1]) ;
|
|
|
|
NotFile $(JAM_TARGETS) ;
|
|
|
|
Always $(JAM_TARGETS) ;
|
|
|
|
}
|
|
|
|
|
2009-02-24 01:33:09 +03:00
|
|
|
# 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 = ;
|
|
|
|
}
|
|
|
|
|
|
|
|
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 ;
|
2011-07-03 11:28:30 +04:00
|
|
|
HAIKU_PACKAGES_UPDATE_ONLY = 1 ;
|
2009-02-24 01:33:09 +03:00
|
|
|
HAIKU_INCLUDE_IN_IMAGE on $(JAM_TARGETS[2-]) = 1 ;
|
2011-07-03 11:28:30 +04:00
|
|
|
HAIKU_INCLUDE_IN_PACKAGES on $(JAM_TARGETS[2-]) = 1 ;
|
2009-02-24 01:33:09 +03:00
|
|
|
|
|
|
|
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 ;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|