sbsv2/raptor/lib/flm/e32importlib.mk
author jascui
Tue, 16 Nov 2010 15:56:27 +0800
changeset 683 8e0eb519ef53
parent 625 a1925fb7753a
permissions -rw-r--r--
Solve incorrect handling of ExportName=SymbolName@Ordinal syntax
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
625
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
     1
# Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
     2
# All rights reserved.
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
     3
# This component and the accompanying materials are made available
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
     4
# under the terms of the License "Eclipse Public License v1.0"
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
     5
# which accompanies this distribution, and is available
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
     6
# at the URL "http://www.eclipse.org/legal/epl-v10.html".
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
     7
#
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
     8
# Initial Contributors:
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
     9
# Nokia Corporation - initial contribution.
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
    10
#
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
    11
# Contributors:
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
    12
#
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
    13
# Description:
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
    14
# Import library generation macros for supported e32 base architectures
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
    15
#
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
    16
#
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
    17
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
    18
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
    19
# ARM-specific Macros
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
    20
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
    21
define importlibtarget_prepfile_arm
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
    22
  $(PREPPEDDEFFILE): $(DEFFILE)
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
    23
	$(call startrule,importlibtarget_prepfile,FORCESUCCESS) \
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
    24
	  $(PREPDEF) $(call dblquote,$(DEFFILE)) $(call dblquote,$(PREPPEDDEFFILE)) \
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
    25
	$(call endrule,importlibtarget_prepfile)
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
    26
endef
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
    27
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
    28
define importlibtargetversioned_arm
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
    29
  $(IMPORTLIBTARGETVERSIONED_DSO): $(IMPLIBTOOL) $(PREPPEDDEFFILE)
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
    30
	$(call startrule,importlibversioned,FORCESUCCESS) \
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
    31
	  $(IMPLIBTOOL) \
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
    32
	    --sid=0x$(if $(SID),$(SID),$(if $(UID3),$(UID3),0)) \
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
    33
	    --version=$(VERSION) \
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
    34
		--definput="$(PREPPEDDEFFILE)" \
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
    35
		--dso=$$(call dblquote,$$@) \
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
    36
		--linkas=$(call dblquote,$(LINKASVERSIONED)) \
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
    37
	$(call endrule,importlibversioned)
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
    38
endef
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
    39
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
    40
define importlibtarget_prepfile_x86
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
    41
  # In x86 builds, x86-specific .def files take priority.  However, if they aren't present,
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
    42
  # the build falls-back to using ARM EABI .def files.
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
    43
  # In the case of the latter, further processing is required before they can be used:
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
    44
  # 1: ZTI and ZTV exports are ABSENT-ed
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
    45
  # 2: "St9__va_list" entries are replaced with "Pc"
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
    46
  # The primary/seconday status of the .def file is deduced in the front-end - we just need
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
    47
  # to react to RESOLVED_DEFFILE_SECONDARY appropriately. 
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
    48
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
    49
  ifneq ($(RESOLVED_DEFFILE_SECONDARY),)
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
    50
    $$(eval INPUTDEFFILE:=$(INTERMEDIATEPATH)/$(TARGET).def.x86)
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
    51
  
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
    52
    $(INTERMEDIATEPATH)/$(TARGET).def.x86: $(DEFFILE)
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
    53
	  $(call startrule,importlibtarget_prepfile_process,FORCESUCCESS) \
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
    54
	    $(GNUSED) -r 's%(^\s*_ZT[I|V].*NONAME).*$$$$%\1 ABSENT%;s%St9__va_list%Pc%' < $$< > $$@ \
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
    55
	  $(call endrule,importlibtarget_prepfile_process)
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
    56
    
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
    57
    CLEANTARGETS:=$$(CLEANTARGETS) $(INTERMEDIATEPATH)/$(TARGET).def.x86
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
    58
  else
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
    59
    $$(eval INPUTDEFFILE:=$(DEFFILE))
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
    60
  endif
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
    61
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
    62
  $(PREPPEDDEFFILE): $$(INPUTDEFFILE)
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
    63
	$(call startrule,importlibtarget_prepfile,FORCESUCCESS) \
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
    64
	  $(PREPDEF) $(call dblquote,$$<) $(call dblquote,$$@) nodatasizes $(PREPDEF_ENTRYPOINT_PREFIX)$(ENTRYPOINT) \
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
    65
	$(call endrule,importlibtarget_prepfile)
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
    66
endef
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
    67
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
    68
define importlibtargetversioned_x86
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
    69
  $(IMPORTLIBTARGETVERSIONED_DSO): $(IMPLIBTOOL) $(PREPPEDDEFFILE)
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
    70
	$(call startrule,importlibversioned,FORCESUCCESS) \
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
    71
	  $(IMPLIBTOOL) \
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
    72
	    -m i386 \
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
    73
	    --input-def "$(PREPPEDDEFFILE)"	\
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
    74
	    --dllname $(call dblquote,$(LINKASVERSIONED)) \
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
    75
		--output-lib $$(call dblquote,$$@) \
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
    76
	$(call endrule,importlibversioned)
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
    77
endef