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 : $(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} 35if $(optionalPackageDescriptions) { 36 AddTargetVariableToScript $(script) : $(optionalPackageDescriptions) 37 : optionalPackageDescriptions ; 38} 39 40# Convenience wrapper rule around BuildHaikuCD. 41rule _BuildHaikuCD haikuCD : bootFloppy 42{ 43 # _BuildHaikuCD <cd target> : <bootFloppy> ; 44 # 45 46 # build the cd 47 # HAIKU_IMAGE_EARLY_USER_SCRIPTS, HAIKU_IMAGE_LATE_USER_SCRIPTS can be 48 # specified by the user. 49 BuildHaikuCD $(haikuCD) : $(bootFloppy) : 50 $(HAIKU_CD_INIT_VARIABLES_SCRIPT) 51 $(HAIKU_IMAGE_EARLY_USER_SCRIPTS) 52 $(HAIKU_IMAGE_MAKE_DIRS_SCRIPT) 53 $(HAIKU_IMAGE_COPY_FILES_SCRIPT) 54 $(HAIKU_IMAGE_EXTRACT_FILES_SCRIPT) 55 $(HAIKU_IMAGE_LATE_USER_SCRIPTS) 56 ; 57 58 # remove the scripts we have generated 59 RmTemps $(haikuCD) : 60 $(HAIKU_CD_INIT_VARIABLES_SCRIPT) 61 $(HAIKU_IMAGE_MAKE_DIRS_SCRIPT) 62 $(HAIKU_IMAGE_COPY_FILES_SCRIPT) 63 $(HAIKU_IMAGE_EXTRACT_FILES_SCRIPT) 64 ; 65} 66 67# build the cd 68_BuildHaikuCD $(HAIKU_CD) : $(HAIKU_BOOT_FLOPPY) ; 69NotFile haiku-cd ; 70Depends haiku-cd : $(HAIKU_CD) ; 71 72RmTemps $(HAIKU_CD) : $(HAIKU_BOOT_FLOPPY) ; 73 74# Execute post-image user config rules. 75UserBuildConfigRulePostImage ; 76