diff --git a/Jamrules b/Jamrules index f21f9cb1fd..1742cdd3d4 100644 --- a/Jamrules +++ b/Jamrules @@ -45,6 +45,11 @@ include [ FDirName $(HAIKU_BUILD_RULES_DIR) PackageRules ] ; include [ FDirName $(HAIKU_BUILD_RULES_DIR) TestsRules ] ; include [ FDirName $(HAIKU_BUILD_RULES_DIR) BuildSetup ] ; +# Declare no-op user-overridable build rules. +rule UserBuildConfigRulePostBuildTargets { } +rule UserBuildConfigRulePreImage { } +rule UserBuildConfigRulePostImage { } + # Include UserBuildConfig. { local userBuildConfig diff --git a/build/jam/HaikuImage b/build/jam/HaikuImage index 5c8a4e1b03..e6f42b88c2 100644 --- a/build/jam/HaikuImage +++ b/build/jam/HaikuImage @@ -606,6 +606,9 @@ if $(HAIKU_IMAGE_HOST_NAME) { #pragma mark - Build The Image +# Execute pre-image user config rules. +UserBuildConfigRulePreImage ; + # Set image name and directory defaults and locate the image. HAIKU_IMAGE_NAME ?= $(HAIKU_DEFAULT_IMAGE_NAME) ; HAIKU_IMAGE_DIR ?= $(HAIKU_DEFAULT_IMAGE_DIR) ; @@ -716,3 +719,6 @@ MakeLocate $(HAIKU_VMWARE_IMAGE) : $(HAIKU_IMAGE_DIR) ; _BuildHaikuImage $(HAIKU_VMWARE_IMAGE) : true : true ; NotFile haiku-vmware-image ; Depends haiku-vmware-image : $(HAIKU_VMWARE_IMAGE) ; + +# Execute post-image user config rules. +UserBuildConfigRulePostImage ; diff --git a/build/jam/UserBuildConfig.ReadMe b/build/jam/UserBuildConfig.ReadMe index 6c79b93f2a..2ad02b81a0 100644 --- a/build/jam/UserBuildConfig.ReadMe +++ b/build/jam/UserBuildConfig.ReadMe @@ -12,14 +12,6 @@ Exit You must NOT copy UserBuildConfig.ReadMe directly but use parts of it! ; -# Adding timezone and keymap settings -AddSymlinkToHaikuImage home config settings - : /boot/beos/etc/timezones/Europe/Paris : timezone ; - -AddFilesToHaikuImage home config settings : US-International - : Key_map ; - - # Adjusting Build Variables # The following variables can be configured per subdirectory (or subtree) or @@ -99,6 +91,11 @@ AddFilesToHaikuImage beos bin : crashing_app ; # Make a symlink to home/config/bin/crash. AddSymlinkToHaikuImage home config bin : /beos/bin/crashing_app : crash ; +# Add timezone and keymap settings. +AddSymlinkToHaikuImage home config settings + : /boot/beos/etc/timezones/Europe/Paris : timezone ; +AddFilesToHaikuImage home config settings : US-International : Key_map ; + # Adds the source directories src/kits/storage and src/tests/servers/debug # (recursively) to the image (as /boot/home/HaikuSources/src/kits/storage # and /boot/home/HaikuSources/src/tests/servers/debug respectively). @@ -284,3 +281,24 @@ DeferredSubInclude HAIKU_TOP src tests add-ons kernel file_systems # usual). Omitting this parameter or specifying "global" will cause the given # name to be used recursively. DeferredSubInclude HAIKU_TOP src 3rdparty myproject : Jamfile.haiku : local ; + +# The following rules can be overriden to do things at different points of +# the build system execution by jam (note: we're talking about execution of +# Jamfiles, not the build actions they define): +# +# UserBuildConfigRulePostBuildTargets: +# Executed after the complete Jamfile tree has been processed. I.e. all build +# targets are known and located at this point. +# UserBuildConfigRulePreImage: +# Executed after the contents of the Haiku image has been defined, but before +# the scripts generating the images are defined. +# UserBuildConfigRulePostImage: +# Executed after the Haiku image build target has been fully defined. +# +# E.g. making use of the fact that all targets have already been located when +# UserBuildConfigRulePostBuildTargets is called, we can print the directory +# where the StyledEdit executable will be generated. +rule UserBuildConfigRulePostBuildTargets +{ + Echo "StyledEdit will appear here:" [ on StyledEdit return $(LOCATE) ] ; +}