imgtools/imaker/src/imaker_variant.mk
author lorewang
Wed, 01 Dec 2010 16:05:36 +0800
changeset 715 e0739b8406dd
parent 596 9f25be3da657
permissions -rw-r--r--
Specify extenal tool with path
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
     1
#
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
     2
# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
     3
# All rights reserved.
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
     4
# This component and the accompanying materials are made available
584
56dd7656a965 -Changed SF licence to EPL licence.
terytkon
parents: 1
diff changeset
     5
# under the terms of the License "Eclipse Public License v1.0"
1
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
     6
# which accompanies this distribution, and is available
584
56dd7656a965 -Changed SF licence to EPL licence.
terytkon
parents: 1
diff changeset
     7
# at the URL "http://www.eclipse.org/legal/epl-v10.html".
1
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
     8
#
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
     9
# Initial Contributors:
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
    10
# Nokia Corporation - initial contribution.
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
    11
#
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
    12
# Contributors:
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
    13
#
596
9f25be3da657 Updated to iMaker version 10.24.01, 14-Jun-2010.
m2lahtel <>
parents: 584
diff changeset
    14
# Description: iMaker Variant Build image configuration
1
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
    15
#
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
    16
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
    17
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
    18
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
    19
###############################################################################
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
    20
# __   __        _          _     ___      _ _    _
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
    21
# \ \ / /_ _ _ _(_)__ _ _ _| |_  | _ )_  _(_) |__| |
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
    22
#  \ V / _` | '_| / _` | ' \  _| | _ \ || | | / _` |
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
    23
#   \_/\__,_|_| |_\__,_|_||_\__| |___/\_,_|_|_\__,_|
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
    24
#
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
    25
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
    26
USE_VARIANTBLD = 0
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
    27
596
9f25be3da657 Updated to iMaker version 10.24.01, 14-Jun-2010.
m2lahtel <>
parents: 584
diff changeset
    28
PRODUCT_VARDIR   = $(if $(and $(call true,$(USE_CONE)),$(call true,$(IMAKER_MKRESTARTS))),$(CONE_OUTDIR),$(PRODUCT_DIR))
9f25be3da657 Updated to iMaker version 10.24.01, 14-Jun-2010.
m2lahtel <>
parents: 584
diff changeset
    29
1
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
    30
VARIANT_NAME     = $(TARGETNAME)
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
    31
VARIANT_ID       = $(TARGETID)
596
9f25be3da657 Updated to iMaker version 10.24.01, 14-Jun-2010.
m2lahtel <>
parents: 584
diff changeset
    32
VARIANT_DIR      = $(if $(filter $(LANGPACK_PREFIX)%,$(TARGETNAME)),$(LANGPACK_DIR),$(if\
9f25be3da657 Updated to iMaker version 10.24.01, 14-Jun-2010.
m2lahtel <>
parents: 584
diff changeset
    33
  $(filter $(CUSTVARIANT_PREFIX)%,$(TARGETNAME)),$(CUSTVARIANT_DIR),$(if\
9f25be3da657 Updated to iMaker version 10.24.01, 14-Jun-2010.
m2lahtel <>
parents: 584
diff changeset
    34
    $(filter emmc_% mcard_% uda_%,$(TARGETNAME)),$($(IMAGE_TYPE)_VARDIR),$(if\
9f25be3da657 Updated to iMaker version 10.24.01, 14-Jun-2010.
m2lahtel <>
parents: 584
diff changeset
    35
      $(filter variant%,$(TARGETNAME)),,$(PRODUCT_VARDIR)))))
9f25be3da657 Updated to iMaker version 10.24.01, 14-Jun-2010.
m2lahtel <>
parents: 584
diff changeset
    36
VARIANT_OUTDIR   = $(if $(filter CORE ROFS%,$(IMAGE_TYPE)),$($(IMAGE_TYPE)_DIR)/variant,$($(IMAGE_TYPE)_DATADIR))
1
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
    37
VARIANT_MKNAME   = variant.mk
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
    38
VARIANT_MK       = $(if $(VARIANT_DIR),$(wildcard $(VARIANT_DIR)/$(VARIANT_MKNAME)))
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
    39
596
9f25be3da657 Updated to iMaker version 10.24.01, 14-Jun-2010.
m2lahtel <>
parents: 584
diff changeset
    40
VARIANT_HBY      = $(IMAGE_PREFIX)_$(if $(filter CORE ROFS%,$(IMAGE_TYPE)),variant,datadrive).hby
1
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
    41
VARIANT_HEADER   = $(if $(VARIANT_INCDIR),$(call includeiby,$(VARIANT_HBY)))
596
9f25be3da657 Updated to iMaker version 10.24.01, 14-Jun-2010.
m2lahtel <>
parents: 584
diff changeset
    42
VARIANT_OBY      = $(basename $(VARIANT_HBY)).oby
9f25be3da657 Updated to iMaker version 10.24.01, 14-Jun-2010.
m2lahtel <>
parents: 584
diff changeset
    43
VARIANT_OVERRIDE = $(if $(filter CORE ROFS%,$(IMAGE_TYPE)),OVERRIDE_REPLACE/ADD)
9f25be3da657 Updated to iMaker version 10.24.01, 14-Jun-2010.
m2lahtel <>
parents: 584
diff changeset
    44
VARIANT_OBYDATA  = data$(call iif,$(VARIANT_OVERRIDE),-override)="%1"  "%2"$(if $(filter CORE ROFS%,$(IMAGE_TYPE)),,  %4)
1
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
    45
596
9f25be3da657 Updated to iMaker version 10.24.01, 14-Jun-2010.
m2lahtel <>
parents: 584
diff changeset
    46
VARIANT_CPDIR    = $(if $(wildcard $(VARIANT_DIR)/content/*),$(VARIANT_DIR)/content)
9f25be3da657 Updated to iMaker version 10.24.01, 14-Jun-2010.
m2lahtel <>
parents: 584
diff changeset
    47
VARIANT_INCDIR   = $(if $(wildcard $(VARIANT_DIR)/include/*),$(VARIANT_DIR)/include)
9f25be3da657 Updated to iMaker version 10.24.01, 14-Jun-2010.
m2lahtel <>
parents: 584
diff changeset
    48
VARIANT_SISDIR   = $(if $(wildcard $(VARIANT_DIR)/sis/*),$(VARIANT_DIR)/sis)
9f25be3da657 Updated to iMaker version 10.24.01, 14-Jun-2010.
m2lahtel <>
parents: 584
diff changeset
    49
VARIANT_OPCDIR   = $(if $(wildcard $(VARIANT_DIR)/opcache/*),$(VARIANT_DIR)/opcache)
9f25be3da657 Updated to iMaker version 10.24.01, 14-Jun-2010.
m2lahtel <>
parents: 584
diff changeset
    50
VARIANT_WGZDIR   = $(if $(wildcard $(VARIANT_DIR)/widget/*),$(VARIANT_DIR)/widget)
9f25be3da657 Updated to iMaker version 10.24.01, 14-Jun-2010.
m2lahtel <>
parents: 584
diff changeset
    51
VARIANT_ZIPDIR   = $(if $(wildcard $(VARIANT_DIR)/zip/*),$(VARIANT_DIR)/zip)
1
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
    52
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
    53
#==============================================================================
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
    54
596
9f25be3da657 Updated to iMaker version 10.24.01, 14-Jun-2010.
m2lahtel <>
parents: 584
diff changeset
    55
CLEAN_VARIANT =\
9f25be3da657 Updated to iMaker version 10.24.01, 14-Jun-2010.
m2lahtel <>
parents: 584
diff changeset
    56
  del | "$(VARIANT_HBY)" "$(VARIANT_OBY)" | deldir | "$(VARIANT_OUTDIR)" |\
9f25be3da657 Updated to iMaker version 10.24.01, 14-Jun-2010.
m2lahtel <>
parents: 584
diff changeset
    57
  $(CLEAN_SISINST) | $(CLEAN_OPCACHE) | $(CLEAN_WIDGET)
1
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
    58
596
9f25be3da657 Updated to iMaker version 10.24.01, 14-Jun-2010.
m2lahtel <>
parents: 584
diff changeset
    59
BUILD_VARIANT =\
9f25be3da657 Updated to iMaker version 10.24.01, 14-Jun-2010.
m2lahtel <>
parents: 584
diff changeset
    60
  echo-q | Variant target              USE_VARIANTBLD = $(call iif,$(USE_VARIANTBLD),`$(USE_VARIANTBLD)',-) |\
9f25be3da657 Updated to iMaker version 10.24.01, 14-Jun-2010.
m2lahtel <>
parents: 584
diff changeset
    61
  echo-q | Variant directory           VARIANT_DIR    = $(or $(filter -,$(VARIANT_DIR)),$(if $(VARIANT_DIR),`$(VARIANT_DIR)',-)) |\
9f25be3da657 Updated to iMaker version 10.24.01, 14-Jun-2010.
m2lahtel <>
parents: 584
diff changeset
    62
  echo-q | Variant config makefile     VARIANT_MK     = $(if $(VARIANT_MK),`$(VARIANT_MK)',-) |\
9f25be3da657 Updated to iMaker version 10.24.01, 14-Jun-2010.
m2lahtel <>
parents: 584
diff changeset
    63
  echo-q | Variant include directory   VARIANT_INCDIR = $(if $(VARIANT_INCDIR),`$(VARIANT_INCDIR)',-) |\
9f25be3da657 Updated to iMaker version 10.24.01, 14-Jun-2010.
m2lahtel <>
parents: 584
diff changeset
    64
  echo-q | Variant SIS conf            SISINST_INI    = $(if $(SISINST_INI),`$(SISINST_INI)',-)       |\
9f25be3da657 Updated to iMaker version 10.24.01, 14-Jun-2010.
m2lahtel <>
parents: 584
diff changeset
    65
  echo-q | Variant SIS directory       VARIANT_SISDIR = $(if $(VARIANT_SISDIR),`$(VARIANT_SISDIR)',-) |\
9f25be3da657 Updated to iMaker version 10.24.01, 14-Jun-2010.
m2lahtel <>
parents: 584
diff changeset
    66
  echo-q | Variant operator cache conf OPC_INI        = $(if $(OPC_INI),`$(OPC_INI)',-)               |\
9f25be3da657 Updated to iMaker version 10.24.01, 14-Jun-2010.
m2lahtel <>
parents: 584
diff changeset
    67
  echo-q | Variant operator cache dir  VARIANT_OPCDIR = $(if $(VARIANT_OPCDIR),`$(VARIANT_OPCDIR)',-) |\
9f25be3da657 Updated to iMaker version 10.24.01, 14-Jun-2010.
m2lahtel <>
parents: 584
diff changeset
    68
  echo-q | Variant widget preinst conf WIDGET_INI     = $(if $(WIDGET_INI),`$(WIDGET_INI)',-)         |\
9f25be3da657 Updated to iMaker version 10.24.01, 14-Jun-2010.
m2lahtel <>
parents: 584
diff changeset
    69
  echo-q | Variant widget preinst dir  VARIANT_WGZDIR = $(if $(VARIANT_WGZDIR),`$(VARIANT_WGZDIR)',-) |\
9f25be3da657 Updated to iMaker version 10.24.01, 14-Jun-2010.
m2lahtel <>
parents: 584
diff changeset
    70
  echo-q | Variant zip content dir     VARIANT_ZIPDIR = $(if $(VARIANT_ZIPDIR),`$(VARIANT_ZIPDIR)',-) |\
9f25be3da657 Updated to iMaker version 10.24.01, 14-Jun-2010.
m2lahtel <>
parents: 584
diff changeset
    71
  echo-q | Variant copy content dir    VARIANT_CPDIR  = $(if $(VARIANT_CPDIR),`$(VARIANT_CPDIR)',-)   |\
9f25be3da657 Updated to iMaker version 10.24.01, 14-Jun-2010.
m2lahtel <>
parents: 584
diff changeset
    72
  echo-q | Variant output directory    VARIANT_OUTDIR = $(if $(VARIANT_OUTDIR),`$(VARIANT_OUTDIR)',-) |\
1
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
    73
  $(if $(VARIANT_DIR),,\
596
9f25be3da657 Updated to iMaker version 10.24.01, 14-Jun-2010.
m2lahtel <>
parents: 584
diff changeset
    74
    error | 1 | Variable VARIANT_DIR is not set while making target $(TARGETNAME). |)\
9f25be3da657 Updated to iMaker version 10.24.01, 14-Jun-2010.
m2lahtel <>
parents: 584
diff changeset
    75
  $(if $(wildcard $(subst \,/,$(VARIANT_DIR))),,\
9f25be3da657 Updated to iMaker version 10.24.01, 14-Jun-2010.
m2lahtel <>
parents: 584
diff changeset
    76
    error | 1 | Variable VARIANT_DIR does not point to an existing directory ($(VARIANT_DIR)). |)\
9f25be3da657 Updated to iMaker version 10.24.01, 14-Jun-2010.
m2lahtel <>
parents: 584
diff changeset
    77
  $(if $(word 2,$(USE_VARIANTBLD))$(filter-out 0 1 2 3 4 5 6 e E m M u U,$(USE_VARIANTBLD)),\
9f25be3da657 Updated to iMaker version 10.24.01, 14-Jun-2010.
m2lahtel <>
parents: 584
diff changeset
    78
    error | 1 | Variable USE_VARIANTBLD is incorrectly defined. Possible values are 1 - 6$(,) e$(,) m and u. |)\
9f25be3da657 Updated to iMaker version 10.24.01, 14-Jun-2010.
m2lahtel <>
parents: 584
diff changeset
    79
  mkdir | "$(VARIANT_OUTDIR)" |\
1
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
    80
  $(if $(VARIANT_INCDIR),\
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
    81
    echo-q | Generating oby(s) for Variant image creation |\
596
9f25be3da657 Updated to iMaker version 10.24.01, 14-Jun-2010.
m2lahtel <>
parents: 584
diff changeset
    82
    geniby | $(VARIANT_HBY) | $(VARIANT_INCDIR) |\
9f25be3da657 Updated to iMaker version 10.24.01, 14-Jun-2010.
m2lahtel <>
parents: 584
diff changeset
    83
      __header__ | define _IMAGE_VARINCDIR $(call quote,$(VARIANT_INCDIR)) | *.hrh | \#include "%3" | end |\
1
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
    84
    geniby | $(VARIANT_OBY) | $(VARIANT_INCDIR) | *.iby | \#include "%3" | end |)\
596
9f25be3da657 Updated to iMaker version 10.24.01, 14-Jun-2010.
m2lahtel <>
parents: 584
diff changeset
    85
  $(if $(or $(SISINST_INI),$(VARIANT_SISDIR)),\
9f25be3da657 Updated to iMaker version 10.24.01, 14-Jun-2010.
m2lahtel <>
parents: 584
diff changeset
    86
    $(BUILD_SISINST) |)\
9f25be3da657 Updated to iMaker version 10.24.01, 14-Jun-2010.
m2lahtel <>
parents: 584
diff changeset
    87
  $(if $(or $(OPC_INI),$(VARIANT_OPCDIR)),\
1
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
    88
    $(BUILD_OPCACHE) |)\
596
9f25be3da657 Updated to iMaker version 10.24.01, 14-Jun-2010.
m2lahtel <>
parents: 584
diff changeset
    89
  $(if $(or $(WIDGET_INI),$(VARIANT_WGZDIR)),\
9f25be3da657 Updated to iMaker version 10.24.01, 14-Jun-2010.
m2lahtel <>
parents: 584
diff changeset
    90
    $(BUILD_WIDGET) |)\
9f25be3da657 Updated to iMaker version 10.24.01, 14-Jun-2010.
m2lahtel <>
parents: 584
diff changeset
    91
  $(if $(VARIANT_ZIPDIR),\
1
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
    92
    echo-q | Extracting zip content directory |\
596
9f25be3da657 Updated to iMaker version 10.24.01, 14-Jun-2010.
m2lahtel <>
parents: 584
diff changeset
    93
    cmd    | $(7ZIP_TOOL) x -y $(VARIANT_ZIPDIR)/* -o$(VARIANT_OUTDIR) |)\
1
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
    94
  $(if $(VARIANT_CPDIR),\
596
9f25be3da657 Updated to iMaker version 10.24.01, 14-Jun-2010.
m2lahtel <>
parents: 584
diff changeset
    95
    echo-q  | Copying copy content directory |\
9f25be3da657 Updated to iMaker version 10.24.01, 14-Jun-2010.
m2lahtel <>
parents: 584
diff changeset
    96
    copydir | "$(VARIANT_CPDIR)" | $(VARIANT_OUTDIR) |)\
9f25be3da657 Updated to iMaker version 10.24.01, 14-Jun-2010.
m2lahtel <>
parents: 584
diff changeset
    97
  $(call iif,$(filter CORE ROFS%,$(IMAGE_TYPE))$(USE_SOSUDA),\
9f25be3da657 Updated to iMaker version 10.24.01, 14-Jun-2010.
m2lahtel <>
parents: 584
diff changeset
    98
    geniby-r | >>$(VARIANT_OBY) | $(VARIANT_OUTDIR) |\
9f25be3da657 Updated to iMaker version 10.24.01, 14-Jun-2010.
m2lahtel <>
parents: 584
diff changeset
    99
      $(call iif,$(VARIANT_OVERRIDE),__header__ | $(VARIANT_OVERRIDE) |)\
9f25be3da657 Updated to iMaker version 10.24.01, 14-Jun-2010.
m2lahtel <>
parents: 584
diff changeset
   100
      * | $(VARIANT_OBYDATA) |\
9f25be3da657 Updated to iMaker version 10.24.01, 14-Jun-2010.
m2lahtel <>
parents: 584
diff changeset
   101
      $(call iif,$(VARIANT_OVERRIDE),__footer__ | OVERRIDE_END |) end)
1
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   102
596
9f25be3da657 Updated to iMaker version 10.24.01, 14-Jun-2010.
m2lahtel <>
parents: 584
diff changeset
   103
#  geniby-dr | >>$(VARIANT_OBY) | $(VARIANT_OUTDIR) | * | dir="%2" | end
1
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   104
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   105
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   106
# END OF IMAKER_VARIANT.MK