1 # Rules related to processing of jam command line arguments.
3 rule ProcessCommandLineArguments
5 # analyze and optionally replace jam's target parameters
6 HAIKU_ORIGINAL_JAM_TARGETS = $(JAM_TARGETS) ;
7 HAIKU_BUILD_PROFILE = ;
9 switch $(JAM_TARGETS[1]) {
10 # If the target to be built is "all" (i.e. the default) and we're in
11 # the output directory, the root directory of the build system, or
12 # in "src/", we change the target to be built to "haiku-image".
14 if ! $(INVOCATION_SUBDIR) || $(INVOCATION_SUBDIR) = src {
15 JAM_TARGETS = haiku-image ;
21 Echo "Individual targets (applications, libraries, drivers,"
22 "...) can be built by just" ;
23 Echo "passing them as arguments to jam. The recommended method"
24 "to build or update a" ;
25 Echo "Haiku image or installation is to use a build profile"
26 "with one of the build" ;
27 Echo "profile actions. Typical command lines using a build"
28 "profile looks like this:" ;
30 Echo " jam @install update libbe.so" ;
31 Echo " jam @vmware-image mount" ;
33 Echo "Default build profiles (minimal set of packages and"
35 Echo " image - A raw disk image." ;
36 Echo " anyboot-image - A custom image for either CD or"
38 Echo " cd-image - An ISO9660 CD image." ;
39 Echo " vmware-image - A VMware disk image." ;
40 Echo " install - A Haiku installation in a"
43 Echo "Nightly build profiles (small set of packages used in"
44 "nightly builds and default configuration):" ;
45 Echo " nightly-raw - A raw disk image." ;
46 Echo " nightly-anyboot - A custom image for either CD or"
48 Echo " nightly-cd - An ISO9660 CD image." ;
49 Echo " nightly-vmware - A VMware disk image." ;
51 Echo "Release build profiles (bigger and more complete set of"
52 "packages used in releases and default configuration):" ;
53 Echo " release-raw - A raw disk image." ;
54 Echo " release-anyboot - A custom image for either CD or"
56 Echo " release-cd - An ISO9660 CD image." ;
57 Echo " release-vmware - A VMware disk image." ;
59 Echo "Bootstrap build profiles (minimal image used for"
60 "initial build of HPKG packages):" ;
61 Echo " bootstrap-raw - A raw disk image." ;
62 Echo " bootstrap-vmware - A VMware disk image." ;
64 Echo "Build profile actions:" ;
65 Echo " build - Build a Haiku"
66 "image/installation. This is the default" ;
67 Echo " action, i.e. it can be"
69 Echo " update <target> ... - Update the specified targets in"
71 Echo " image/installation." ;
72 Echo " update-all - Update all targets in the Haiku"
73 "image/installation." ;
74 Echo " mount - Mount the Haiku image in the"
77 Echo "For more details on how to customize Haiku builds read" ;
78 Echo "build/jam/UserBuildConfig.ReadMe." ;
82 # The "run" target allows for running arbitrary command lines
83 # containing build system targets, which are built and replaced
86 if $(JAM_TARGETS[2]) {
87 JAM_TARGETS = [ RunCommandLine $(JAM_TARGETS[2-]) ] ;
89 Exit "\"jam run\" requires parameters!" ;
93 # A target starting with "@" is a build profile.
95 HAIKU_BUILD_PROFILE = [ Match "@(.*)" : $(JAM_TARGETS[1]) ] ;
96 HAIKU_BUILD_PROFILE_ACTION = $(JAM_TARGETS[2]:E=build) ;
97 HAIKU_BUILD_PROFILE_PARAMETERS = $(JAM_TARGETS[3-]) ;
98 HAIKU_BUILD_PROFILE_DEFINED = ;
102 # "update-image", "update-vmware-image", and "update-install"
103 # targets allow for updating only specific targets in the
104 # image/installation dir.
105 if $(JAM_TARGETS[1]) in update-image update-vmware-image
107 SetUpdateHaikuImageOnly 1 ;
108 HAIKU_PACKAGES_UPDATE_ONLY = 1 ;
109 HAIKU_INCLUDE_IN_IMAGE on $(JAM_TARGETS[2-]) = 1 ;
110 HAIKU_INCLUDE_IN_PACKAGES on $(JAM_TARGETS[2-]) = 1 ;
112 if $(JAM_TARGETS[1]) = update-image {
113 JAM_TARGETS = haiku-image ;
114 } else if $(JAM_TARGETS[1]) = update-vmware-image {
115 JAM_TARGETS = haiku-vmware-image ;
117 JAM_TARGETS = install-haiku ;