build.flm 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. # Copyright (c) 2009-2011 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. #
  15. #
  16. # Parameters:
  17. # COMPONENT_PATHS
  18. # CONFIGS
  19. #
  20. CREATABLEPATHS:=
  21. CLEANTARGETS:=
  22. .PHONY:: PP_EXPORTS
  23. define doexports
  24. PP_EXPORTS::
  25. $(call startrule,makefile_generation_exports,rawoutput) \
  26. $(SBS) --toolcheck=off --export-only $(pp_system_definition) $(config_list) --filters=PPMakefileGenFilter -f- -m $(MAKEFILE_PATH).exports $(CLI_OPTIONS) \
  27. $(call endrule,makefile_generation_exports,rawoutput)
  28. CLEANTARGETS:=$$(CLEANTARGETS) $(MAKEFILE_PATH).exports
  29. endef
  30. # Generate makefiles for a particular system definition
  31. # $(1) = source target source target......
  32. define generate_makefiles
  33. ALL:: $(MAKEFILE_PATH)
  34. $(MAKEFILE_PATH): $(COMPONENT_PATHS) $(if $(DOEXPORT),| PP_EXPORTS )
  35. $(call startrule,makefile_generation,rawoutput) \
  36. $(SBS) --noexport --toolcheck=off -n $(CLI_OPTIONS) $(pp_system_definition) $(config_list) --filters=PPMakefileGenFilter -m $$@ -f- \
  37. $(call endrule,makefile_generation,rawoutput)
  38. CLEANTARGETS:=$$(CLEANTARGETS) $(MAKEFILE_PATH)
  39. endef
  40. # Create config list for commands
  41. config_list:=$(addprefix -c ,$(CONFIGS))
  42. pp_system_definition:=-s $(PP_SYSTEM_DEFINITION)
  43. $(if $(FLMDEBUG),$(info <debug>build.flm: configlist: $(config_list)</debug>))
  44. $(if $(FLMDEBUG),$(info <debug>build.flm: pp_system_definition file in use: $(pp_system_definition)</debug>))
  45. # Do exports only if asked. This doesn't work brilliantly in emake
  46. # since exports are often duplicated in some components - leads to conflicts
  47. # and rebuilds. Better to export before trying to do parallel parsing at all.
  48. $(if $(DOEXPORT),$(eval $(doexports)),$(if $(FLMDEBUG),$(info <debug>build.flm: Exports off </debug>)))
  49. # Create the Makefiles
  50. $(eval $(call generate_makefiles))
  51. CREATABLEPATHS:=$(CREATABLEPATHS) $(dir $(MAKEFILE_PATH))
  52. $(eval $(call GenerateStandardCleanTarget,$(CLEANTARGETS),$(CREATABLEPATHS),))
  53. $(call makepath,$(CREATABLEPATHS))