sbsv2/raptor/lib/flm/e32abiv2.flm
author Mike Kinghan <mikek@symbian.org>
Wed, 06 Oct 2010 15:13:17 +0100
changeset 28 b8fa7dfeeaa1
parent 18 de5b887c98f7
permissions -rw-r--r--
Update Raptor to v2.15.2
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
13
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
     1
# Copyright (c) 2006-2010 Nokia Corporation and/or its subsidiary(-ies).
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
     2
# All rights reserved.
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
     3
# This component and the accompanying materials are made available
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
     4
# under the terms of the License "Eclipse Public License v1.0"
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
     5
# which accompanies this distribution, and is available
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
     6
# at the URL "http://www.eclipse.org/legal/epl-v10.html".
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
     7
#
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
     8
# Initial Contributors:
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
     9
# Nokia Corporation - initial contribution.
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
    10
#
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
    11
# Contributors:
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
    12
#
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
    13
# Description:
28
b8fa7dfeeaa1 Update Raptor to v2.15.2
Mike Kinghan <mikek@symbian.org>
parents: 18
diff changeset
    14
# E32 EXE/DLL ABIv2 Function Like Makefile (FLM)
13
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
    15
# Knows how to build all possible ABIV2 executables for ARM
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
    16
#
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
    17
#
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
    18
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
    19
# Feature/Binary Variation
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
    20
#
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
    21
# FEATUREVARIANTNAME != "" implies a product build configuration
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
    22
# FEATUREVARIANT == 1 implies a .mmp defined feature variant binary
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
    23
#
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
    24
# By default:
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
    25
#   Build all binaries in non-product builds *and*
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
    26
#   Only build feature variant binaries in product builds.
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
    27
#
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
    28
#   test FEATUREVARIANTNAME=="" or FEATUREVARIANT==1
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
    29
#
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
    30
# If FEATUREVARIANTSAFE is set:
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
    31
#   Only build feature invariant binaries in non-product builds *and*
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
    32
#   Only build feature variant binaries in product builds.
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
    33
#
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
    34
#   test (FEATUREVARIANTNAME=="" and FEATUREVARIANT=="") or
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
    35
#        (FEATUREVARIANTNAME!="" and FEATUREVARIANT==1)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
    36
#
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
    37
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
    38
DOBUILD:=
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
    39
ifeq ($(FEATUREVARIANTSAFE),)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
    40
  DOBUILD:=$(if $(or $(call equal,$(FEATUREVARIANTNAME),),\
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
    41
                     $(call equal,$(FEATUREVARIANT),1)),1)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
    42
else
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
    43
  DOBUILD:=$(if $(or $(and $(call equal,$(FEATUREVARIANTNAME),),\
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
    44
                           $(call equal,$(FEATUREVARIANT),)),\
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
    45
                     $(and $(call not,$(call equal,$(FEATUREVARIANTNAME),)),\
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
    46
                           $(call equal,$(FEATUREVARIANT),1))),1)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
    47
endif
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
    48
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
    49
ifeq ($(DOBUILD),1)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
    50
18
de5b887c98f7 Upgrading to Raptor 2.14
mikek
parents: 13
diff changeset
    51
$(if $(FLMDEBUG),$(info <debug><flm name='e32abiv2' target='$(TARGET)' type='$(TARGETTYPE)' outputpath='$(OUTPUTPATH)' metasource='$(METASOURCE)' postlinkfiletype='$(POSTLINKFILETYPE)' /></debug>))
de5b887c98f7 Upgrading to Raptor 2.14
mikek
parents: 13
diff changeset
    52
de5b887c98f7 Upgrading to Raptor 2.14
mikek
parents: 13
diff changeset
    53
# Enable DELETE_ON_FAILED_COMPILE work around for failed RVCT 2.2 compiles
de5b887c98f7 Upgrading to Raptor 2.14
mikek
parents: 13
diff changeset
    54
ifneq ($(DELETE_ON_FAILED_COMPILE),)
de5b887c98f7 Upgrading to Raptor 2.14
mikek
parents: 13
diff changeset
    55
RVCT22_DELETE_WORKAROUND:=|| { $$(GNURM) $$@; exit 1; }
de5b887c98f7 Upgrading to Raptor 2.14
mikek
parents: 13
diff changeset
    56
endif # ifneq ($(DELETE_ON_FAILED_COMPILE),)
13
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
    57
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
    58
# Strip switch-type parameters
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
    59
#
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
    60
POSTLINKTARGETTYPE:=$(strip $(POSTLINKTARGETTYPE))
18
de5b887c98f7 Upgrading to Raptor 2.14
mikek
parents: 13
diff changeset
    61
TARGETEXT:=$(if $(REQUESTEDTARGETEXT),$(REQUESTEDTARGETEXT),$(POSTLINKFILETYPE))
de5b887c98f7 Upgrading to Raptor 2.14
mikek
parents: 13
diff changeset
    62
13
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
    63
UID1:=$(strip $(UID1))
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
    64
UID2:=$(strip $(UID2))
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
    65
UID3:=$(strip $(UID3))
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
    66
SID:=$(strip $(SECUREID))
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
    67
VENDORID:=$(strip $(VENDORID))
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
    68
AUTOEXPORTS:=$(strip $(AUTOEXPORTS))
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
    69
DEFFILE:=$(strip $(DEFFILE))
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
    70
IMPORTLIBRARYREQUIRED:=$(strip $(IMPORTLIBRARYREQUIRED))
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
    71
EPOCALLOWDLLDATA:=$(strip $(EPOCALLOWDLLDATA))
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
    72
PAGED:=$(strip $(PAGED))
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
    73
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
    74
# the output directories
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
    75
VARIANTPLATFORM:=$(VARIANTPLATFORM)$(FEATUREVARIANTNAME)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
    76
RELEASABLEPATH:=$(RELEASEPATH)/$(VARIANTPLATFORM)/$(VARIANTTYPE)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
    77
INTERMEDIATEPATH:=$(OUTPUTPATH)/$(VARIANTPLATFORM)/$(VARIANTTYPE)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
    78
INTERMEDIATE_PLATFORM_PATH:=$(OUTPUTPATH)/$(VARIANTPLATFORM)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
    79
TRACE_MARKER_PATH:=$(OUTPUTPATH)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
    80
IMPORTLIBPATH:=$(RUNTIME_LIBS_PATH)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
    81
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
    82
# LOCALLY USED VARIABLES
28
b8fa7dfeeaa1 Update Raptor to v2.15.2
Mike Kinghan <mikek@symbian.org>
parents: 18
diff changeset
    83
ADDITIONAL_LIBS:=
13
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
    84
CLEANTARGETS:=
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
    85
WHATRELEASE:=
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
    86
28
b8fa7dfeeaa1 Update Raptor to v2.15.2
Mike Kinghan <mikek@symbian.org>
parents: 18
diff changeset
    87
LIBRARIES:=$(patsubst %.dso,%.$(IMPLIB_EXTENSION),$(LIBRARY))
b8fa7dfeeaa1 Update Raptor to v2.15.2
Mike Kinghan <mikek@symbian.org>
parents: 18
diff changeset
    88
LIBRARIES_DEBUG:=$(patsubst %.dso,%.$(IMPLIB_EXTENSION),$(LIBRARY_DEBUG))
b8fa7dfeeaa1 Update Raptor to v2.15.2
Mike Kinghan <mikek@symbian.org>
parents: 18
diff changeset
    89
13
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
    90
# Work out which new/delete library to use for binaries.
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
    91
CHECKLIB_TYPE:=symc++
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
    92
STDCPPTAGFILE:=
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
    93
ifeq ($(NOSTDCPP),1)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
    94
  ifeq ($(STDCPP),1)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
    95
    $(info <warning>STDCPP and NOSTDCPP both specified in $(PROJECT_META)</warning>)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
    96
  else
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
    97
    ifeq ($(HAS_DEDICATED_OP_NEWDEL_LIB),1)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
    98
      DEFAULT_NEWLIB:=$(DEFAULT_SYMBIAN_NEWLIB)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
    99
    endif
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   100
  endif
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   101
else
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   102
  ifeq ($(STDCPP),1)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   103
    CDEFS:=$(CDEFS) __SYMBIAN_STDCPP_SUPPORT__
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   104
    ifneq ($(SUPPORTS_STDCPP_NEWLIB),)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   105
      ifeq ($(HAS_DEDICATED_OP_NEWDEL_LIB),1)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   106
        DEFAULT_NEWLIB:=$(DEFAULT_STDCPP_NEWLIB)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   107
      endif
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   108
      CHECKLIB_TYPE:=stdc++
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   109
      STDCPPTAGFILE:=$(EPOCROOT)/epoc32/tools/tag/tag_elf
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   110
    endif
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   111
  endif
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   112
endif
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   113
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   114
# If NEWLIB is specified in the MMP file, it overrides all the past stuff.
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   115
ifeq ($(NEWLIB),)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   116
  NEWLIB:=$(DEFAULT_NEWLIB)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   117
endif
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   118
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   119
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   120
##########################################################################
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   121
## OUTPUTS - externally relevant targets that this FLM generates
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   122
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   123
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   124
ifeq ($(EXPORTLIBRARY),)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   125
  EXPORTLIBRARY:=$(TARGET)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   126
endif
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   127
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   128
# This will insert the file version between the name and the extension.
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   129
# If there is more than one dot in generated filename the inserted position will be
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   130
# BEFORE the last but two dot. E.g name1.name2.name3.dll to name1.name2{version}.name3.dll
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   131
LIBEXT:=$(lastword $(subst .,$(CHAR_SPACE) ,$(EXPORTLIBRARY)))
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   132
LIBBASE:=$(patsubst %.$(LIBEXT),%,$(EXPORTLIBRARY))
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   133
ifneq ($(findstring .,$(EXPORTLIBRARY)),)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   134
  # Please note $(EXPORTLIBRARY) doesn't include target type.
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   135
  VER_E32IMPORTLIBBASE:=$(IMPORTLIBPATH)/$(LIBBASE){$(VERSIONHEX)}.$(LIBEXT)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   136
else
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   137
  VER_E32IMPORTLIBBASE:=$(IMPORTLIBPATH)/$(EXPORTLIBRARY){$(VERSIONHEX)}
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   138
endif
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   139
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   140
# Postlinkable targets need to be linked and elf2e32'd
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   141
ifneq ($(DOPOSTLINK),)
18
de5b887c98f7 Upgrading to Raptor 2.14
mikek
parents: 13
diff changeset
   142
    E32TARGET:=$(RELEASABLEPATH)/$(TARGET)$(if $(EXPLICITVERSION),{$(VERSIONHEX)},).$(TARGETEXT)
de5b887c98f7 Upgrading to Raptor 2.14
mikek
parents: 13
diff changeset
   143
    LINK_TARGET:=$(RELEASABLEPATH)/$(TARGET)$(if $(EXPLICITVERSION),{$(VERSIONHEX)},).$(TARGETEXT).sym
de5b887c98f7 Upgrading to Raptor 2.14
mikek
parents: 13
diff changeset
   144
    MAPFILE:=$(RELEASABLEPATH)/$(TARGET).$(TARGETEXT).map
13
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   145
else
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   146
  E32TARGET:=
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   147
  LINK_TARGET:=
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   148
  MAPFILE:=
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   149
endif
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   150
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   151
# libs and klibs, on the other hand need to be archived
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   152
ifneq ($(call isoneof,$(TARGETTYPE),lib klib stdlib),)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   153
  ARTARGET:=$(RELEASABLEPATH)/$(TARGET).lib
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   154
  # We need libs and klibs before we can link stuff with them:
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   155
  LIBRARY:: $(ARTARGET)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   156
else
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   157
  ARTARGET:=
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   158
endif
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   159
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   160
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   161
ifneq ($(IMPORTLIBRARYREQUIRED),) # no dso files for plugins, animation dlls etc
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   162
  # make sure we don't build import libraries more than once for UDEB and UREL
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   163
  # Without this, wierd target-specific variable problems happen with LIBRARY in particular
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   164
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   165
  TMP_IMPORTLIBTARGET_ROOT:=$(IMPORTLIBPATH)/$(EXPORTLIBRARY)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   166
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   167
  # ABIv2 .dso
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   168
  IMPORTLIBTARGET_DSO:=
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   169
  IMPORTLIBTARGETVERSIONED_DSO:=
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   170
28
b8fa7dfeeaa1 Update Raptor to v2.15.2
Mike Kinghan <mikek@symbian.org>
parents: 18
diff changeset
   171
  BUILDMARKER_IMPORTLIBTARGET_DSO:=TARGET_$(subst :,,$(VER_E32IMPORTLIBBASE)).$(IMPLIB_EXTENSION)
b8fa7dfeeaa1 Update Raptor to v2.15.2
Mike Kinghan <mikek@symbian.org>
parents: 18
diff changeset
   172
  WHATRELEASE:=$(WHATRELEASE) $(if $(EXPLICITVERSION),,$(TMP_IMPORTLIBTARGET_ROOT).$(IMPLIB_EXTENSION))
b8fa7dfeeaa1 Update Raptor to v2.15.2
Mike Kinghan <mikek@symbian.org>
parents: 18
diff changeset
   173
  WHATRELEASE:=$(WHATRELEASE) $(VER_E32IMPORTLIBBASE).$(IMPLIB_EXTENSION)
13
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   174
  ifeq ($($(BUILDMARKER_IMPORTLIBTARGET_DSO)),)
28
b8fa7dfeeaa1 Update Raptor to v2.15.2
Mike Kinghan <mikek@symbian.org>
parents: 18
diff changeset
   175
    IMPORTLIBTARGET_DSO:=$(TMP_IMPORTLIBTARGET_ROOT).$(IMPLIB_EXTENSION)
b8fa7dfeeaa1 Update Raptor to v2.15.2
Mike Kinghan <mikek@symbian.org>
parents: 18
diff changeset
   176
    IMPORTLIBTARGETVERSIONED_DSO:=$(VER_E32IMPORTLIBBASE).$(IMPLIB_EXTENSION)
13
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   177
  endif
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   178
18
de5b887c98f7 Upgrading to Raptor 2.14
mikek
parents: 13
diff changeset
   179
  # ABIv1 .lib (for specific kits and toolchains only)
13
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   180
  IMPORTLIBTARGET_LIB:=
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   181
  IMPORTLIBTARGETVERSIONED_LIB:=
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   182
  BUILDMARKER_IMPORTLIBTARGET_LIB:=TARGET_$(subst :,,$(VER_E32IMPORTLIBBASE)).lib
18
de5b887c98f7 Upgrading to Raptor 2.14
mikek
parents: 13
diff changeset
   183
  # Only for kits that require and tools that support them
de5b887c98f7 Upgrading to Raptor 2.14
mikek
parents: 13
diff changeset
   184
  ifneq ($(SUPPORTS_ABIV1_IMPLIBS),)
13
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   185
    WHATRELEASE:=$(WHATRELEASE) $(if $(EXPLICITVERSION),,$(TMP_IMPORTLIBTARGET_ROOT).lib)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   186
    WHATRELEASE:=$(WHATRELEASE) $(VER_E32IMPORTLIBBASE).lib
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   187
    ifeq ($($(BUILDMARKER_IMPORTLIBTARGET_LIB)),)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   188
      IMPORTLIBTARGET_LIB:=$(TMP_IMPORTLIBTARGET_ROOT).lib
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   189
      IMPORTLIBTARGETVERSIONED_LIB:=$(VER_E32IMPORTLIBBASE).lib
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   190
    endif
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   191
  endif
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   192
endif
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   193
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   194
# Try to make sure that we get the right linkas name
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   195
# If linkas is specified then split it up and
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   196
# put the hex version number in the right place
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   197
ifeq ($(LINKAS),)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   198
  LINKASNAME=$(TARGET)
18
de5b887c98f7 Upgrading to Raptor 2.14
mikek
parents: 13
diff changeset
   199
  LINKASTYPE=$(TARGETEXT)
13
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   200
else
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   201
  SPLIT_LINKAS=$(subst ., ,$(LINKAS))
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   202
  LINKASNAME=$(word 1,$(SPLIT_LINKAS))
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   203
  LINKASTYPE=$(word 2,$(SPLIT_LINKAS))
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   204
endif
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   205
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   206
# ignore UID3 if it is zero
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   207
ifeq ($(UID3),00000000)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   208
  LINKASVERSIONED=$(LINKASNAME){$(VERSIONHEX)}.$(LINKASTYPE)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   209
else
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   210
  LINKASVERSIONED=$(LINKASNAME){$(VERSIONHEX)}$(if $(UID3),[$(UID3)],).$(LINKASTYPE)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   211
endif
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   212
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   213
##########################################################################
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   214
## TARGET GROUPS ##
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   215
RELEASABLES:=$(strip $(E32TARGET) $(ARTARGET) $(LINK_TARGET) $(MAPFILE))
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   216
# More targets to be added later
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   217
TARGETS:=$(strip $(E32TARGET) $(IMPORTLIBTARGET) $(LINK_TARGET) $(ARTARGET))
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   218
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   219
CREATABLEPATHS:=$(OUTPUTPATH)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   220
CREATABLEPATHS:=$(CREATABLEPATHS) $(INTERMEDIATE_PLATFORM_PATH)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   221
CREATABLEPATHS:=$(CREATABLEPATHS) $(INTERMEDIATEPATH)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   222
CREATABLEPATHS:=$(CREATABLEPATHS) $(RELEASABLEPATH)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   223
CREATABLEPATHS:=$(CREATABLEPATHS) $(RUNTIME_LIBS_PATH)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   224
CREATABLEPATHS:=$(CREATABLEPATHS) $(IMPORTLIBPATH)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   225
WHATRELEASE:=$(WHATRELEASE) $(RELEASABLES)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   226
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   227
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   228
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   229
## HIGH LEVEL Targets ##
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   230
.PHONY:: $(ALLTARGET)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   231
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   232
## GLOBAL TARGETS ############################################################
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   233
$(ALLTARGET):: $(RELEASABLES)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   234
TARGET:: $(RELEASABLES)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   235
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   236
## Internal targets ##
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   237
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   238
# Determine the name of the generated DSO file ###############################
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   239
# This is to generate the dso with the Some{Versionhex}.file.dso
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   240
# It reproduces what appears to be a problem in the current build system
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   241
# that affects messageintercept{000a0000}.esockdebug.dso whose
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   242
# filename differs from it's "linkas" name.
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   243
E32VAR:=$(subst .,$(CHAR_SPACE) ,$(TARGET))
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   244
E32SOME:=$(word 1,$(E32VAR))
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   245
E32VAR2:=$(patsubst $(E32SOME).%,%,$(TARGET))
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   246
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   247
# Separate '_SH' variables created for output into bash - Preserves '{' and '}'
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   248
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   249
ifneq ($(findstring .,$(TARGET)),)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   250
	DSODEFFILENAMEBASE:=$(E32SOME){$(VERSIONHEX)}.$(E32VAR2)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   251
else
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   252
	DSODEFFILENAMEBASE:=$(TARGET){$(VERSIONHEX)}
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   253
endif
28
b8fa7dfeeaa1 Update Raptor to v2.15.2
Mike Kinghan <mikek@symbian.org>
parents: 18
diff changeset
   254
GENERATED_DSO:=$(call dblquote,$(INTERMEDIATEPATH)/$(DSODEFFILENAMEBASE).$(IMPLIB_EXTENSION))
13
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   255
GENERATED_DEFFILE:=$(INTERMEDIATEPATH)/$(DSODEFFILENAMEBASE).def
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   256
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   257
## IMPORT LIBRARY  ###########################################################
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   258
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   259
# Static libraries will be postlinked when they are used so don't try to postlink them
28
b8fa7dfeeaa1 Update Raptor to v2.15.2
Mike Kinghan <mikek@symbian.org>
parents: 18
diff changeset
   260
ifeq ($(e32importlib_mk),)
b8fa7dfeeaa1 Update Raptor to v2.15.2
Mike Kinghan <mikek@symbian.org>
parents: 18
diff changeset
   261
  e32importlib_mk:=1
b8fa7dfeeaa1 Update Raptor to v2.15.2
Mike Kinghan <mikek@symbian.org>
parents: 18
diff changeset
   262
  include $(FLMHOME)/e32importlib.mk
b8fa7dfeeaa1 Update Raptor to v2.15.2
Mike Kinghan <mikek@symbian.org>
parents: 18
diff changeset
   263
endif
b8fa7dfeeaa1 Update Raptor to v2.15.2
Mike Kinghan <mikek@symbian.org>
parents: 18
diff changeset
   264
b8fa7dfeeaa1 Update Raptor to v2.15.2
Mike Kinghan <mikek@symbian.org>
parents: 18
diff changeset
   265
# A processed .def file is required for:
b8fa7dfeeaa1 Update Raptor to v2.15.2
Mike Kinghan <mikek@symbian.org>
parents: 18
diff changeset
   266
# 1: ABIv2 .dso and ABIv1 .lib import library generation
b8fa7dfeeaa1 Update Raptor to v2.15.2
Mike Kinghan <mikek@symbian.org>
parents: 18
diff changeset
   267
# 2: linking where the build fixes exports using a .exp file
b8fa7dfeeaa1 Update Raptor to v2.15.2
Mike Kinghan <mikek@symbian.org>
parents: 18
diff changeset
   268
# That is, in both cases, unless EXPORTUNFROZEN is being used
b8fa7dfeeaa1 Update Raptor to v2.15.2
Mike Kinghan <mikek@symbian.org>
parents: 18
diff changeset
   269
ifneq ($(or $(IMPORTLIBRARYREQUIRED),$(FIX_EXPORTS_USING_EXP_FILE)),)
b8fa7dfeeaa1 Update Raptor to v2.15.2
Mike Kinghan <mikek@symbian.org>
parents: 18
diff changeset
   270
  ifneq ($(or $(DEFFILE),$(EXPORTUNFROZEN)),)
b8fa7dfeeaa1 Update Raptor to v2.15.2
Mike Kinghan <mikek@symbian.org>
parents: 18
diff changeset
   271
    PREPPEDDEFFILE:=
b8fa7dfeeaa1 Update Raptor to v2.15.2
Mike Kinghan <mikek@symbian.org>
parents: 18
diff changeset
   272
    ifneq ($(DEFFILE),)
b8fa7dfeeaa1 Update Raptor to v2.15.2
Mike Kinghan <mikek@symbian.org>
parents: 18
diff changeset
   273
      ifeq ($(EXPORTUNFROZEN),)
b8fa7dfeeaa1 Update Raptor to v2.15.2
Mike Kinghan <mikek@symbian.org>
parents: 18
diff changeset
   274
        PREPPEDDEFFILE:=$(INTERMEDIATEPATH)/$(TARGET).prep
b8fa7dfeeaa1 Update Raptor to v2.15.2
Mike Kinghan <mikek@symbian.org>
parents: 18
diff changeset
   275
        CLEANTARGETS:=$(CLEANTARGETS) $(PREPPEDDEFFILE)
b8fa7dfeeaa1 Update Raptor to v2.15.2
Mike Kinghan <mikek@symbian.org>
parents: 18
diff changeset
   276
        $(eval $(importlibtarget_prepfile_$(BASE_ARCH)))
b8fa7dfeeaa1 Update Raptor to v2.15.2
Mike Kinghan <mikek@symbian.org>
parents: 18
diff changeset
   277
      endif
b8fa7dfeeaa1 Update Raptor to v2.15.2
Mike Kinghan <mikek@symbian.org>
parents: 18
diff changeset
   278
    endif
b8fa7dfeeaa1 Update Raptor to v2.15.2
Mike Kinghan <mikek@symbian.org>
parents: 18
diff changeset
   279
  endif
b8fa7dfeeaa1 Update Raptor to v2.15.2
Mike Kinghan <mikek@symbian.org>
parents: 18
diff changeset
   280
endif
13
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   281
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   282
ifneq ($(IMPORTLIBRARYREQUIRED),)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   283
ifneq ($(or $(DEFFILE),$(EXPORTUNFROZEN)),)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   284
# ABIv2 .dso
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   285
ifneq ($(IMPORTLIBTARGET_DSO),) # check that we haven't tried to specify this target already
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   286
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   287
  # By Now we're committed to producing a target for this DSO so it's safe to
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   288
  # set the marker that will prevent any further targets from being made.
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   289
  $(eval $(BUILDMARKER_IMPORTLIBTARGET_DSO):=1)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   290
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   291
  ifneq ($(EXPLICITVERSION),)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   292
    TARGETS:=$(strip $(TARGETS) $(IMPORTLIBTARGETVERSIONED_DSO))
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   293
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   294
    # Add this importlibrary to our global targets
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   295
    LIBRARY:: $(IMPORTLIBTARGETVERSIONED_DSO)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   296
    $(ALLTARGET):: $(IMPORTLIBTARGETVERSIONED_DSO)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   297
    TARGET:: $(IMPORTLIBTARGETVERSIONED_DSO)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   298
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   299
  else
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   300
    TARGETS:=$(strip $(TARGETS) $(IMPORTLIBTARGETVERSIONED_DSO) $(IMPORTLIBTARGET_DSO))
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   301
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   302
    # Add this importlibrary to our global targets
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   303
    LIBRARY:: $(IMPORTLIBTARGET_DSO)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   304
    $(ALLTARGET):: $(IMPORTLIBTARGETVERSIONED_DSO) $(IMPORTLIBTARGET_DSO)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   305
    TARGET:: $(IMPORTLIBTARGETVERSIONED_DSO) $(IMPORTLIBTARGET_DSO)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   306
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   307
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   308
  endif
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   309
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   310
  ifneq ($(EXPORTUNFROZEN),) # Unfrozen  - warn and create .dso as side-effect of the final postlink
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   311
    $(info <warning project='$(PROJECT_META)' component='$(COMPONENT_META)'>EXPORTUNFROZEN present in $(PROJECT_META) - unfrozen exports will be represented in import library.</warning> )
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   312
    define importlibtarget_unfrozen
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   313
      $(IMPORTLIBTARGET_DSO): $(IMPORTLIBTARGETVERSIONED_DSO)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   314
		$(call startrule,importlibtarget_unfrozen,FORCESUCCESS) \
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   315
		$(GNUCP) $$(call dblquote,$$<) $$(call dblquote,$$@) \
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   316
		$(call endrule,importlibtarget_unfrozen)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   317
    endef
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   318
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   319
    define importlibtarget_unfrozen_ver
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   320
      $(IMPORTLIBTARGETVERSIONED_DSO): $(E32TARGET)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   321
		$(call startrule,importlibversioned_unfrozen,FORCESUCCESS) \
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   322
		$(GNUCP) "$(GENERATED_DSO)" "$$@" \
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   323
		$(call endrule,importlibversioned_unfrozen)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   324
    endef
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   325
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   326
    ifeq ($(EXPLICITVERSION),)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   327
      # Generate the general dso if we aren't
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   328
      # being asked to make just the specific version.
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   329
      $(eval $(importlibtarget_unfrozen))
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   330
    endif
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   331
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   332
    $(eval $(importlibtarget_unfrozen_ver))
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   333
  else
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   334
    ifneq ($(DEFFILE),) # Frozen - use the def file and create .dso directly
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   335
      define importlibtarget_func
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   336
       $(IMPORTLIBTARGET_DSO): $(IMPORTLIBTARGETVERSIONED_DSO)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   337
	   $(call startrule,importlibtarget,FORCESUCCESS) \
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   338
	   $(GNUCP) "$$<" "$$@" \
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   339
	   $(call endrule,importlibtarget)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   340
      endef
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   341
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   342
      ifeq ($(EXPLICITVERSION),)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   343
          # Generate the general dso if we aren't
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   344
          # being asked to make just the specific version.
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   345
          $(eval $(importlibtarget_func))
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   346
      endif
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   347
28
b8fa7dfeeaa1 Update Raptor to v2.15.2
Mike Kinghan <mikek@symbian.org>
parents: 18
diff changeset
   348
      $(eval $(importlibtargetversioned_$(BASE_ARCH)))
13
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   349
    endif #  ifneq ($(DEFFILE),)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   350
  endif #  ifneq ($(EXPORTUNFROZEN),)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   351
endif #  ifneq ($(IMPORTLIBTARGET_DSO),)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   352
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   353
# ABIv1 .lib
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   354
ifneq ($(IMPORTLIBTARGETVERSIONED_LIB),) # check that we haven't tried to specify this target already
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   355
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   356
  # By Now we're committed to producing a target for this DSO so it's safe to
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   357
  # set the marker that will prevent any further targets from being made.
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   358
  $(eval $(BUILDMARKER_IMPORTLIBTARGET_LIB):=1)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   359
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   360
  define abiv1_generatelib
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   361
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   362
    ifeq ($(EXPLICITVERSION),)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   363
      LIBRARY:: $(IMPORTLIBTARGETVERSIONED_LIB) $(IMPORTLIBTARGET_LIB)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   364
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   365
    else
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   366
      LIBRARY:: $(IMPORTLIBTARGETVERSIONED_LIB)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   367
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   368
    endif
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   369
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   370
    # If frozen, a prepped .def file is used as the basis for .lib creation
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   371
    # If unfrozen, .lib files are based on the .def file generated by the final postlink
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   372
    $(IMPORTLIBTARGETVERSIONED_LIB): $(if $(EXPORTUNFROZEN),$(E32TARGET),$(PREPPEDDEFFILE))
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   373
	$(call startrule,importlibversioned_abiv1) \
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   374
        if [ -f "$(EPOCROOT)/epoc32/tools/def2dll.pl" -a -f "$(if $(EXPORTUNFROZEN),$(call dblquote,$(GENERATED_DEFFILE)),$(PREPPEDDEFFILE))" ]; then \
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   375
                 $(PERL) $(EPOCROOT)/epoc32/tools/def2dll.pl \
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   376
		--path=$(IMPORTLIBPATH) \
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   377
		--bldpath=$(INTERMEDIATEPATH) \
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   378
		--import=$(notdir $(basename $(IMPORTLIBTARGETVERSIONED_LIB))) \
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   379
		--deffile="$(if $(EXPORTUNFROZEN),$(call dblquote,$(GENERATED_DEFFILE)),$(PREPPEDDEFFILE))" \
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   380
		--linkAs=$(call dblquote,$(LINKASVERSIONED)) \
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   381
		--inter ; fi \
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   382
	$(call endrule,importlibversioned_abiv1)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   383
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   384
    ifeq ($(EXPLICITVERSION),)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   385
      $(IMPORTLIBTARGET_LIB): $(IMPORTLIBTARGETVERSIONED_LIB)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   386
	$(call startrule,importlibtarget_abiv1) \
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   387
	if [ -f $(EPOCROOT)/epoc32/tools/def2dll.pl ]; then $(GNUCP) "$$<" "$$@" ; fi \
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   388
	$(call endrule,importlibtarget_abiv1)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   389
    endif
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   390
  endef
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   391
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   392
  $(eval $(abiv1_generatelib))
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   393
endif #  ifneq ($(IMPORTLIBTARGET_LIB),)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   394
endif #  ($(or $(DEFFILE),$(EXPORTUNFROZEN)),)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   395
endif #  ifneq ($(IMPORTLIBRARYREQUIRED),)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   396
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   397
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   398
## POSTLINK ##################################################################
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   399
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   400
# Set up the name of the exports file if this is a customdll
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   401
EXPTARGET:=
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   402
ifneq ($(DOPOSTLINK),)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   403
  ifneq ($(and $(or $(STATICLIBRARY),$(ARMLIBS),$(ARMRT)),$(DEFFILE)),)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   404
    EXPTARGET:=$(INTERMEDIATE_PLATFORM_PATH)/$(notdir $(VER_E32IMPORTLIBBASE)).exp
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   405
  endif
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   406
endif
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   407
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   408
# Generating the import library is enough if TARGETTYPE=implib #############
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   409
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   410
ifneq ($(DOPOSTLINK),)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   411
# Capabilities
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   412
FINAL_CAPABILITIES:=$(if $(CAPABILITY),$(CAPABILITY),NONE)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   413
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   414
# Paging options for the old postlinker
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   415
POSTLINKER_PAGEDOPTION:=--defaultpaged
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   416
ifeq ($(PAGED),1)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   417
  POSTLINKER_PAGEDOPTION:=--paged
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   418
endif
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   419
ifeq ($(PAGED),0)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   420
  POSTLINKER_PAGEDOPTION:=--unpaged
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   421
endif
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   422
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   423
CLEANTARGETS:=$(CLEANTARGETS) $(E32TARGET)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   424
CLEANTARGETS:=$(CLEANTARGETS) $(GENERATED_DEFFILE)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   425
CLEANTARGETS:=$(CLEANTARGETS) $(GENERATED_DSO)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   426
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   427
endif # ifneq ($(DOPOSTLINK),)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   428
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   429
ifneq ($(TARGETTYPE),implib)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   430
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   431
## CUSTOM DLLS ###############################################################
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   432
# exp file
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   433
#
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   434
# This tends to help getting exported objects
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   435
# out of the arm libs and into custom dlls.
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   436
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   437
ifneq ($(EXPTARGET),)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   438
ifeq ($(TARGET_$(EXPTARGET)),)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   439
# We only need one of these exptargets for UDEB and UREL
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   440
TARGET_$(EXPTARGET):=1
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   441
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   442
EXPTARGETASMFILE:=$(INTERMEDIATE_PLATFORM_PATH)/$(notdir $(VER_E32IMPORTLIBBASE)).s
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   443
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   444
define e32expgen_func
28
b8fa7dfeeaa1 Update Raptor to v2.15.2
Mike Kinghan <mikek@symbian.org>
parents: 18
diff changeset
   445
$(EXPTARGET): $(DEFFILE) $(POSTLINKER)
13
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   446
	$(call startrule,expgen) \
28
b8fa7dfeeaa1 Update Raptor to v2.15.2
Mike Kinghan <mikek@symbian.org>
parents: 18
diff changeset
   447
	$(POSTLINKER) \
13
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   448
	   --definput=$$(call dblquote,$(DEFFILE)) \
28
b8fa7dfeeaa1 Update Raptor to v2.15.2
Mike Kinghan <mikek@symbian.org>
parents: 18
diff changeset
   449
	   --dump=a $(if $(POSTLINKER_SUPPORTS_ASMTYPE),$(POSTLINKER_ASM_OPTION),) \
13
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   450
	   --output=$(call dblquote,$(EXPTARGETASMFILE)) && \
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   451
	$(ASM) $(TARGET_ARCH_OPTION) $(AAPCS_OPTION) $(ASM_OUTPUT_OPTION) $$(call dblquote, $$@) $(EXPTARGETASMFILE) \
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   452
	$(call endrule,expgen)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   453
endef
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   454
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   455
$(eval $(e32expgen_func))
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   456
CLEANTARGETS:=$(CLEANTARGETS) $(EXPTARGET) $(EXPTARGETASMFILE)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   457
endif
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   458
endif
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   459
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   460
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   461
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   462
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   463
## SOURCE FILES ##############################################################
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   464
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   465
# Source files can be either C++ files (.cpp) or Assmbler-in-C++ files (.cia)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   466
# We have to split the two because they have the same link stage, the compile
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   467
# stage is different for each.
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   468
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   469
CPPFILEEXTENSIONS:=.cpp .CPP .Cpp .CPp .CpP .cPP .cpP .cPp .cc .CC \
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   470
	.Cc .c++ .C++ .cxx .CXX .Cxx .cXx .CxX .CXx .cC .cXX .cxX
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   471
CFILEEXTENSIONS:=.c .C
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   472
CIAFILEEXTENSIONS:=.CIA .cia .Cia .cIa .cIA .ciA .CIa .CiA
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   473
ASMFILEEXTENSIONS:=.s .S
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   474
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   475
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   476
# Extract the CPP files from our sources
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   477
CPPFILES:=$(call extractfilesoftype,$(CPPFILEEXTENSIONS),$(SOURCE))
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   478
CFILES:=$(call extractfilesoftype,$(CFILEEXTENSIONS),$(SOURCE))
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   479
ASMFILES:=$(call extractfilesoftype,$(ASMFILEEXTENSIONS),$(SOURCE))
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   480
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   481
# Find out what assember-in-c files there are
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   482
# If appropriate, work out what CPP files will be created from the assembler files
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   483
CIAFILES:=$(call extractfilesoftype,$(CIAFILEEXTENSIONS),$(SOURCE))
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   484
CIA_CPPFILES:=
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   485
ifeq ($(TRANSFORM_CIA),1)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   486
  CIA_CPPFILES:=$(call relocatefiles,$(INTERMEDIATEPATH),$(call extractandmap,$(CIAFILEEXTENSIONS),_.cpp,$(CIAFILES)))
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   487
endif
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   488
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   489
## LINK ######################################################################
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   490
# Bring together all the .o files compiled from  .cpp, .c, .s and .cia files.
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   491
# These files are stored in the "non-releasable" output diretory.
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   492
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   493
define mapcpp2object
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   494
$(call relocatefiles,$(INTERMEDIATEPATH),$(call extractandmap,$(CPPFILEEXTENSIONS),.o,$1))
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   495
endef
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   496
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   497
define mapc2object
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   498
$(call relocatefiles,$(INTERMEDIATEPATH),$(call extractandmap,$(CFILEEXTENSIONS),.o,$1))
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   499
endef
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   500
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   501
define mapasm2object
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   502
$(call relocatefiles,$(INTERMEDIATEPATH),$(call extractandmap,$(ASMFILEEXTENSIONS),.o,$1))
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   503
endef
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   504
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   505
define mapcia2object
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   506
$(call relocatefiles,$(INTERMEDIATEPATH),$(call extractandmap,$(CIAFILEEXTENSIONS),_.o,$1))
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   507
endef
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   508
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   509
# Determine what object files will be linked by using the source files.
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   510
CPPFILES_LINKOBJECTS:=$(call mapcpp2object,$(CPPFILES))
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   511
CFILES_LINKOBJECTS:=$(call mapc2object,$(CFILES))
28
b8fa7dfeeaa1 Update Raptor to v2.15.2
Mike Kinghan <mikek@symbian.org>
parents: 18
diff changeset
   512
ifeq ($(TRANSFORM_CIA),1)
13
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   513
  CIAFILES_LINKOBJECTS:=$(patsubst %_.cpp,%_.o,$(CIA_CPPFILES))
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   514
else
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   515
  CIAFILES_LINKOBJECTS:=$(call mapcia2object,$(CIAFILES))
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   516
endif
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   517
ASMFILES_LINKOBJECTS:=$(call mapasm2object,$(ASMFILES))
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   518
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   519
# Try to link object files in the order in which the source files were specified.
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   520
# This makes BC comparisons with non-Raptor builds easier.
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   521
# Use the order of the source list to establish the order of the object files:
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   522
LINKOBJECTS:=$(call relocatefiles,$(INTERMEDIATEPATH),$(SOURCE))
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   523
# Replace the file extensions of the Source files with .o (or _.o for cia files) now
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   524
# the list will contain the object files in the same order as the list of source files.
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   525
LINKOBJECTS:=$(foreach FILE,$(LINKOBJECTS),$(basename $(FILE))$(if $(filter $(addprefix %,$(CIAFILEEXTENSIONS)),$(FILE)),_).o)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   526
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   527
ifneq ($(MULTIFILE_ENABLED),)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   528
MULTIFILEOBJECT:=$(INTERMEDIATEPATH)/$(TARGET).$(POSTLINKFILETYPE)_$(VARIANTTYPE)_multifileobject.o
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   529
MULTIFILE_VIAFILE:=$(INTERMEDIATEPATH)/$(TARGET)_$(VARIANTTYPE)_multifile.via
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   530
endif
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   531
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   532
## Via file ####################################
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   533
# list of all objects to be linked
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   534
#
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   535
VIAFILE:=$(INTERMEDIATEPATH)/$(TARGET)_$(VARIANTTYPE)_objects.via
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   536
ifneq ($(GENERATELINKERFEEDBACK),)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   537
FEEDBACKFILE:=$(INTERMEDIATEPATH)/$(TARGET)_$(VARIANTTYPE)_feedback.fdb
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   538
endif
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   539
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   540
# The groupin10 macro allows us to construct a via file, 10 objects at a time
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   541
# to avoid limits on argument lengths and sizes on Windows.
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   542
# It expands to a list of commands, each of which is on a separate line.
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   543
# This causes the shell to be invoked once for each line but each line should
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   544
# be shorter than the maximum allowed by windows.
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   545
define groupin10
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   546
	$(if $1,@echo -e $(foreach L,$(wordlist 1,10,$1),"$(L)\\n") >>$(VIAFILE),)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   547
	$(if $1,$(call groupin10,$(wordlist 11,$(words $1),$1)),@true)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   548
endef
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   549
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   550
################################################
28
b8fa7dfeeaa1 Update Raptor to v2.15.2
Mike Kinghan <mikek@symbian.org>
parents: 18
diff changeset
   551
## ARMFPU postlinker option
b8fa7dfeeaa1 Update Raptor to v2.15.2
Mike Kinghan <mikek@symbian.org>
parents: 18
diff changeset
   552
#
b8fa7dfeeaa1 Update Raptor to v2.15.2
Mike Kinghan <mikek@symbian.org>
parents: 18
diff changeset
   553
POSTLINKER_FPU:=$(patsubst $(ARMFPU)>%,%,$(filter $(ARMFPU)>%,$(POSTLINKER_FPU_MAPPING)))
b8fa7dfeeaa1 Update Raptor to v2.15.2
Mike Kinghan <mikek@symbian.org>
parents: 18
diff changeset
   554
POSTLINKER_FPU:=$(if $(POSTLINKER_FPU),$(POSTLINKER_FPU),$(POSTLINKER_FPU_DEFAULT))
b8fa7dfeeaa1 Update Raptor to v2.15.2
Mike Kinghan <mikek@symbian.org>
parents: 18
diff changeset
   555
b8fa7dfeeaa1 Update Raptor to v2.15.2
Mike Kinghan <mikek@symbian.org>
parents: 18
diff changeset
   556
################################################
13
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   557
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   558
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   559
## Link-type selection:
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   560
#	runtime static libraries link via AR
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   561
ifneq ($(ARTARGET),)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   562
# Assuming that there are no libdeps in this case because this is probably one of the
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   563
# Runtime libraries which has no deps.
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   564
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   565
define artarget_func
28
b8fa7dfeeaa1 Update Raptor to v2.15.2
Mike Kinghan <mikek@symbian.org>
parents: 18
diff changeset
   566
b8fa7dfeeaa1 Update Raptor to v2.15.2
Mike Kinghan <mikek@symbian.org>
parents: 18
diff changeset
   567
# Ensure that, when generating .via files, that they do not start with a blank line - some versions of GCC's AR reject
b8fa7dfeeaa1 Update Raptor to v2.15.2
Mike Kinghan <mikek@symbian.org>
parents: 18
diff changeset
   568
# any further content in the file if the first line is empty
b8fa7dfeeaa1 Update Raptor to v2.15.2
Mike Kinghan <mikek@symbian.org>
parents: 18
diff changeset
   569
13
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   570
$(ARTARGET): $(if $(MULTIFILE_ENABLED),$(MULTIFILEOBJECT),$(LINKOBJECTS)) $(STDCPPTAGFILE)
28
b8fa7dfeeaa1 Update Raptor to v2.15.2
Mike Kinghan <mikek@symbian.org>
parents: 18
diff changeset
   571
	$(if $(MULTIFILE_ENABLED),,@echo $(if $(STDCPPTAGFILE),"$(STDCPPTAGFILE)",-n "") > $(VIAFILE);
13
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   572
	$(call groupin10,$(LINKOBJECTS)) ;)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   573
	$(call startrule,ar,FORCESUCCESS) \
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   574
	$$(call dblquote,$(AR)) $(ARCHIVER_CREATE_OPTION) $$@ $(if $(MULTIFILE_ENABLED),$(MULTIFILEOBJECT),$(COMMANDFILE_OPTION)$(VIAFILE)) \
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   575
	$(call endrule,ar)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   576
endef
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   577
$(eval $(artarget_func))
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   578
28
b8fa7dfeeaa1 Update Raptor to v2.15.2
Mike Kinghan <mikek@symbian.org>
parents: 18
diff changeset
   579
CLEANTARGETS:=$(CLEANTARGETS) $(VIAFILE)
13
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   580
endif
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   581
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   582
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   583
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   584
# Targettype is some type of DLL or EXE (or derivative)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   585
ifneq ($(LINK_TARGET),)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   586
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   587
located_ARMLIBS:=$(foreach L,$(ARMLIBS),$(wildcard $(RVCTLIB)/*/$(L)))
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   588
located_STATICLIBRARIES:=$(foreach L,$(STATICLIBRARY),$(STATIC_LIBRARY_DIR)/$(L).lib)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   589
e32abiv2_LIBS:=$(EXPTARGET) $(LINKER_STUB_LIBRARY) $(if $(STATIC_RUNTIME_LIB),$(STATIC_RUNTIME_DIR)/$(STATIC_RUNTIME_LIB),) $(located_STATICLIBRARIES)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   590
# DLLS and EXEs - These objects are linked by a linker
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   591
ifeq ($(ARMRT),)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   592
# Some of the runtime libraries do not set ARMRT because of a circular reference
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   593
# problem; we need to stop these from linking to their own dso and not link to
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   594
# the STATIC_LIBS_LIST.
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   595
ifneq ($(findstring $(TARGET).dso,$(RUNTIME_LIBS_LIST)),)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   596
# (almost) ARM RUNTIME LIBS
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   597
REDUCED_RUNTIME_LIBS_LIST:=$(subst $(TARGET).dso,,$(RUNTIME_LIBS_LIST))
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   598
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   599
ifeq ($(VARIANTTYPE),udeb)
28
b8fa7dfeeaa1 Update Raptor to v2.15.2
Mike Kinghan <mikek@symbian.org>
parents: 18
diff changeset
   600
  e32abiv2_LIBS:=$(e32abiv2_LIBS) $(addprefix $(IMPORTLIBPATH)/,$(LIBRARIES_DEBUG)) $(addprefix $(RUNTIME_LIBS_PATH)/,$(REDUCED_RUNTIME_LIBS_LIST)) $(located_ARMLIBS)
13
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   601
else
28
b8fa7dfeeaa1 Update Raptor to v2.15.2
Mike Kinghan <mikek@symbian.org>
parents: 18
diff changeset
   602
  e32abiv2_LIBS:=$(e32abiv2_LIBS) $(addprefix $(IMPORTLIBPATH)/,$(LIBRARIES)) $(addprefix $(RUNTIME_LIBS_PATH)/,$(REDUCED_RUNTIME_LIBS_LIST)) $(located_ARMLIBS)
13
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   603
endif
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   604
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   605
else
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   606
# NORMAL
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   607
#
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   608
ifeq ($(VARIANTTYPE),udeb)
28
b8fa7dfeeaa1 Update Raptor to v2.15.2
Mike Kinghan <mikek@symbian.org>
parents: 18
diff changeset
   609
  e32abiv2_LIBS:=$(e32abiv2_LIBS) $(addprefix $(IMPORTLIBPATH)/,$(LIBRARIES_DEBUG))
13
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   610
else
28
b8fa7dfeeaa1 Update Raptor to v2.15.2
Mike Kinghan <mikek@symbian.org>
parents: 18
diff changeset
   611
  e32abiv2_LIBS:=$(e32abiv2_LIBS) $(addprefix $(IMPORTLIBPATH)/,$(LIBRARIES))
13
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   612
endif
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   613
ifeq ($(HAS_DEDICATED_OP_NEWDEL_LIB),1)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   614
  e32abiv2_LIBS:=$(e32abiv2_LIBS) $(addprefix $(RUNTIME_LIBS_PATH)/,$(NEWLIB))
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   615
endif
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   616
e32abiv2_LIBS:=$(e32abiv2_LIBS) $(addprefix $(RUNTIME_LIBS_PATH)/,$(RUNTIME_LIBS_LIST)) $(addprefix $(STATIC_LIBS_PATH)/,$(STATIC_LIBS_LIST)) $(located_ARMLIBS)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   617
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   618
endif
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   619
else
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   620
# ARM RUNTIME LIBS
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   621
ifeq ($(VARIANTTYPE),udeb)
28
b8fa7dfeeaa1 Update Raptor to v2.15.2
Mike Kinghan <mikek@symbian.org>
parents: 18
diff changeset
   622
  e32abiv2_LIBS:=$(e32abiv2_LIBS) $(addprefix $(IMPORTLIBPATH)/,$(LIBRARIES_DEBUG)) $(located_ARMLIBS)
13
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   623
else
28
b8fa7dfeeaa1 Update Raptor to v2.15.2
Mike Kinghan <mikek@symbian.org>
parents: 18
diff changeset
   624
  e32abiv2_LIBS:=$(e32abiv2_LIBS) $(addprefix $(IMPORTLIBPATH)/,$(LIBRARIES)) $(located_ARMLIBS)
13
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   625
endif
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   626
endif
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   627
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   628
# NOTE: the groupin10 macro must be used before a call to the "startrule" macro
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   629
# because the code between startrule and endrule is packaged up into one
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   630
# commandline which would defeat the purpose of groupin10.
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   631
# This is undesirable because viafile generation commands appear
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   632
# outside the relevant tags but it is also unavoidable.
28
b8fa7dfeeaa1 Update Raptor to v2.15.2
Mike Kinghan <mikek@symbian.org>
parents: 18
diff changeset
   633
b8fa7dfeeaa1 Update Raptor to v2.15.2
Mike Kinghan <mikek@symbian.org>
parents: 18
diff changeset
   634
ifeq ($(e32link_mk),)
b8fa7dfeeaa1 Update Raptor to v2.15.2
Mike Kinghan <mikek@symbian.org>
parents: 18
diff changeset
   635
  e32link_mk:=1
b8fa7dfeeaa1 Update Raptor to v2.15.2
Mike Kinghan <mikek@symbian.org>
parents: 18
diff changeset
   636
  include $(FLMHOME)/e32link.mk
b8fa7dfeeaa1 Update Raptor to v2.15.2
Mike Kinghan <mikek@symbian.org>
parents: 18
diff changeset
   637
endif
b8fa7dfeeaa1 Update Raptor to v2.15.2
Mike Kinghan <mikek@symbian.org>
parents: 18
diff changeset
   638
b8fa7dfeeaa1 Update Raptor to v2.15.2
Mike Kinghan <mikek@symbian.org>
parents: 18
diff changeset
   639
# Some configurations inject exports into the final binary by creating a .lib.exp file that is then fed to
b8fa7dfeeaa1 Update Raptor to v2.15.2
Mike Kinghan <mikek@symbian.org>
parents: 18
diff changeset
   640
# the linker.  How this .lib.exp is generated depends on whether a .def file is listed to control the build
b8fa7dfeeaa1 Update Raptor to v2.15.2
Mike Kinghan <mikek@symbian.org>
parents: 18
diff changeset
   641
# or not.  Either way, the .lib.exp is guarded so as to only be generated once.
b8fa7dfeeaa1 Update Raptor to v2.15.2
Mike Kinghan <mikek@symbian.org>
parents: 18
diff changeset
   642
ifneq ($(FIX_EXPORTS_USING_EXP_FILE),)
b8fa7dfeeaa1 Update Raptor to v2.15.2
Mike Kinghan <mikek@symbian.org>
parents: 18
diff changeset
   643
  BUILDMARKER_EXPFILE:=$(call sanitise,EXPFILE_$(TARGET).lib.exp)
b8fa7dfeeaa1 Update Raptor to v2.15.2
Mike Kinghan <mikek@symbian.org>
parents: 18
diff changeset
   644
  ifeq ($(DEFFILE),)
b8fa7dfeeaa1 Update Raptor to v2.15.2
Mike Kinghan <mikek@symbian.org>
parents: 18
diff changeset
   645
    ifneq ($(AUTOEXPORTS),)     
b8fa7dfeeaa1 Update Raptor to v2.15.2
Mike Kinghan <mikek@symbian.org>
parents: 18
diff changeset
   646
      ifeq ($($(BUILDMARKER_EXPFILE)),)
b8fa7dfeeaa1 Update Raptor to v2.15.2
Mike Kinghan <mikek@symbian.org>
parents: 18
diff changeset
   647
        $(eval $(call e32link_genlibexpfile,exports))
b8fa7dfeeaa1 Update Raptor to v2.15.2
Mike Kinghan <mikek@symbian.org>
parents: 18
diff changeset
   648
        $(eval $(BUILDMARKER_EXPFILE):=$(INTERMEDIATEPATH)/$(TARGET).lib.exp)
b8fa7dfeeaa1 Update Raptor to v2.15.2
Mike Kinghan <mikek@symbian.org>
parents: 18
diff changeset
   649
      endif
b8fa7dfeeaa1 Update Raptor to v2.15.2
Mike Kinghan <mikek@symbian.org>
parents: 18
diff changeset
   650
    endif
b8fa7dfeeaa1 Update Raptor to v2.15.2
Mike Kinghan <mikek@symbian.org>
parents: 18
diff changeset
   651
  else
b8fa7dfeeaa1 Update Raptor to v2.15.2
Mike Kinghan <mikek@symbian.org>
parents: 18
diff changeset
   652
    ifeq ($($(BUILDMARKER_EXPFILE)),)
b8fa7dfeeaa1 Update Raptor to v2.15.2
Mike Kinghan <mikek@symbian.org>
parents: 18
diff changeset
   653
      $(eval $(call e32link_genlibexpfile,deffile))
b8fa7dfeeaa1 Update Raptor to v2.15.2
Mike Kinghan <mikek@symbian.org>
parents: 18
diff changeset
   654
      $(eval $(BUILDMARKER_EXPFILE):=$(INTERMEDIATEPATH)/$(TARGET).lib.exp)
b8fa7dfeeaa1 Update Raptor to v2.15.2
Mike Kinghan <mikek@symbian.org>
parents: 18
diff changeset
   655
    endif
b8fa7dfeeaa1 Update Raptor to v2.15.2
Mike Kinghan <mikek@symbian.org>
parents: 18
diff changeset
   656
  endif
b8fa7dfeeaa1 Update Raptor to v2.15.2
Mike Kinghan <mikek@symbian.org>
parents: 18
diff changeset
   657
  ADDITIONAL_LIBS:=$($(BUILDMARKER_EXPFILE))
b8fa7dfeeaa1 Update Raptor to v2.15.2
Mike Kinghan <mikek@symbian.org>
parents: 18
diff changeset
   658
endif
b8fa7dfeeaa1 Update Raptor to v2.15.2
Mike Kinghan <mikek@symbian.org>
parents: 18
diff changeset
   659
b8fa7dfeeaa1 Update Raptor to v2.15.2
Mike Kinghan <mikek@symbian.org>
parents: 18
diff changeset
   660
ifeq ($(e32postlink_mk),)
b8fa7dfeeaa1 Update Raptor to v2.15.2
Mike Kinghan <mikek@symbian.org>
parents: 18
diff changeset
   661
  e32postlink_mk:=1
b8fa7dfeeaa1 Update Raptor to v2.15.2
Mike Kinghan <mikek@symbian.org>
parents: 18
diff changeset
   662
  include $(FLMHOME)/e32postlink.mk
b8fa7dfeeaa1 Update Raptor to v2.15.2
Mike Kinghan <mikek@symbian.org>
parents: 18
diff changeset
   663
endif
b8fa7dfeeaa1 Update Raptor to v2.15.2
Mike Kinghan <mikek@symbian.org>
parents: 18
diff changeset
   664
13
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   665
define linktarget_func
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   666
## The actual link target, dependencies and build step
28
b8fa7dfeeaa1 Update Raptor to v2.15.2
Mike Kinghan <mikek@symbian.org>
parents: 18
diff changeset
   667
$(E32TARGET): $(POSTLINKDEFFILE) $(POSTLINKER) $(if $(MULTIFILE_ENABLED),$(MULTIFILEOBJECT) $(CIAFILES_LINKOBJECTS),$(LINKOBJECTS)) $(e32abiv2_LIBS) $(ADDITIONAL_LIBS) $(LINKER_ENTRYPOINT_LIBDEP) $(if $(SUPPORTS_STDCPP_NEWLIB),$(CHECKLIB)) $(if $(LINKERFEEDBACK_STAGE2),$(FEEDBACKFILE),) $(if $(HAVE_ORDERONLY),|,) $(EPOCROOT)/epoc32/build/TEM_LIB
13
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   668
	$(if $(MULTIFILE_ENABLED),,@echo -n "" > $(VIAFILE);
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   669
	$(call groupin10,$(LINKOBJECTS)) ;)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   670
	$(call startrule,linkandpostlink) \
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   671
	$(if $(PERTURBSTARTTIME),$(RANSLEEP) $(PERTURBMSECS) ;,) \
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   672
	$(if $(SUPPORTS_STDCPP_NEWLIB),$(if $(located_STATICLIBRARIES),$(CHECKLIB) $(CHECKLIB_TYPE) --elf $(call dblquote,$(located_STATICLIBRARIES)) &&,),) \
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   673
	$(LD) $(LINKER_MISC_FLAGS) $(LINKER_DEFAULT_LIB_PATHS) $(SYMBIAN_LINK_FLAGS) $(if $(DEBUG_INFO),$(LINKER_DEBUG_OPTION),$(LINKER_NODEBUG_OPTION)) \
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   674
	  $(if $(ARMLIBS),$(LD_WARNINGS_SUPPRESSION_ARMLIBS),) \
28
b8fa7dfeeaa1 Update Raptor to v2.15.2
Mike Kinghan <mikek@symbian.org>
parents: 18
diff changeset
   675
	  $(if $(findstring EXE,$(POSTLINKTARGETTYPE)),$(if $(TREAT_EXES_AS_SHARED),$(SHARED_OBJECT_OPTION),),$(SHARED_OBJECT_OPTION)) \
b8fa7dfeeaa1 Update Raptor to v2.15.2
Mike Kinghan <mikek@symbian.org>
parents: 18
diff changeset
   676
	  $(SPLIT_OPTION) \
13
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   677
	  $(RW_BASE) \
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   678
	  $(LINKER_ARCH_OPTION) \
28
b8fa7dfeeaa1 Update Raptor to v2.15.2
Mike Kinghan <mikek@symbian.org>
parents: 18
diff changeset
   679
	  $(SYMVER_OPTION) \
b8fa7dfeeaa1 Update Raptor to v2.15.2
Mike Kinghan <mikek@symbian.org>
parents: 18
diff changeset
   680
	  $(if $(SO_NAME_OPTION),$(SO_NAME_OPTION)=$(call dblquote,$(LINKASVERSIONED)),) \
b8fa7dfeeaa1 Update Raptor to v2.15.2
Mike Kinghan <mikek@symbian.org>
parents: 18
diff changeset
   681
	  $(LINKER_ENTRY_OPTION)=$(LINKER_ENTRYPOINT_SETTING) \
b8fa7dfeeaa1 Update Raptor to v2.15.2
Mike Kinghan <mikek@symbian.org>
parents: 18
diff changeset
   682
	  $(if $(NEED_ENTRYPOINT_LIBRARY),$(LINKER_ENTRYPOINT_LIBDEP),) \
b8fa7dfeeaa1 Update Raptor to v2.15.2
Mike Kinghan <mikek@symbian.org>
parents: 18
diff changeset
   683
	  $(if $(ADDITIONAL_LIBS),$(call dblquote,$(ADDITIONAL_LIBS)),) \
13
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   684
	  -o $$(call dblquote,$(LINK_TARGET)) \
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   685
	  $(if $(LTCG),$(LTCG_OPTION),) \
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   686
	  $(LINKER_SYMBOLS_OPTION) $(LINKER_SYMBOLS_FILE_OPTION)=$(call dblquote,$(MAPFILE)) \
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   687
  	  $(LINKEROPTION) \
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   688
	  $(if $(MULTIFILE_ENABLED),$(call dblquote,$(MULTIFILEOBJECT) $(CIAFILES_LINKOBJECTS)),$(COMMANDFILE_OPTION)$(call dblquote,$(VIAFILE))) \
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   689
      $(if $(GENERATELINKERFEEDBACK),$(FEEDBACK_OPTION)$(call dblquote,$(FEEDBACKFILE))) \
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   690
	  $(if $(LINKER_ADD_STATIC_RUNTIME),$(if $(STATIC_RUNTIME_LIB),$(LINKER_GROUP_START_OPTION) $(STATIC_RUNTIME_DIR)/$(STATIC_RUNTIME_LIB) $(LINKER_GROUP_END_OPTION),)) \
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   691
	  $(call dblquote,$(e32abiv2_LIBS)) $(LINKER_DEFAULT_LIBS) && \
28
b8fa7dfeeaa1 Update Raptor to v2.15.2
Mike Kinghan <mikek@symbian.org>
parents: 18
diff changeset
   692
	$(call e32postlink_$(BASE_ARCH)) \
13
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   693
	  $(if $(SAVESPACE),$(if $(EXPORTUNFROZEN),,&& { $(GNURM) -rf $(INTERMEDIATEPATH); true; })) \
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   694
	$(call endrule,linkandpostlink)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   695
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   696
$(MAPFILE): $(E32TARGET)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   697
$(LINK_TARGET): $(E32TARGET)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   698
endef
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   699
ifneq ($(DOPOSTLINK),)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   700
$(eval $(linktarget_func))
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   701
endif # ifneq ($(DOPOSTLINK),)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   702
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   703
CLEANTARGETS:=$(CLEANTARGETS) $(VIAFILE) $(if $(GENERATELINKERFEEDBACK),$(FEEDBACKFILE)) $(if $(MULTIFILE_ENABLED),$(MULTIFILEOBJECT))
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   704
WHATRELEASE:=$(WHATRELEASE) $(MAPFILE)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   705
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   706
endif # if TARGETTYPE lib
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   707
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   708
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   709
## Run trace compiler ##############################################
28
b8fa7dfeeaa1 Update Raptor to v2.15.2
Mike Kinghan <mikek@symbian.org>
parents: 18
diff changeset
   710
# The following variable defines a prereq that source code will 
b8fa7dfeeaa1 Update Raptor to v2.15.2
Mike Kinghan <mikek@symbian.org>
parents: 18
diff changeset
   711
# depend on so that tracing happens before compilation.  Must be 
b8fa7dfeeaa1 Update Raptor to v2.15.2
Mike Kinghan <mikek@symbian.org>
parents: 18
diff changeset
   712
# blank by default so that if tracing is off then there will be
b8fa7dfeeaa1 Update Raptor to v2.15.2
Mike Kinghan <mikek@symbian.org>
parents: 18
diff changeset
   713
# no dependency.  The tracecompiler code will set it if this
b8fa7dfeeaa1 Update Raptor to v2.15.2
Mike Kinghan <mikek@symbian.org>
parents: 18
diff changeset
   714
# project actually does depend on trace-generated headers:
b8fa7dfeeaa1 Update Raptor to v2.15.2
Mike Kinghan <mikek@symbian.org>
parents: 18
diff changeset
   715
TRACE_THISCOMPONENT_ALLRULE:=
b8fa7dfeeaa1 Update Raptor to v2.15.2
Mike Kinghan <mikek@symbian.org>
parents: 18
diff changeset
   716
b8fa7dfeeaa1 Update Raptor to v2.15.2
Mike Kinghan <mikek@symbian.org>
parents: 18
diff changeset
   717
# Tracing requires a UID to make uniquely numbered trace points
13
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   718
ifeq ($(UID3),)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   719
 ifeq ($(UID2),)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   720
  USE_TRACE_COMPILER:=
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   721
 else
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   722
  UID_TC:=$(UID2)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   723
 endif
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   724
else
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   725
 UID_TC:=$(UID3)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   726
endif
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   727
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   728
# USE_TRACE_COMPILER defaults to blank in Raptor config.
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   729
# Users can turn TC on by setting it to 1 in user config.
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   730
ifneq ($(USE_TRACE_COMPILER),)
18
de5b887c98f7 Upgrading to Raptor 2.14
mikek
parents: 13
diff changeset
   731
  # TARGETEXT is already set
13
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   732
  include $(FLMHOME)/tracecompiler.mk
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   733
  WHATRELEASE:=$(WHATRELEASE) $(TRACE_DICTIONARY) $(AUTOGEN_HEADER)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   734
endif
28
b8fa7dfeeaa1 Update Raptor to v2.15.2
Mike Kinghan <mikek@symbian.org>
parents: 18
diff changeset
   735
###################################################################
13
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   736
28
b8fa7dfeeaa1 Update Raptor to v2.15.2
Mike Kinghan <mikek@symbian.org>
parents: 18
diff changeset
   737
b8fa7dfeeaa1 Update Raptor to v2.15.2
Mike Kinghan <mikek@symbian.org>
parents: 18
diff changeset
   738
##
13
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   739
CC_CPPONLY_ARGS:=$(SYMBIAN_CCFLAGS) $(if $(DEBUG_INFO),-g) $(DEBUG_FORMAT) \
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   740
  $(RUNTIME_SYMBOL_VISIBILITY_OPTION) $(EXCEPTIONS) \
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   741
  $(CC_WARNINGS_CONTROL_OPTION) $(CC_ERRORS_CONTROL_OPTION) \
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   742
  $(TARGET_ARCH_OPTION) $(ENUM_OPTION) $(OWN_LIBRARY_OPTION) $(FPMODE_OPTION) \
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   743
  $(EXPORT_VTBL_OPTION) $(NO_UNALIGNED_ACCESS) $(VFE_OPTION) $(AAPCS_OPTION) \
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   744
  $(CPPONLYOPTION) $(INSTRUCTION_SET) \
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   745
  $(if $(ALWAYS_BUILD_AS_ARM),$(ARM_INSTRUCTION_SET),$(THUMB_INSTRUCTION_SET) $(call makemacrodef,-D,$(COMPILER_THUMB_DEFINES))) \
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   746
  $(COMPILER_FPU_OPTION)$(if $(ARMFPU),$(ARMFPU),$(COMPILER_FPU_DEFAULT))
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   747
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   748
## COMPILE CPP Files #################################################################
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   749
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   750
# For ARMCC we can compile all sourcefiles with one invocation
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   751
# The pathprep macro is used to make sure that forward slashes in options
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   752
# are not interpreted as being paths by CYGWIN on Windows.  On windows
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   753
# pathprep makes a forward slash into two.
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   754
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   755
# The majority of ARMCC arguments are common across all compiler invocations
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   756
# Order is significant here in that OPTION_REPLACE here and in ABLD should
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   757
# have the same impact
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   758
CC_CORE_ARGS:=$(SYMBIAN_CCFLAGS) $(if $(DEBUG_INFO),-g) $(DEBUG_FORMAT) \
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   759
  $(RUNTIME_SYMBOL_VISIBILITY_OPTION) $(EXCEPTIONS) \
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   760
  $(CC_WARNINGS_CONTROL_OPTION) $(CC_ERRORS_CONTROL_OPTION) \
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   761
  $(TARGET_ARCH_OPTION) $(ENUM_OPTION) $(OWN_LIBRARY_OPTION) $(FPMODE_OPTION) \
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   762
  $(EXPORT_VTBL_OPTION) $(NO_UNALIGNED_ACCESS) $(VFE_OPTION) $(AAPCS_OPTION) \
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   763
  $(COMPILE_ONLY_OPTION) $(INSTRUCTION_SET) \
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   764
  $(if $(ALWAYS_BUILD_AS_ARM),$(ARM_INSTRUCTION_SET),$(THUMB_INSTRUCTION_SET) $(call makemacrodef,-D,$(COMPILER_THUMB_DEFINES))) \
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   765
  $(COMPILER_FPU_OPTION)$(if $(ARMFPU),$(ARMFPU),$(COMPILER_FPU_DEFAULT))
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   766
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   767
ifeq ($(STDCPP),1)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   768
SYSTEMINCLUDE:=$(SYSTEMINCLUDE) $(call concat, $(COMPILER_SYSTEM_INCLUDE_OPTION),$(call dblquote,$(STDCPP_INCLUDE)))
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   769
endif
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   770
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   771
define option_replace
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   772
  # Process a single, combined, item of the form 'search<->replace' in order to modify the command line tool call
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   773
  # We split this into its component arguments for use in substitutions
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   774
  # Spaces will have been escaped elsewhere to maintain distinct words, so we resurrect these
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   775
  # after the split.
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   776
  SEARCH:=$(subst %20,$(CHAR_SPACE),$(word 1,$(subst <->,$(CHAR_SPACE),$(1))))
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   777
  REPLACE:=$(subst %20,$(CHAR_SPACE),$(word 2,$(subst <->,$(CHAR_SPACE),$(1))))
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   778
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   779
  # Depending on whether there's a wildcard in the search, we may require either a normal $(subst) or a $(patsubst)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   780
  PATSUBST:=$$(if $$(findstring %,$$(SEARCH)),1,)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   781
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   782
  ifeq ($$(PATSUBST),1)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   783
    CC_CORE_ARGS:=$$(patsubst $$(SEARCH),$$(REPLACE),$$(CC_CORE_ARGS))
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   784
  else
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   785
    CC_CORE_ARGS:=$$(subst $$(SEARCH),$$(REPLACE),$$(CC_CORE_ARGS))
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   786
  endif
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   787
endef
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   788
$(foreach ITEM,$(OPTION_REPLACE_COMPILER),$(eval $(call option_replace,$(ITEM))))
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   789
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   790
define e32abiv2_compile
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   791
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   792
$(eval DEPENDFILENAME:=$(1).d)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   793
$(eval DEPENDFILE:=$(wildcard $(DEPENDFILENAME)))
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   794
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   795
# $4 is for language specific options (e.g. C++ vs C)
28
b8fa7dfeeaa1 Update Raptor to v2.15.2
Mike Kinghan <mikek@symbian.org>
parents: 18
diff changeset
   796
$(1): $(2) $(PROJECT_META) $(if $(MULTIFILE_ENABLED),,$(if $(DEPENDFILE),,RESOURCE BITMAP EXPORT)) $(if $(LINKERFEEDBACK_STAGE2),$(FEEDBACKFILE),) | $(TRACE_THISCOMPONENT_ALLRULE) 
13
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   797
	$(call startrule,compile,,$(2))		\
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   798
		$(if $(PERTURBSTARTTIME), $(RANSLEEP) $(PERTURBMSECS) ;,) \
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   799
		$(if $(MULTIFILE_ENABLED), echo $(2) $(3) > $(MULTIFILE_VIAFILE) ;,) \
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   800
		$(CC) $(LICENSERETRY_OPTION) \
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   801
			$(CC_CORE_ARGS) \
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   802
			$(OPTION_COMPILER) $(if $(MULTIFILE_ENABLED),$(4),$(3)) \
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   803
			$(if $(LTCG),$(LTCG_OPTION),) \
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   804
			$(if $(USE_PROFILER_FEEDBACK),--profile=$(call dblquote,$(ARM_PROFILER_FILE)),) \
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   805
			$(call makemacrodef,-D,$(COMPILER_INTERWORK_DEFINES) $(CDEFS))				\
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   806
			$(if $(PREINCLUDE),$(PREINCLUDE_OPTION) ,)$(call concat, $(PREINCLUDE_OPTION) ,$(call dblquote,$(PREINCLUDE)))\
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   807
			$(if $(SET_ARMINC),$(if $(RVCTINC),$(COMPILER_SYSTEM_INCLUDE_OPTION)$(call dblquote,$(RVCTINC)),),)       \
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   808
			$(COMPILER_SYSTEM_INCLUDE_OPTION)$$(call dblquote,$$(<D))                                                      \
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   809
			$(if $(USERINCLUDE),$(COMPILER_SYSTEM_INCLUDE_OPTION),)$(call concat, $(COMPILER_SYSTEM_INCLUDE_OPTION),$(call dblquote,$(USERINCLUDE)))      \
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   810
			$(if $(SYSTEMINCLUDE),$(COMPILER_SYSTEM_INCLUDE_OPTION),)$(call concat, $(COMPILER_SYSTEM_INCLUDE_OPTION),$(call dblquote,$(SYSTEMINCLUDE)))  \
28
b8fa7dfeeaa1 Update Raptor to v2.15.2
Mike Kinghan <mikek@symbian.org>
parents: 18
diff changeset
   811
			$(if $(NOHIDEALL),$(COMPILER_NO_HIDE_ALL_OPTION),) \
13
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   812
			$(if $(NO_DEPEND_GENERATE),,$(DEPEND_OPTION) $(call dblquote,$(1).d)) \
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   813
			$(if $(LINKERFEEDBACK_STAGE2),$(FEEDBACK_OPTION)$(call dblquote,$(FEEDBACKFILE))) \
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   814
			$(if $(MULTIFILE_ENABLED),--multifile $(OUTPUT_OPTION) $(MULTIFILEOBJECT) \
18
de5b887c98f7 Upgrading to Raptor 2.14
mikek
parents: 13
diff changeset
   815
			--via $$(call dblquote, $(MULTIFILE_VIAFILE)),$(OUTPUT_OPTION) $$@ $$(call dblquote, $$<)) $(if $(USE_RVCT22_DELETE_WORKAROUND),$(RVCT22_DELETE_WORKAROUND)) \
13
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   816
	$(call endrule,compile)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   817
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   818
ifeq ($(NO_DEPEND_GENERATE),)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   819
  CLEANTARGETS:=$$(CLEANTARGETS) $(DEPENDFILENAME)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   820
endif
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   821
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   822
ifneq ($(DEPENDFILE),)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   823
  ifeq ($(NO_DEPEND_INCLUDE),)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   824
    ifeq ($(filter %CLEAN,$(call uppercase,$(MAKECMDGOALS))),)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   825
      -include $(DEPENDFILE)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   826
    endif
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   827
  endif
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   828
endif
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   829
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   830
# individual source file compilation
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   831
SOURCETARGET_$(call sanitise,$(2)): $(1)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   832
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   833
endef
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   834
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   835
# Evaluate .cpp and .c files in one go for multifile, cannot do in separate steps since we have the same target.
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   836
# This implementation means the .c files will always get put at the end of the .via file. Maybe there is a better way to do this?
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   837
$(if $(MULTIFILE_ENABLED),$(eval $(call e32abiv2_compile,$(MULTIFILEOBJECT),$(CPPFILES),$(CFILES),$(CPP_LANG_OPTION))),$(foreach F,$(CPPFILES),$(eval $(call e32abiv2_compile,$(call mapcpp2object,$(F)),$(F),$(CPP_LANG_OPTION)))))
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   838
$(if $(MULTIFILE_ENABLED),,$(foreach F,$(CFILES),$(eval $(call e32abiv2_compile,$(call mapc2object,$(F)),$(F),$(C_LANG_OPTION)))))
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   839
ifneq ($(TRANSFORM_CIA),1)
28
b8fa7dfeeaa1 Update Raptor to v2.15.2
Mike Kinghan <mikek@symbian.org>
parents: 18
diff changeset
   840
  $(if $(MULTIFILE_ENABLED),,$(foreach F,$(CIAFILES),$(eval $(call e32abiv2_compile,$(call mapcia2object,$(F)),$(F),$(CPP_LANG_OPTION) $(COMPILER_CIA_FLAGS) $(call makemacrodef,-D,$(CIADEFS))))))
13
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   841
endif
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   842
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   843
CLEANTARGETS:=$(CLEANTARGETS) $(if $(MULTIFILE_ENABLED),$(MULTIFILE_VIAFILE) $(MULTIFILEOBJECT),$(CPPFILES_LINKOBJECTS) $(CFILES_LINKOBJECTS) $(CIAFILES_LINKOBJECTS)) $(if $(GENERATELINKERFEEDBACK),$(FEEDBACKFILE))
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   844
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   845
## Listing target ###################################################
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   846
# Very similar to compile, apart from the extra flags passed to the
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   847
# compile and different output options
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   848
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   849
define map2listfile
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   850
$(call relocatefiles,$(INTERMEDIATEPATH),$(call extractandmap,$(CPPFILEEXTENSIONS) $(CFILEEXTENSIONS),.lis,$1))
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   851
endef
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   852
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   853
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   854
define e32abiv2_cpponly
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   855
# $1 is the sourcefile
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   856
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   857
$(eval CPPONLYTARGET:=$(strip $(call extractandmap,$(CPPFILEEXTENSIONS) $(CFILEEXTENSIONS),.$(subst _,.,$(call sanitise,$(FULLVARIANTPATH))).pre,$1)))
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   858
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   859
CPPONLY:: $(CPPONLYTARGET)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   860
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   861
$(CPPONLYTARGET): $(1) $(PROJECT_META)  $(if $(DEPENDFILE),,RESOURCE BITMAP EXPORT)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   862
	$(call startrule,e32cpponly,,$(1))		\
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   863
		$(if $(PERTURBSTARTTIME), $(RANSLEEP) $(PERTURBMSECS) ;,) \
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   864
		$(CC) $(LICENSERETRY_OPTION) $(SYMBIAN_CCFLAGS) \
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   865
			$(CC_CPPONLY_ARGS) \
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   866
			$(OPTION_COMPILER) 						\
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   867
			$(call makemacrodef,-D,$(COMPILER_INTERWORK_DEFINES) $(CDEFS))				\
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   868
			$(if $(PREINCLUDE),$(PREINCLUDE_OPTION) ,)$(call concat, $(PREINCLUDE_OPTION) ,$(call dblquote,$(PREINCLUDE)))\
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   869
			$(if $(SET_ARMINC),$(if $(RVCTINC),$(COMPILER_SYSTEM_INCLUDE_OPTION)$(call dblquote,$(RVCTINC)),),)       \
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   870
			$(COMPILER_SYSTEM_INCLUDE_OPTION)$$(call dblquote,$$(<D))                                                   \
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   871
			$(if $(USERINCLUDE),$(COMPILER_SYSTEM_INCLUDE_OPTION),)$(call concat, $(COMPILER_SYSTEM_INCLUDE_OPTION),$(call dblquote,$(USERINCLUDE)))      \
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   872
			$(if $(SYSTEMINCLUDE),$(COMPILER_SYSTEM_INCLUDE_OPTION),)$(call concat, $(COMPILER_SYSTEM_INCLUDE_OPTION),$(call dblquote,$(SYSTEMINCLUDE)))  \
28
b8fa7dfeeaa1 Update Raptor to v2.15.2
Mike Kinghan <mikek@symbian.org>
parents: 18
diff changeset
   873
			$(if $(NOHIDEALL),$(COMPILER_NO_HIDE_ALL_OPTION),) \
18
de5b887c98f7 Upgrading to Raptor 2.14
mikek
parents: 13
diff changeset
   874
			$$(call dblquote, $$<) $(OUTPUT_OPTION) $$(@) $(if $(USE_RVCT22_DELETE_WORKAROUND),$(RVCT22_DELETE_WORKAROUND)) \
13
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   875
	$(call endrule,e32cpponly)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   876
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   877
CLEANTARGETS:=$$(CLEANTARGETS) $(CPPONLYTARGET)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   878
endef
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   879
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   880
ifneq ($(filter CPPONLY,$(call uppercase,$(MAKECMDGOALS))),)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   881
$(foreach F,$(CPPFILES) $(CFILES),$(eval $(call e32abiv2_cpponly,$(F))))
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   882
endif
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   883
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   884
define e32abiv2_listing
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   885
# $1 is the sourcefile
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   886
18
de5b887c98f7 Upgrading to Raptor 2.14
mikek
parents: 13
diff changeset
   887
$(eval LISTINGTARGET:=$(strip $(call extractandmap,$(CPPFILEEXTENSIONS) $(CFILEEXTENSIONS),.$(subst _,.,$(call sanitise,$(FULLVARIANTPATH))).$(TARGET).$(TARGETEXT).lst,$1)))
13
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   888
$(eval DEPENDFILENAME:=$(call map2listfile,$1).d)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   889
$(eval DEPENDFILE:=$(wildcard $(DEPENDFILENAME)))
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   890
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   891
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   892
LISTING:: $(LISTINGTARGET)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   893
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   894
$(LISTINGTARGET): $(1) $(PROJECT_META)  $(if $(DEPENDFILE),,RESOURCE BITMAP EXPORT)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   895
	$(call startrule,e32listing,,$(1))		\
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   896
		$(if $(PERTURBSTARTTIME), $(RANSLEEP) $(PERTURBMSECS) ;,) \
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   897
		$(CC) $(LICENSERETRY_OPTION) $(SYMBIAN_CCFLAGS) \
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   898
			$(CC_CORE_ARGS) \
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   899
			$(LISTING_OPTION)		            	\
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   900
			$(OPTION_COMPILER) 						\
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   901
			$(call makemacrodef,-D,$(COMPILER_INTERWORK_DEFINES) $(CDEFS))				\
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   902
			$(if $(PREINCLUDE),$(PREINCLUDE_OPTION) ,)$(call concat, $(PREINCLUDE_OPTION) ,$(call dblquote,$(PREINCLUDE)))\
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   903
			$(if $(SET_ARMINC),$(if $(RVCTINC),$(COMPILER_SYSTEM_INCLUDE_OPTION)$(call dblquote,$(RVCTINC)),),)       \
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   904
			$(COMPILER_SYSTEM_INCLUDE_OPTION)$$(call dblquote,$$(<D))                                                   \
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   905
			$(if $(USERINCLUDE),$(COMPILER_SYSTEM_INCLUDE_OPTION),)$(call concat, $(COMPILER_SYSTEM_INCLUDE_OPTION),$(call dblquote,$(USERINCLUDE)))      \
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   906
			$(if $(SYSTEMINCLUDE),$(COMPILER_SYSTEM_INCLUDE_OPTION),)$(call concat, $(COMPILER_SYSTEM_INCLUDE_OPTION),$(call dblquote,$(SYSTEMINCLUDE)))  \
28
b8fa7dfeeaa1 Update Raptor to v2.15.2
Mike Kinghan <mikek@symbian.org>
parents: 18
diff changeset
   907
			$(if $(NOHIDEALL),$(COMPILER_NO_HIDE_ALL_OPTION),) \
13
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   908
			$(if $(NO_DEPEND_GENERATE),,$(DEPEND_OPTION) $(call dblquote,$(DEPENDFILENAME))) \
18
de5b887c98f7 Upgrading to Raptor 2.14
mikek
parents: 13
diff changeset
   909
			$$(call dblquote, $$<) $(OUTPUT_OPTION) $$(@) $(if $(USE_RVCT22_DELETE_WORKAROUND),$(RVCT22_DELETE_WORKAROUND)) \
13
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   910
	$(call endrule,e32listing)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   911
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   912
CLEANTARGETS:=$$(CLEANTARGETS) $(LISTINGTARGET)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   913
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   914
ifeq ($(NO_DEPEND_GENERATE),))
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   915
  CLEANTARGETS:=$$(CLEANTARGETS) $(DEPENDFILENAME)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   916
endif
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   917
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   918
ifneq ($(DEPENDFILE),)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   919
  ifeq ($(NO_DEPEND_INCLUDE),)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   920
    ifeq ($(filter %CLEAN,$(call uppercase,$(MAKECMDGOALS))),)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   921
      -include $(DEPENDFILE)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   922
    endif
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   923
  endif
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   924
endif
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   925
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   926
endef
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   927
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   928
# No point at all in generating listing targetsif we aren't going to make them
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   929
ifneq ($(filter LISTING,$(call uppercase,$(MAKECMDGOALS))),)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   930
$(foreach F,$(CPPFILES) $(CFILES),$(eval $(call e32abiv2_listing,$(F))))
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   931
endif
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   932
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   933
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   934
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   935
# Function to execute FREEZE ###########################################
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   936
ifneq ($(SUPPORT_FREEZE),)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   937
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   938
# Fivespaces variable created to ensure a suitable gap of space characters
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   939
# Is placed between the separate arguments. This fixes a problem in Cygwin, where
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   940
# separate arguments are interpreted as a single argument when passed to bash
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   941
FIVESPACES=$(BLANK)     $(BLANK)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   942
18
de5b887c98f7 Upgrading to Raptor 2.14
mikek
parents: 13
diff changeset
   943
FREEZEGUARD:=TARGET_$(TARGET)_$(TARGETEXT)_$(IMPORTLIBPATH)_EFREEZE
13
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   944
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   945
define e32freeze
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   946
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   947
FREEZE:: $(1)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   948
	$(call startrule,freeze,,$(RESOLVED_DEFFILE)) \
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   949
	$(EFREEZE) $(EFREEZE_REMOVE_OPTION) "$(RESOLVED_DEFFILE)" $(FIVESPACES) $(call dblquote,$(GENERATED_DEFFILE)) \
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   950
	$(call endrule,freeze)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   951
endef
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   952
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   953
# Only freeze once - udeb and urel cannot differ
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   954
ifeq ($($(FREEZEGUARD)),)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   955
  # For most freezing activity we need the temporary .def file generated in the final post-link
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   956
  # that lists the current exports - FREEZE can therefore be dependent on the final post-linked binary,
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   957
  # with the side-effect that a build is triggered if someone tries to freeze without having built.
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   958
  #
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   959
  # However, there's one case where we don't want to be dependent on the post-linked binary in this way,
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   960
  # and that's when (a) there are missing exports, (b) the user's aware of them and (c) they're deliberately freezing to
28
b8fa7dfeeaa1 Update Raptor to v2.15.2
Mike Kinghan <mikek@symbian.org>
parents: 18
diff changeset
   961
  # remove them using EFREEZE's remove option.  Being dependent on the post-linked binary in this case, where POSTLINKER
13
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   962
  # actually fails to generate a final binary, would mean that the freeze would never happen and post-linking would
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   963
  # just be continually re-attempted (to fail each time).
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   964
  #
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   965
  # So, as a special case, if the user is explicitly attempting to freeze and perform removals, we make FREEZE dependent
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   966
  # on the temporary .def file instead.  This has no rule to actually make it, but gives a hint as to what is wrong if
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   967
  # the users performs a freeze with remove without having explicitly built previously.
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   968
  #
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   969
  ifneq ($(EFREEZE_REMOVE_OPTION),)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   970
    $(eval $(call e32freeze,$(GENERATED_DEFFILE)))
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   971
  else
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   972
    $(eval $(call e32freeze,$(E32TARGET)))
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   973
  endif
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   974
  $(FREEZEGUARD):=1
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   975
endif
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   976
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   977
endif
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   978
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   979
CLEANTARGETS:=$(CLEANTARGETS) $(if $(MULTIFILE_ENABLED),$(MULTIFILEOBJECT),$(CPPFILES_LINKOBJECTS) $(CFILES_LINKOBJECTS))
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   980
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   981
## ASSEMBLER FILES ###################################################################
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   982
# CIA VERSION      ############################################
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   983
define mapcia2xxx
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   984
$(call relocatefiles,$(INTERMEDIATEPATH),$(call extractandmap,$(CIAFILEEXTENSIONS),$2,$1))
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   985
endef
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   986
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   987
define e32abiv2_CIA2CPP
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   988
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   989
$(eval e32abiv2_OFILE:=$(call mapcia2xxx,$(1),_.o))
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   990
$(eval e32abiv2_PREFILE:=$(call mapcia2xxx,$(1),_.pre))
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   991
$(eval e32abiv2_CPPFILE:=$(call mapcia2xxx,$(1),_.cpp))
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   992
$(eval CLEANTARGETS:=$(CLEANTARGETS) $(e32abiv2_OFILE) $(e32abiv2_CPPFILE) $(e32abiv2_PREFILE))
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   993
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   994
$(e32abiv2_OFILE): $(e32abiv2_CPPFILE) $(PROJECT_META)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   995
	$(call startrule,cia2cpp2o,,$(e32abiv2_CPPFILE)) \
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   996
		$(if $(PERTURBSTARTTIME),$(RANSLEEP) $(PERTURBMSECS) ;,) \
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   997
			$(CC) $(LICENSERETRY_OPTION) \
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   998
			$(CC_CORE_ARGS) \
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
   999
			$(if $(LTCG),$(LTCG_OPTION),) \
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
  1000
			$(OPTION_COMPILER) \
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
  1001
			$(call makemacrodef,-D,$(COMPILER_INTERWORK_DEFINES) $(CDEFS) $(CIADEFS)) $(CPP_LANG_OPTION)      \
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
  1002
	 		$(if $(USERINCLUDE),$(COMPILER_SYSTEM_INCLUDE_OPTION),)$$(call concat, $(COMPILER_SYSTEM_INCLUDE_OPTION),$$(call dblquote,$(USERINCLUDE)))     \
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
  1003
	 		$(if $(SYSTEMINCLUDE),$(COMPILER_SYSTEM_INCLUDE_OPTION),)$$(call concat, $(COMPILER_SYSTEM_INCLUDE_OPTION),$$(call dblquote,$(SYSTEMINCLUDE))) \
18
de5b887c98f7 Upgrading to Raptor 2.14
mikek
parents: 13
diff changeset
  1004
	 		$$(call dblquote, $$<) $(OUTPUT_OPTION) $$@ $(if $(USE_RVCT22_DELETE_WORKAROUND),$(RVCT22_DELETE_WORKAROUND)) \
13
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
  1005
	$(call endrule,cia2cpp2o)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
  1006
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
  1007
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
  1008
# preprocessed CIA file to a CPP file
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
  1009
$(e32abiv2_CPPFILE): $(e32abiv2_PREFILE)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
  1010
	$(call startrule,tranasm) \
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
  1011
	$(if $(CPPFILT),CPPFILT="$(CPPFILT)",) \
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
  1012
	$(TRANASM) --suppress-check --output="$$@" $$^ \
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
  1013
	$(call endrule,tranasm)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
  1014
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
  1015
$(eval DEPENDFILENAME:=$(e32abiv2_PREFILE).d)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
  1016
$(eval DEPENDFILE:=$(wildcard $(DEPENDFILENAME)))
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
  1017
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
  1018
# preprocess the cia file
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
  1019
$(eval e32abiv2_PREFILE_OPTIONS:= $(LICENSERETRY_OPTION) $(PREPROCESSOR_OPTION) $(CPP_OPTION) \
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
  1020
       $(SYMBIAN_CCFLAGS) $(call makemacrodef,-D,$(COMPILER_INTERWORK_DEFINES) $(CDEFS) $(CIADEFS)) $(CPP_LANG_OPTION) \
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
  1021
       $(if $(PREINCLUDE),$(PREINCLUDE_OPTION) ,)$$(call concat, $(PREINCLUDE_OPTION) ,$$(call dblquote,$(PREINCLUDE))) \
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
  1022
       $(if $(USERINCLUDE),$(COMPILER_SYSTEM_INCLUDE_OPTION),)$$(call concat, $(COMPILER_SYSTEM_INCLUDE_OPTION),$$(call dblquote,$(USERINCLUDE))) \
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
  1023
       $(if $(SYSTEMINCLUDE),$(COMPILER_SYSTEM_INCLUDE_OPTION),)$$(call concat, $(COMPILER_SYSTEM_INCLUDE_OPTION),$$(call dblquote,$(SYSTEMINCLUDE))) \
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
  1024
       $(if $(ARMINC),$(if $(RVCTINC), $(COMPILER_SYSTEM_INCLUDE_OPTION)$$(call dblquote,$(RVCTINC)),),) )
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
  1025
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
  1026
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
  1027
$(e32abiv2_PREFILE): $1 $(PROJECT_META) $(if $(DEPENDFILE),,RESOURCE BITMAP EXPORT)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
  1028
	$(call startrule,cia2cpp,,$1) \
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
  1029
	$(if $(PERTURBSTARTTIME),$(RANSLEEP) $(PERTURBMSECS) ;,) \
18
de5b887c98f7 Upgrading to Raptor 2.14
mikek
parents: 13
diff changeset
  1030
	$(CC) $(e32abiv2_PREFILE_OPTIONS) $(OUTPUT_OPTION) $$@ $$(call dblquote,$1) $(if $(USE_RVCT22_DELETE_WORKAROUND),$(RVCT22_DELETE_WORKAROUND)) \
13
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
  1031
	$(if $(NO_DEPEND_GENERATE),,&& $(CC) -M $(e32abiv2_PREFILE_OPTIONS) --depend_format=unix $(OUTPUT_OPTION) $$@ $$(call dblquote,$1) > $(call dblquote,$(e32abiv2_PREFILE).d)) \
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
  1032
	$(call endrule,cia2cpp)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
  1033
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
  1034
ifeq ($(NO_DEPEND_GENERATE),)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
  1035
  CLEANTARGETS:=$$(CLEANTARGETS) $(DEPENDFILENAME)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
  1036
endif
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
  1037
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
  1038
ifneq ($(DEPENDFILE),)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
  1039
  ifeq ($(NO_DEPEND_INCLUDE),)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
  1040
    ifeq ($(filter %CLEAN,$(call uppercase,$(MAKECMDGOALS))),)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
  1041
      -include $(DEPENDFILE)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
  1042
    endif
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
  1043
  endif
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
  1044
endif
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
  1045
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
  1046
endef
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
  1047
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
  1048
# Create a rule for each cia file
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
  1049
ifeq ($(TRANSFORM_CIA),1)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
  1050
  $(eval $(foreach e32abiv2_RULE,$(CIAFILES),$(call e32abiv2_CIA2CPP,$(e32abiv2_RULE))))
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
  1051
endif
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
  1052
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
  1053
# Pure assembler (.s files) ################################
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
  1054
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
  1055
e32abiv2_asm_OPTIONS:=$(LICENSERETRY_OPTION) \
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
  1056
  $(CC_CORE_ARGS) \
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
  1057
  $(OPTION_COMPILER) \
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
  1058
  $(call makemacrodef,-D,$(COMPILER_INTERWORK_DEFINES) $(CDEFS)) \
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
  1059
  $(if $(USERINCLUDE),$(COMPILER_SYSTEM_INCLUDE_OPTION),)$$(call concat, $(COMPILER_SYSTEM_INCLUDE_OPTION),$$(call dblquote,$(USERINCLUDE)))     \
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
  1060
  $(if $(SYSTEMINCLUDE),$(COMPILER_SYSTEM_INCLUDE_OPTION),)$$(call concat, $(COMPILER_SYSTEM_INCLUDE_OPTION),$$(call dblquote,$(SYSTEMINCLUDE)))
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
  1061
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
  1062
# note that the --no_rtti option cannot be passed with the -M option
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
  1063
# so forcibly remove it when generating ASM dependencies.
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
  1064
#
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
  1065
define e32abiv2_asm
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
  1066
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
  1067
$(eval DEPENDFILENAME:=$(1).d)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
  1068
$(eval DEPENDFILE:=$(wildcard $(DEPENDFILENAME)))
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
  1069
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
  1070
$(1): $(2) $(PROJECT_META) $(if $(DEPENDFILE),,RESOURCE BITMAP EXPORT)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
  1071
	$(call startrule,asmcompile,,$(2)) \
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
  1072
		$(if $(PERTURBSTARTTIME),$(RANSLEEP) $(PERTURBMSECS) ;,) \
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
  1073
		$(CC) $(e32abiv2_asm_OPTIONS) \
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
  1074
		$(if $(NO_DEPEND_GENERATE),,$(DEPEND_OPTION) $(call dblquote,$(DEPENDFILENAME))) \
18
de5b887c98f7 Upgrading to Raptor 2.14
mikek
parents: 13
diff changeset
  1075
	 	$$(call dblquote, $$<) $(OUTPUT_OPTION) $$@ $(if $(USE_RVCT22_DELETE_WORKAROUND),$(RVCT22_DELETE_WORKAROUND)) \
13
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
  1076
	$(call endrule,asmcompile)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
  1077
ifeq ($(NO_DEPEND_GENERATE),)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
  1078
	$(call startrule,asmdependencies) \
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
  1079
		$(CC) -M $(subst --no_rtti,,$(e32abiv2_asm_OPTIONS)) --depend_format=unix \
18
de5b887c98f7 Upgrading to Raptor 2.14
mikek
parents: 13
diff changeset
  1080
	  	$(OUTPUT_OPTION) $$@ $$(call dblquote,$2) > $(call dblquote,$(DEPENDFILENAME)) $(if $(USE_RVCT22_DELETE_WORKAROUND),$(RVCT22_DELETE_WORKAROUND)) \
13
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
  1081
	$(call endrule,asmdependencies)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
  1082
endif
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
  1083
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
  1084
ifeq ($(NO_DEPEND_GENERATE),)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
  1085
  CLEANTARGETS:=$$(CLEANTARGETS) $(DEPENDFILENAME)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
  1086
endif
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
  1087
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
  1088
ifneq ($(DEPENDFILE),)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
  1089
  ifeq ($(NO_DEPEND_INCLUDE),)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
  1090
    ifeq ($(filter %CLEAN,$(call uppercase,$(MAKECMDGOALS))),)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
  1091
      -include $(DEPENDFILE)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
  1092
    endif
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
  1093
  endif
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
  1094
endif
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
  1095
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
  1096
CREATABLEPATHS:=$$(CREATABLEPATHS) $(INTERMEDIATEPATH)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
  1097
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
  1098
endef
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
  1099
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
  1100
$(eval $(foreach F,$(ASMFILES), $(call e32abiv2_asm,$(call mapasm2object,$(F)),$(F))))
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
  1101
CLEANTARGETS:=$(CLEANTARGETS) $(ASMFILES_LINKOBJECTS)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
  1102
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
  1103
endif # ifneq ($(TARGETTYPE),implib)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
  1104
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
  1105
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
  1106
########################## Build ROMFILE target ############################
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
  1107
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
  1108
# Only build ROMFILE if asked
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
  1109
ifneq ($(filter ROMFILE,$(call uppercase,$(MAKECMDGOALS))),)
28
b8fa7dfeeaa1 Update Raptor to v2.15.2
Mike Kinghan <mikek@symbian.org>
parents: 18
diff changeset
  1110
  include $(FLMHOME)/romfile.mk
13
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
  1111
endif
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
  1112
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
  1113
# Deal with test code batch files generation.
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
  1114
ifneq ($(TESTPATH),)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
  1115
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
  1116
    CREATABLEPATHS:=$(CREATABLEPATHS) $(EPOCROOT)/epoc32/data/z/test/
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
  1117
    $(eval $(call MakeTestBatchFiles,$(TARGET),$(EPOCROOT)/epoc32/data/z/test/$(MODULE)/$(VARIANTPLATFORM).$(TESTPATH)))
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
  1118
    BATCHFILE_CREATED_$(EPOCROOT)/epoc32/data/z/test/$(MODULE)/$(VARIANTPLATFORM).$(TESTPATH):=1
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
  1119
    TARGET_CREATED_$(EPOCROOT)/epoc32/data/z/test/$(MODULE)/$(VARIANTPLATFORM).$(TESTPATH)_$(TARGET):=1
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
  1120
    WHATRELEASE:=$(WHATRELEASE) $(EPOCROOT)/epoc32/data/z/test/$(MODULE)/$(VARIANTPLATFORM).$(TESTPATH)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
  1121
endif
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
  1122
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
  1123
###################### End of Build ROMFILE target ######################
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
  1124
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
  1125
# Feature Variation requires a .vmap file to be created for each binary
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
  1126
#
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
  1127
ifneq ($(FEATUREVARIANTNAME),)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
  1128
ifneq ($(E32TARGET),)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
  1129
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
  1130
OUTPUTVMAP:=$(E32TARGET).vmap
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
  1131
WHATRELEASE:=$(WHATRELEASE) $(OUPUTVMAP)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
  1132
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
  1133
TARGET:: $(OUTPUTVMAP)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
  1134
VMAPNEEDS:=$(E32TARGET) $(SOURCE) $(PROJECT_META)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
  1135
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
  1136
BV_FEATURELIST:=$(addprefix -f ,$(FEATURELISTFILES))
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
  1137
BV_USER_INCLUDES:=$(addprefix -u ,$(USERINCLUDE))
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
  1138
BV_SYSTEM_INCLUDES:=$(addprefix -x ,$(SYSTEMINCLUDE))
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
  1139
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
  1140
# translate double quoted macros because $(shell) messes them up in some make engines
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
  1141
BV_MACROLIST:=$(COMPILER_INTERWORK_DEFINES) $(CDEFS) $(if $(ALWAYS_BUILD_AS_ARM),,$(COMPILER_THUMB_DEFINES))
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
  1142
BV_DEFINES:=$(call makemacrodef,-D,$(subst ",__SBS__QUOTE__,$(BV_MACROLIST)))
28
b8fa7dfeeaa1 Update Raptor to v2.15.2
Mike Kinghan <mikek@symbian.org>
parents: 18
diff changeset
  1143
VMAPCOMMANDFILE:=$(INTERMEDIATEPATH)/$(TARGET).vmap.cmdfile
b8fa7dfeeaa1 Update Raptor to v2.15.2
Mike Kinghan <mikek@symbian.org>
parents: 18
diff changeset
  1144
b8fa7dfeeaa1 Update Raptor to v2.15.2
Mike Kinghan <mikek@symbian.org>
parents: 18
diff changeset
  1145
CLEANTARGETS:=$(CLEANTARGETS) $(VMAPCOMMANDFILE)
13
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
  1146
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
  1147
# the script to generate our .vmap file and hash value
28
b8fa7dfeeaa1 Update Raptor to v2.15.2
Mike Kinghan <mikek@symbian.org>
parents: 18
diff changeset
  1148
define createvmap
b8fa7dfeeaa1 Update Raptor to v2.15.2
Mike Kinghan <mikek@symbian.org>
parents: 18
diff changeset
  1149
b8fa7dfeeaa1 Update Raptor to v2.15.2
Mike Kinghan <mikek@symbian.org>
parents: 18
diff changeset
  1150
$(OUTPUTVMAP): $(VMAPNEEDS)
b8fa7dfeeaa1 Update Raptor to v2.15.2
Mike Kinghan <mikek@symbian.org>
parents: 18
diff changeset
  1151
	@echo -n "" > $(VMAPCOMMANDFILE);
b8fa7dfeeaa1 Update Raptor to v2.15.2
Mike Kinghan <mikek@symbian.org>
parents: 18
diff changeset
  1152
	$(call groupin10infile,$(VMAPCOMMANDFILE),$(addprefix -s,$(SOURCE) $(PROJECT_META))) ;
b8fa7dfeeaa1 Update Raptor to v2.15.2
Mike Kinghan <mikek@symbian.org>
parents: 18
diff changeset
  1153
	$(call startrule,createvmap) \
b8fa7dfeeaa1 Update Raptor to v2.15.2
Mike Kinghan <mikek@symbian.org>
parents: 18
diff changeset
  1154
	$(CREATEVMAP) -o $(OUTPUTVMAP) $(BV_FEATURELIST) $(BV_DEFINES) -p $(PREINCLUDE) --command=$(VMAPCOMMANDFILE) $(BV_USER_INCLUDES) $(BV_SYSTEM_INCLUDES) -c $(CREATEVMAPCPP) \
b8fa7dfeeaa1 Update Raptor to v2.15.2
Mike Kinghan <mikek@symbian.org>
parents: 18
diff changeset
  1155
	$(call endrule,createvmap)
b8fa7dfeeaa1 Update Raptor to v2.15.2
Mike Kinghan <mikek@symbian.org>
parents: 18
diff changeset
  1156
b8fa7dfeeaa1 Update Raptor to v2.15.2
Mike Kinghan <mikek@symbian.org>
parents: 18
diff changeset
  1157
endef
13
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
  1158
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
  1159
# a recipe to create the .vmap from the "sources" with the createvmap script
28
b8fa7dfeeaa1 Update Raptor to v2.15.2
Mike Kinghan <mikek@symbian.org>
parents: 18
diff changeset
  1160
$(eval $(createvmap))
13
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
  1161
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
  1162
endif # E32TARGET != ""
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
  1163
endif # FEATUREVARIANTNAME != ""
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
  1164
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
  1165
########################### CONCLUSION ###################################
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
  1166
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
  1167
# make the output directories while reading makefile - some build engines prefer this
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
  1168
$(call makepath,$(CREATABLEPATHS))
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
  1169
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
  1170
## Clean up
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
  1171
$(call raptor_clean,$(CLEANTARGETS))
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
  1172
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
  1173
# For the --what option and the log file
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
  1174
$(call raptor_release,$(filter-out %.sym,$(WHATRELEASE)))
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
  1175
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
  1176
endif # DOBUILD
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
  1177
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
  1178
## The End
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
  1179