imgtools/imaker/src/imaker_image.mk
changeset 1 be27ed110b50
child 584 56dd7656a965
equal deleted inserted replaced
0:044383f39525 1:be27ed110b50
       
     1 #
       
     2 # Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 # All rights reserved.
       
     4 # This component and the accompanying materials are made available
       
     5 # under the terms of the License "Symbian Foundation License v1.0"
       
     6 # which accompanies this distribution, and is available
       
     7 # at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
       
     8 #
       
     9 # Initial Contributors:
       
    10 # Nokia Corporation - initial contribution.
       
    11 #
       
    12 # Contributors:
       
    13 #
       
    14 # Description: Default iMaker image configuration
       
    15 #
       
    16 
       
    17 
       
    18 
       
    19 USE_FEATVAR    = $(call select,$(word 1,$(getsbvrominc)),invalid,0,1)
       
    20 USE_FOTA       = 0
       
    21 USE_IMGCHK     = 0
       
    22 USE_IINTPRSIS  = 0
       
    23 USE_IREADIMG   = 0
       
    24 USE_IROMBLD    = 0
       
    25 USE_OVERRIDE   = 1
       
    26 USE_ROFS       = 1,2,3
       
    27 USE_ROFSFILE   = $(call iif,$(USE_PAGING),1,0)
       
    28 USE_ROMFILE    = 1
       
    29 USE_SYMGEN     = 0
       
    30 USE_UDEB       = 0
       
    31 USE_VERGEN     = 0
       
    32 
       
    33 $(foreach rofs,1 2 3 4 5 6,\
       
    34   $(eval USE_ROFS$(rofs) = $$(if $$(findstring $(rofs),$$(filter-out :%,$$(subst :, :,$$(subst $$(,), ,$$(USE_ROFS))))),1,0)))
       
    35 
       
    36 #==============================================================================
       
    37 
       
    38 TYPE = rnd
       
    39 
       
    40 BUILD_INFOMK = image_conf_buildinfo.mk
       
    41 BUILD_NAMEMK = image_conf_naming.mk
       
    42 BUILD_YEAR   = $(YEAR)
       
    43 BUILD_WEEK   = $(WEEK)
       
    44 BUILD_NUMBER = xx
       
    45 
       
    46 COREPLAT_NAME    =
       
    47 COREPLAT_DIR     = $(CONFIGROOT)/$(COREPLAT_NAME)
       
    48 COREPLAT_VERSION =
       
    49 PLATFORM_NAME    = $(subst .,,$(COREPLAT_VERSION)$(S60_VERSION))
       
    50 PLATFORM_DIR     = $(CONFIGROOT)/$(PLATFORM_NAME)
       
    51 PRODUCT_MSTNAME  =
       
    52 PRODUCT_NAME     =
       
    53 PRODUCT_MANUFACT = Nokia
       
    54 PRODUCT_MODEL    = N00
       
    55 PRODUCT_TYPE     =
       
    56 PRODUCT_REVISION = 01
       
    57 PRODUCT_DIR      = $(PLATFORM_DIR)/$(if $(PRODUCT_MSTNAME),$(PRODUCT_MSTNAME)/)$(PRODUCT_NAME)
       
    58 
       
    59 FEATURE_VARIANT = $(PRODUCT_NAME)
       
    60 FEATVAR_IDIR    = $(call getrominc)
       
    61 
       
    62 LABEL      =
       
    63 NAME       = $(PRODUCT_NAME)$(LABEL)
       
    64 WORKDIR    = $(if $(PRODUCT_NAME),$(E32ROMBLD)/$(PRODUCT_NAME),$(CURDIR))
       
    65 WORKPREFIX = $(WORKDIR)/$(NAME)
       
    66 WORKNAME   = $(WORKPREFIX)
       
    67 
       
    68 IMAGE_HBY  = <data_caging_paths_for_iby.hrh> <Variant\Header.iby>
       
    69 IMAGE_TYPE =
       
    70 
       
    71 TRACE_IDIR     = $(addsuffix /traces,$(FEATVAR_IDIR))
       
    72 TRACE_PREFIX   =
       
    73 TRACE_SUFFIX   = _trace.txt
       
    74 TRACE_UDEBFILE = $(E32ROMBLD)/mytraces.txt
       
    75 
       
    76 OVERRIDE_CONF = OVERRIDE_REPLACE/WARN #OVERRIDE_REPLACE/ADD, OVERRIDE_REPLACE/SKIP, OVERRIDE_SKIP/ADD
       
    77 
       
    78 GENIBY_FILEPAT = *.dll *.exe *.agt *.csy *.fsy *.tsy *.drv *.nif *.pgn *.prt
       
    79 
       
    80 ARM_VERSION = ARMV5
       
    81 SOS_VERSION = #9.3, 9.4, 9.5
       
    82 S60_VERSION = #3.2, 5.0
       
    83 
       
    84 ROFS_MAXSIZE = 0x10000000
       
    85 
       
    86 CPPFILE_LIST =
       
    87 MKFILE_LIST  = $(call findfile,$(BUILD_INFOMK) $(BUILD_NAMEMK) $(LANGPACK_SYSLANGMK),$(FEATVAR_IDIR)) | $(VARIANT_MK)
       
    88 
       
    89 
       
    90 ###############################################################################
       
    91 #
       
    92 
       
    93 SOS.IMAGE.STEPS =\
       
    94   $(filter-out %POST,$(SOS.CORE.STEPS) $(SOS.VARIANT.STEPS))\
       
    95   $(filter %POST,$(SOS.CORE.STEPS) $(SOS.VARIANT.STEPS))
       
    96 
       
    97 ALL.IMAGE.STEPS = $(SOS.IMAGE.STEPS)
       
    98 
       
    99 CLEAN_WORKAREA  = del | $(WORKDIR)/* | deldir | $(WORKDIR)/*
       
   100 ALL.CLEAN.STEPS = $(ALL.IMAGE.STEPS) WORKAREA
       
   101 
       
   102 
       
   103 ###############################################################################
       
   104 # Internal macros and definitions
       
   105 
       
   106 getrominc = $(if $(call true,$(USE_FEATVAR)),$(getsbvrominc),$(CONFIGROOT) $(E32ROM))
       
   107 
       
   108 getsbvrominc =\
       
   109   $(if $(call equal,$(__i_featvar),$(FEATURE_VARIANT)),,$(eval __i_featvar := $(FEATURE_VARIANT))\
       
   110     $(eval __i_getrominc := $(shell $(PERL) -x $(IMAKER_TOOL) --incdir $(__i_featvar))))$(__i_getrominc)
       
   111 
       
   112 includeiby = $(call peval,\
       
   113   my @files = ();\
       
   114   while ($(call pquote,$1) =~ /(?:([1-6]):)?(?:<(.+?)>|"+(.+?)"+|(\S+))/g) {\
       
   115     my $$rom = (defined($$1) ? $$1 : q());\
       
   116     push(@files, ($$rom ? q(ROM_IMAGE[).$$rom.q(] {\\\n) : q()) . q(\#include ).\
       
   117       (defined($$2) ? qq(<$$2>) : q(").GetRelFname(defined($$3) ? $$3 : $$4, $(call pquote,$2)).q(")) . ($$rom ? q(\\\n}) : q()))\
       
   118   }\
       
   119   return(join(q(\\\n), @files)))
       
   120 
       
   121 define BLDROM_HDRINFO
       
   122   // Generated master oby for $($(IMAGE_TYPE)_TITLE) image creation
       
   123   //
       
   124   // Filename: $($(IMAGE_TYPE)_MSTOBY)
       
   125   // Work dir: $(call peval,GetAbsDirname(q(.)))
       
   126   // Command : $(BLDROM_CMD)
       
   127 endef
       
   128 
       
   129 define BLDROM_PLUGINFO
       
   130   // Buildrom plugins
       
   131   //
       
   132   $(call iif,$(USE_OVERRIDE),
       
   133     externaltool=override:$($(IMAGE_TYPE)_PLUGINLOG);$(if $(filter debug 127,$(VERBOSE)),debug,0)
       
   134     $(OVERRIDE_CONF))
       
   135   externaltool=obyparse:$($(IMAGE_TYPE)_PLUGINLOG);$(if $(filter debug 127,$(VERBOSE)),debug,0)
       
   136   $(call iif,$(call select,$(IMAGE_TYPE),CORE,$(USE_ROFS1)),
       
   137     $(call iif,$(USE_ROMFILE),
       
   138       OBYPARSE_ROM $(CORE_ROMFILE))
       
   139     $(call iif,$(USE_ROFSFILE),
       
   140       OBYPARSE_ROFS1 $(CORE_ROFSFILE))
       
   141   )
       
   142   $(call iif,$(USE_UDEB),
       
   143     OBYPARSE_UDEB $(call select,$(USE_UDEB),full,*,$($(IMAGE_TYPE)_UDEBFILE)))
       
   144 endef
       
   145 
       
   146 getgenfiles = $(if $1,\
       
   147   $(eval __i_cmd := $(filter geniby% write%,$(call lcase,$(call getelem,1,$1))))\
       
   148   $(if $(__i_cmd),"$(call getelem,2,$1)")\
       
   149   $(call getgenfiles,$(call restelems,$(if $(filter geniby%,$(__i_cmd)),7,$(if $(filter write%,$(__i_cmd)),4,2)),$1)))
       
   150 
       
   151 # TEMPORARY
       
   152 _buildoby = $(if $1,\
       
   153   $(eval __i_elem1 := $(call getelem,1,$1))\
       
   154   $(if $(filter geniby%,$(call lcase,$(__i_elem1))),$1,\
       
   155     geniby | $(__i_elem1) | $(call getelem,2,$1) | $(call getelem,3,$1) | \#include "%3" | end |\
       
   156     $(call _buildoby,$(call restelems,4,$1))))
       
   157 # TEMPORARY
       
   158 
       
   159 #==============================================================================
       
   160 
       
   161 BLDROM_CMD = $(BLDROM_TOOL) $(filter-out --D% -U%,$(BLR.$(IMAGE_TYPE).OPT)) $(BLR.$(IMAGE_TYPE).IDIR) $($(IMAGE_TYPE)_MSTOBY)
       
   162 
       
   163 CLEAN_BLDROM =\
       
   164   del | "$($(IMAGE_TYPE)_PREFIX).*" "$($(IMAGE_TYPE)_DIR)/tmp?.oby" "$($(IMAGE_TYPE)_DIR)/ecom*.s??" "$($(IMAGE_TYPE)_PLUGINLOG)" |\
       
   165   $(BLR.$(IMAGE_TYPE).CLEAN)
       
   166 
       
   167 BUILD_BLDROM =\
       
   168   $(if $(BLR.$(IMAGE_TYPE).BUILD),$(BLR.$(IMAGE_TYPE).BUILD),\
       
   169     echo-q | Creating $($(IMAGE_TYPE)_TITLE) SOS image |\
       
   170     cd     | $($(IMAGE_TYPE)_DIR) |\
       
   171     cmd    | $(strip $(BLDROM_CMD)) | $(BLDROM_PARSE) |\
       
   172     copy   | tmp1.oby | $($(IMAGE_TYPE)_PREFIX).tmp1.oby |\
       
   173     $(call iif,$(KEEPTEMP),,del | "tmp?.oby" "$($(IMAGE_TYPE)_PREFIX).dummy*" |)\
       
   174     $(BLR.$(IMAGE_TYPE).POST))
       
   175 
       
   176 CLEAN_MAKSYMROFS = del | $($(IMAGE_TYPE)_SYM)
       
   177 BUILD_MAKSYMROFS =\
       
   178   echo-q | Creating $($(IMAGE_TYPE)_TITLE) symbol file |\
       
   179   cmd    | $(MAKSYMROFS_TOOL) $(call pathconv,$($(IMAGE_TYPE)_LOG) $($(IMAGE_TYPE)_SYM))
       
   180 
       
   181 
       
   182 ###############################################################################
       
   183 # Targets
       
   184 
       
   185 .PHONY:\
       
   186   all flash flash-all image image-all\
       
   187   i2file
       
   188 
       
   189 all flash-all image-all: USE_SYMGEN = 1
       
   190 all flash flash-all    : ;@$(call IMAKER,$$(ALL.IMAGE.STEPS))
       
   191 
       
   192 image image-all: ;@$(call IMAKER,$$(SOS.IMAGE.STEPS))
       
   193 
       
   194 i2file: ;@$(call IMAKER,$(call ucase,$@))
       
   195 
       
   196 #==============================================================================
       
   197 
       
   198 include $(addprefix $(IMAKER_DIR)/imaker_,$(addsuffix .mk,core odp rofs2 rofs3 rofs4 uda variant))
       
   199 
       
   200 
       
   201 # END OF IMAKER_IMAGE.MK