imgtools/imaker/src/imaker_rofs3.mk
changeset 607 378360dbbdba
parent 596 9f25be3da657
equal deleted inserted replaced
591:22486c9c7b15 607:378360dbbdba
    21 # | _ \/ _ \| __/ __| |__ /
    21 # | _ \/ _ \| __/ __| |__ /
    22 # |   / (_) | _|\__ \  |_ \
    22 # |   / (_) | _|\__ \  |_ \
    23 # |_|_\\___/|_| |___/ |___/
    23 # |_|_\\___/|_| |___/ |___/
    24 #
    24 #
    25 
    25 
    26 ROFS3_TITLE      = ROFS3
    26 ROFS3_FEAXML   = $(E32INC)/s60customswfeatures.xml
    27 ROFS3_DIR        = $(WORKDIR)/rofs3
    27 ROFS3_FEAIBY   = $(ROFS3_DIR)/s60customswfeatures.iby
    28 ROFS3_NAME       = $(NAME)
       
    29 ROFS3_PREFIX     = $(ROFS3_DIR)/$(ROFS3_NAME)
       
    30 ROFS3_IDIR       =
       
    31 ROFS3_HBY        =
       
    32 ROFS3_OBY        =
       
    33 ROFS3_OPT        =
       
    34 ROFS3_MSTOBY     = $(ROFS3_PREFIX)_rofs3_master.oby
       
    35 ROFS3_HEADER     =
       
    36 ROFS3_INLINE     =
       
    37 ROFS3_FOOTER     =
       
    38 ROFS3_TIME       = $(DAY)/$(MONTH)/$(YEAR)
       
    39 
    28 
    40 ROFS3_OBYGEN     = #geniby | $(ROFS3_PREFIX)_rofs3_collected.oby | $(E32ROMINC)/customervariant/* | *.iby | \#include "%3" | end
    29 ROFS3_ID       = $(CUSTVARIANT_ID)
       
    30 ROFS3_REVISION = $(CUSTVARIANT_REVISION)
       
    31 ROFS3_SWVERTGT = $(IMAGE_VERSDIR)\customersw.txt
       
    32 ROFS3_FWID     = customer
    41 
    33 
    42 ROFS3_VERIBY     = $(ROFS3_PREFIX)_rofs3_version.iby
    34 ROFS3_ICHKIMG += $(ROFS2_ICHKIMG)
    43 ROFS3_ROMVER     = 0.01(0)
       
    44 ROFS3_VERSION    = $(CORE_VERSION)
       
    45 ROFS3_CUSTSWFILE = $(ROFS3_PREFIX)_rofs3_customersw.txt
       
    46 ROFS3_CUSTSWINFO = $(ROFS3_VERSION)\\\n$(DAY)-$(MONTH)-$(YEAR2)
       
    47 ROFS3_FWIDFILE   = $(ROFS3_PREFIX)_rofs3_fwid.txt
       
    48 ROFS3_FWID       = customer
       
    49 ROFS3_FWIDVER    = $(ROFS3_VERSION) Customer
       
    50 ROFS3_FWIDINFO   = id=$(ROFS3_FWID)\nversion=$(ROFS3_FWIDVER)\n
       
    51 
    35 
    52 ROFS3_IMG        = $(ROFS3_PREFIX).rofs3.img
    36 ROFS3_CONECONF = $(PRODUCT_NAME)_custvariant_$(CUSTVARIANT_ID)$(addprefix _,$(CUSTVARIANT_NAME))_root.confml
    53 ROFS3_LOG        = $(ROFS3_PREFIX).rofs3.log
    37 ROFS3_CONEOPT  = --layer-wildcard=*/custvariant* --impl-tag=target:rofs3
    54 ROFS3_OUTOBY     = $(ROFS3_PREFIX).rofs3.oby
       
    55 ROFS3_SYM        = $(ROFS3_PREFIX).rofs3.symbol
       
    56 
       
    57 ROFS3_PLUGINLOG  = $(ROFS3_PREFIX)_rofs3_bldromplugin.log
       
    58 ROFS3_PAGEFILE   = $(ODP_PAGEFILE)
       
    59 ROFS3_UDEBFILE   = $(TRACE_UDEBFILE)
       
    60 
       
    61 ROFS3_ICHKLOG    = $(ROFS3_PREFIX)_rofs3_imgcheck.log
       
    62 ROFS3_ICHKOPT    = $(IMGCHK_OPT)
       
    63 ROFS3_ICHKIMG    = $(ROFS3_IMG) $(ROFS2_ICHKIMG)
       
    64 
       
    65 ROFS3_I2FDIR     = $(ROFS3_DIR)/img2file
       
    66 
       
    67 #==============================================================================
       
    68 
       
    69 define ROFS3_MSTOBYINFO
       
    70   $(BLDROM_HDRINFO)
       
    71 
       
    72   ROM_IMAGE 0        non-xip size=0x00000000
       
    73   ROM_IMAGE 1 dummy1 non-xip size=$(ROFS_MAXSIZE)
       
    74   ROM_IMAGE 2 dummy2 non-xip size=$(ROFS_MAXSIZE)
       
    75   ROM_IMAGE 3  rofs3 non-xip size=$(ROFS_MAXSIZE)
       
    76 
       
    77   $(BLDROM_PLUGINFO)
       
    78 
       
    79   // ROFS3 header
       
    80   //
       
    81   $(ROFS3_HDRINFO)
       
    82 
       
    83   ROM_IMAGE[3] {
       
    84     $(call ODP_CODEINFO,3)
       
    85     $(BLR.ROFS3.OBY)
       
    86     $(ROFS3_INLINE)
       
    87     $(ROFS3_FOOTERINFO)
       
    88   }
       
    89 endef
       
    90 
       
    91 define ROFS3_HDRINFO
       
    92   $(DEFINE) _IMAGE_WORKDIR $(ROFS3_DIR)
       
    93   $(call mac2cppdef,$(BLR.ROFS3.OPT))
       
    94   $(BLR.ROFS3.HBY)
       
    95   $(ROFS3_HEADER)
       
    96   $(if $(filter 3,$(USE_VARIANTBLD)),$(VARIANT_HEADER))
       
    97 endef
       
    98 
       
    99 define ROFS3_FOOTERINFO
       
   100   $(if $(ROFS3_TIME),time=$(ROFS3_TIME))
       
   101   $(ROFS3_FOOTER)
       
   102 endef
       
   103 
       
   104 define ROFS3_VERIBYINFO
       
   105   // Generated `$(ROFS3_VERIBY)$' for ROFS3 image creation
       
   106   $(if $(ROFS3_ROMVER),
       
   107 
       
   108     version=$(ROFS3_ROMVER))
       
   109 
       
   110   OVERRIDE_REPLACE/ADD
       
   111   $(if $(ROFS3_CUSTSWINFO),
       
   112     data-override=$(ROFS3_CUSTSWFILE)  RESOURCE_FILES_DIR\versions\customersw.txt)
       
   113   $(call iif,$(USE_FOTA),
       
   114     data-override=$(ROFS3_FWIDFILE)  RESOURCE_FILES_DIR\versions\fwid3.txt)
       
   115   OVERRIDE_END
       
   116 endef
       
   117 
       
   118 #==============================================================================
       
   119 
       
   120 CLEAN_ROFS3FILE =\
       
   121   del | "$(ROFS3_MSTOBY)" "$(ROFS3_VERIBY)" "$(ROFS3_CUSTSWFILE)" "$(ROFS3_FWIDFILE)" |\
       
   122   del | $(call getgenfiles,$(ROFS3_OBYGEN))
       
   123 
       
   124 BUILD_ROFS3FILE =\
       
   125   echo-q | Generating file(s) for ROFS3 image creation |\
       
   126   write  | $(ROFS3_MSTOBY) | $(call def2str,$(ROFS3_MSTOBYINFO)) |\
       
   127   $(call iif,$(USE_VERGEN),\
       
   128     write  | $(ROFS3_VERIBY)     | $(call def2str,$(ROFS3_VERIBYINFO)) |\
       
   129     writeu | $(ROFS3_CUSTSWFILE) | $(ROFS3_CUSTSWINFO) |\
       
   130     writeu | $(ROFS3_FWIDFILE)   | $(ROFS3_FWIDINFO) |)\
       
   131   $(ROFS3_OBYGEN)
       
   132 
    38 
   133 
    39 
   134 ###############################################################################
    40 ###############################################################################
   135 # ROFS3 pre
    41 # Customer variant
   136 
    42 
   137 CLEAN_ROFS3PRE = $(if $(filter 3,$(USE_VARIANTBLD)),$(CLEAN_CUSTVARIANT) |) $(CLEAN_ROFS3FILE)
    43 CUSTVARIANT_ROOT     = $(PRODUCT_DIR)/customer
   138 BUILD_ROFS3PRE =\
    44 CUSTVARIANT_ROOT2    = $(if $(PRODUCT_MSTNAME),$(PRODUCT_MSTDIR)/customer)
   139   $(if $(filter 3,$(USE_VARIANTBLD)),$(BUILD_CUSTVARIANT) |)\
    45 #CUSTVARIANT_ROOT3    = $(PLATFORM_DIR)/country
   140   mkcd | $(ROFS3_DIR) |\
    46 CUSTVARIANT_PREFIX   = custvariant_
   141   $(BUILD_ROFS3FILE)
    47 CUSTVARIANT_ID       = $(if $(filter $(CUSTVARIANT_PREFIX)%,$(TARGETNAME)),$(TARGETID1),00)
       
    48 CUSTVARIANT_NAME     = $(if $(filter $(CUSTVARIANT_PREFIX)%,$(TARGETNAME)),$(TARGETID2-),vanilla)
       
    49 CUSTVARIANT_REVISION = 01
       
    50 CUSTVARIANT_DIR      = $(if $(and $(call true,$(USE_CONE)),$(call true,$(IMAKER_MKRESTARTS))),$(CONE_OUTDIR),$(strip\
       
    51   $(eval __i_custvardir :=)$(foreach croot,$(sort $(filter CUSTVARIANT_ROOT%,$(.VARIABLES))),\
       
    52     $(if $(__i_custvardir),,$(eval __i_custvardir := $(if $(wildcard $($(croot))),\
       
    53       $(wildcard $($(croot))/$(CUSTVARIANT_PREFIX)$(CUSTVARIANT_ID)$(addprefix _,$(CUSTVARIANT_NAME)))))))\
       
    54   )$(or $(__i_custvardir),$(CUSTVARIANT_ROOT)/$(CUSTVARIANT_PREFIX)$(CUSTVARIANT_ID)$(addprefix _,$(CUSTVARIANT_NAME)))$(call iif,$(USE_CONE),/content))
       
    55 CUSTVARIANT_COMPLP   =
   142 
    56 
   143 #==============================================================================
    57 CUSTVARIANT_EXPORT = $(if $(filter $(CUSTVARIANT_PREFIX)%,$(TARGETNAME)),$(addprefix $(CUSTVARIANT_PREFIX)%:CUSTVARIANT_,ID NAME))
   144 # ROFS3 build
    58 TARGET_EXPORT     += $(CUSTVARIANT_EXPORT)
   145 
    59 
   146 BLR.ROFS3.IDIR = $(call dir2inc,$(ROFS3_IDIR) $(call iif,$(USE_FEATVAR),,$(FEATVAR_IDIR)))
    60 # custvariant_%
   147 BLR.ROFS3.HBY  = $(call includeiby,$(IMAGE_HBY) $(ROFS3_HBY))
    61 $(CUSTVARIANT_PREFIX)%: rofs3_$$* ;
   148 BLR.ROFS3.OBY  = $(call includeiby,$(ROFS3_OBY) $(if $(filter 3,$(USE_VARIANTBLD)),$(VARIANT_OBY)) $(call iif,$(USE_VERGEN),$(ROFS3_VERIBY)))
       
   149 BLR.ROFS3.OPT  = $(ROFS3_OPT) $(if $(filter 3,$(USE_PAGEDCODE)),$(if $(ODP_CODECOMP),-c$(ODP_CODECOMP))) -o$(notdir $(ROFS3_NAME).img) $(BLDROPT)
       
   150 BLR.ROFS3.POST = $(call iif,$(KEEPTEMP),,del | $(ROFS3_PREFIX).???)
       
   151 
       
   152 CLEAN_ROFS3 = $(CLEAN_BLDROM)
       
   153 BUILD_ROFS3 = $(BUILD_BLDROM)
       
   154 
       
   155 #==============================================================================
       
   156 # ROFS3 post
       
   157 
       
   158 CLEAN_ROFS3POST = $(CLEAN_IMGCHK) | $(CLEAN_MAKSYMROFS)
       
   159 BUILD_ROFS3POST =\
       
   160   $(call iif,$(USE_IMGCHK),$(BUILD_IMGCHK) |)\
       
   161   $(call iif,$(USE_SYMGEN),$(BUILD_MAKSYMROFS))
       
   162 
       
   163 #==============================================================================
       
   164 
       
   165 SOS.ROFS3.STEPS = $(call iif,$(USE_ROFS3),$(call iif,$(SKIPPRE),,ROFS3PRE) $(call iif,$(SKIPBLD),,ROFS3) $(call iif,$(SKIPPOST),,ROFS3POST))
       
   166 ALL.ROFS3.STEPS = $(SOS.ROFS3.STEPS)
       
   167 
    62 
   168 
    63 
   169 ###############################################################################
    64 ###############################################################################
   170 # Targets
    65 # Helps
   171 
    66 
   172 .PHONY: rofs3 rofs3-all rofs3-image rofs3-pre rofs3-check rofs3-symbol rofs3-i2file
    67 $(call add_help,CUSTVARIANT_DIR,v,(string),Overrides the VARIANT_DIR for customer variant, see the instructions of VARIANT_DIR for details.)
       
    68 $(call add_help,CUSTVARIANT_COMPLP,v,(string),Compatible language variant.)
   173 
    69 
   174 rofs3 rofs3-%  : IMAGE_TYPE = ROFS3
    70 CUSTVARIANT_HELP = $(call add_help,$(foreach croot,$(filter CUSTVARIANT_ROOT%,$(.VARIABLES)),\
   175 rofs3-all      : USE_SYMGEN = 1
    71   $(if $(wildcard $($(croot))),$(call getlastdir,$(filter %/,$(wildcard $($(croot))/$(CUSTVARIANT_PREFIX)*/))))),\
       
    72   t,Customer $$(subst $$(CUSTVARIANT_PREFIX),,$$1) variant target.)
   176 
    73 
   177 rofs3 rofs3-all: ;@$(call IMAKER,$$(ALL.ROFS3.STEPS))
    74 BUILD_HELPDYNAMIC += $(CUSTVARIANT_HELP)
   178 rofs3-image    : ;@$(call IMAKER,$$(SOS.ROFS3.STEPS))
       
   179 
       
   180 rofs3-pre      : ;@$(call IMAKER,ROFS3PRE)
       
   181 rofs3-check    : ;@$(call IMAKER,IMGCHK)
       
   182 rofs3-symbol   : ;@$(call IMAKER,MAKSYMROFS)
       
   183 
       
   184 rofs3-i2file   : USE_ROFS = 3
       
   185 rofs3-i2file   : ;@$(call IMAKER,VARIANTI2F)
       
   186 
    75 
   187 
    76 
   188 # END OF IMAKER_ROFS3.MK
    77 # END OF IMAKER_ROFS3.MK