1# Execute pre-image user config rules. 2UserBuildConfigRulePreImage ; 3 4# Set cd file name and directory defaults and locate the cd file. 5HAIKU_CD_NAME ?= $(HAIKU_DEFAULT_CD_NAME) ; 6HAIKU_CD_DIR ?= $(HAIKU_DEFAULT_CD_DIR) ; 7HAIKU_CD = $(HAIKU_CD_NAME) ; 8HAIKU_CD_LABEL ?= $(HAIKU_DEFAULT_CD_LABEL) ; 9MakeLocate $(HAIKU_CD) : $(HAIKU_CD_DIR) ; 10 11# prepare the script that initializes the shell variables 12HAIKU_CD_INIT_VARIABLES_SCRIPT = <HaikuCD>haiku.cd-init-vars ; 13local script = $(HAIKU_CD_INIT_VARIABLES_SCRIPT) ; 14MakeLocate $(script) : $(HAIKU_OUTPUT_DIR) ; 15Always $(script) ; 16 17AddVariableToScript $(script) : sourceDir : $(HAIKU_TOP) ; 18AddVariableToScript $(script) : outputDir : $(HAIKU_OUTPUT_DIR) ; 19AddVariableToScript $(script) : tmpDir : $(HAIKU_TMP_DIR) ; 20AddVariableToScript $(script) : isCD : 1 ; 21AddVariableToScript $(script) : cdLabel : $(HAIKU_CD_LABEL) ; 22AddVariableToScript $(script) : addBuildCompatibilityLibDir 23 : "export $(HOST_ADD_BUILD_COMPATIBILITY_LIB_DIR)" ; 24AddTargetVariableToScript $(script) : <build>addattr ; 25AddTargetVariableToScript $(script) : <build>copyattr ; 26AddTargetVariableToScript $(script) : <build>rc ; 27AddTargetVariableToScript $(script) : <build>resattr ; 28AddTargetVariableToScript $(script) : <build>unzip ; 29AddTargetVariableToScript $(script) : <build>generate_attribute_stores ; 30if $(HOST_RM_ATTRS_TARGET) { 31 AddTargetVariableToScript $(script) : $(HOST_RM_ATTRS_TARGET) : rmAttrs ; 32} else { 33 AddVariableToScript $(script) : rmAttrs : rm ; 34} 35 36AddPackagesAndRepositoryVariablesToContainerScript $(script) 37 : $(HAIKU_IMAGE_CONTAINER_NAME) ; 38 39# Convenience wrapper rule around BuildHaikuCD. 40rule _BuildHaikuCD haikuCD : bootFloppy 41{ 42 # _BuildHaikuCD <cd target> : <bootFloppy> ; 43 # 44 45 # build the cd 46 # HAIKU_IMAGE_EARLY_USER_SCRIPTS, HAIKU_IMAGE_LATE_USER_SCRIPTS can be 47 # specified by the user. 48 BuildHaikuCD $(haikuCD) : $(bootFloppy) : 49 $(HAIKU_CD_INIT_VARIABLES_SCRIPT) 50 $(HAIKU_IMAGE_EARLY_USER_SCRIPTS) 51 $(HAIKU_IMAGE_MAKE_DIRS_SCRIPT) 52 $(HAIKU_IMAGE_COPY_FILES_SCRIPT) 53 $(HAIKU_IMAGE_EXTRACT_FILES_SCRIPT) 54 $(HAIKU_IMAGE_LATE_USER_SCRIPTS) 55 ; 56 57 # remove the scripts we have generated 58 RmTemps $(haikuCD) : 59 $(HAIKU_CD_INIT_VARIABLES_SCRIPT) 60 $(HAIKU_IMAGE_MAKE_DIRS_SCRIPT) 61 $(HAIKU_IMAGE_COPY_FILES_SCRIPT) 62 $(HAIKU_IMAGE_EXTRACT_FILES_SCRIPT) 63 ; 64} 65 66# build the cd 67_BuildHaikuCD $(HAIKU_CD) : $(HAIKU_BOOT_FLOPPY) ; 68NotFile haiku-cd ; 69Depends haiku-cd : $(HAIKU_CD) ; 70 71RmTemps $(HAIKU_CD) : $(HAIKU_BOOT_FLOPPY) ; 72 73# Execute post-image user config rules. 74UserBuildConfigRulePostImage ; 75