e32link.mk 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. # Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
  2. # All rights reserved.
  3. # This component and the accompanying materials are made available
  4. # under the terms of the License "Eclipse Public License v1.0"
  5. # which accompanies this distribution, and is available
  6. # at the URL "http://www.eclipse.org/legal/epl-v10.html".
  7. #
  8. # Initial Contributors:
  9. # Nokia Corporation - initial contribution.
  10. #
  11. # Contributors:
  12. #
  13. # Description:
  14. # Linking support macros for supported e32 base architectures
  15. #
  16. #
  17. define e32link_genlibexpfile
  18. # $(1): generation type - 'exports' or 'deffile'
  19. #
  20. # 'exports' generation involves taking a list of the known exports, passing them to
  21. # gendef.pl to create a temporary .def file, prepdef-ing this .def file and then
  22. # passing this along to the import library generation tool to create the .lib.exp.
  23. # This is invoked for components with known interfaces that aren't making use of a .mmp
  24. # listed .def file
  25. #
  26. # 'deffile' generation takes the .def file used in the component build, for components
  27. # that either require a .def file or where a .def file is used to override default behaviour.
  28. # The .def file will already have been prepdef-ed during initial .def file processing, so it's
  29. # just a matter of running the import library generation tool on the temporary .def file to
  30. # create the .lib.exp
  31. #
  32. # The resultant .lib.exp is then available for use in the final link.
  33. ifeq ($(1),exports)
  34. $(INTERMEDIATEPATH)/$(TARGET).gen.def:
  35. $(call startrule,e32link_gendeffile) \
  36. $(DEFGENTOOL) $(call dblquote,$$@) $(subst $(CHAR_COMMA)1$(CHAR_SEMIC),,$(AUTOEXPORTS)) \
  37. $(call endrule,e32link_gendeffile)
  38. CLEANTARGETS:=$$(CLEANTARGETS) $(INTERMEDIATEPATH)/$(TARGET).gen.def
  39. $(INTERMEDIATEPATH)/$(TARGET).prep: $(INTERMEDIATEPATH)/$(TARGET).gen.def
  40. $(call startrule,e32link_prepdef) \
  41. $(PREPDEF) $(call dblquote,$$<) $(call dblquote,$$@) nodatasizes $(PREPDEF_ENTRYPOINT_PREFIX)$(ENTRYPOINT) \
  42. $(call endrule,e32link_prepdef)
  43. CLEANTARGETS:=$$(CLEANTARGETS) $(INTERMEDIATEPATH)/$(TARGET).prep
  44. endif
  45. $(INTERMEDIATEPATH)/$(TARGET).lib.exp: $(INTERMEDIATEPATH)/$(TARGET).prep
  46. $(call startrule,e32link_genlibexpfile) \
  47. $(IMPLIBTOOL) \
  48. -m i386 \
  49. --input-def $(call dblquote,$$<) \
  50. --dllname $(call dblquote,$(LINKASVERSIONED)) \
  51. -e $$(call dblquote,$$@) \
  52. $(call endrule,e32link_genlibexpfile)
  53. CLEANTARGETS:=$$(CLEANTARGETS) $(INTERMEDIATEPATH)/$(TARGET).lib.exp
  54. endef