sbsv2/raptor/lib/flm/tracecompiler.mk
changeset 3 e1eecf4d390d
parent 0 044383f39525
child 89 315b0aa777bd
child 161 62c28226cde4
equal deleted inserted replaced
1:be27ed110b50 3:e1eecf4d390d
     1 #
       
     2 # Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
     1 # Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
     3 # All rights reserved.
     2 # All rights reserved.
     4 # This component and the accompanying materials are made available
     3 # This component and the accompanying materials are made available
     5 # under the terms of the License "Eclipse Public License v1.0"
     4 # under the terms of the License "Eclipse Public License v1.0"
     6 # which accompanies this distribution, and is available
     5 # which accompanies this distribution, and is available
     7 # at the URL "http://www.eclipse.org/legal/epl-v10.html".
     6 # at the URL "http://www.eclipse.org/legal/epl-v10.html".
     8 #
     7 # 
     9 # Initial Contributors:
     8 # Initial Contributors:
    10 # Nokia Corporation - initial contribution.
     9 # Nokia Corporation - initial contribution.
    11 #
    10 #
    12 # Contributors:
    11 # Contributors:
    13 #
    12 #
    14 # Description: 
    13 # Description:
    15 # Run Trace Compiler on source files to generate trace headers and decode files
    14 # Run Trace Compiler on source files to generate trace headers and decode files
    16 #
       
    17 
    15 
    18 TRACE_PRJNAME:=$(basename $(notdir $(PROJECT_META)))
    16 TRACE_PRJNAME:=$(basename $(notdir $(PROJECT_META)))
    19 # Find out TRACE_PATH
    17 # Find out TRACE_PATH
    20 TRACE_PATH:=$(strip $(foreach DIR,$(USERINCLUDE),$(filter %/traces_$(TRACE_PRJNAME),$(DIR))))
    18 TRACE_PATH:=$(strip $(foreach DIR,$(USERINCLUDE),$(filter %/traces_$(TRACE_PRJNAME),$(DIR))))
    21 ifeq ($(TRACE_PATH),)
    19 ifeq ($(TRACE_PATH),)
    22 TRACE_PATH:=$(strip $(foreach DIR,$(USERINCLUDE),$(filter %/traces,$(DIR))))
    20 TRACE_PATH:=$(strip $(foreach DIR,$(USERINCLUDE),$(filter %/traces,$(DIR))))
    23 endif
    21 endif
       
    22 ifeq ($(TRACE_PATH),)
       
    23 TRACE_PATH:=$(strip $(foreach DIR,$(USERINCLUDE),$(filter %/traces_$(TARGET)_$(TARGETTYPE),$(DIR))))
       
    24 # Use target name instead of mmp file name
       
    25 TRACE_PRJNAME:=$(TARGET)_$(TARGETTYPE)
       
    26 endif
       
    27 
       
    28 $(if $(FLMDEBUG),$(info <debug>TRACE_PATH = $(TRACE_PATH)</debug>))
    24 
    29 
    25 # Run trace compiler only if TRACE_PATH exists
    30 # Run trace compiler only if TRACE_PATH exists
    26 ifneq ($(TRACE_PATH),)
    31 ifneq ($(TRACE_PATH),)
    27 TRACE_MARKER:=$(TRACE_MARKER_PATH)/tracecompile_$(TRACE_PRJNAME)_$(UID_TC).done
    32 TRACE_MARKER:=$(TRACE_MARKER_PATH)/tracecompile_$(TRACE_PRJNAME)_$(UID_TC).done
    28 TRACE_HEADERS:=
    33 TRACE_HEADERS:=
    35 
    40 
    36 $(if $(FLMDEBUG),$(info <debug>Trace Compiler sourcelist generation output: $(X)</debug>))
    41 $(if $(FLMDEBUG),$(info <debug>Trace Compiler sourcelist generation output: $(X)</debug>))
    37 
    42 
    38 $(TRACE_MARKER) : $(SOURCE)
    43 $(TRACE_MARKER) : $(SOURCE)
    39 
    44 
       
    45 TRACE_HEADERS:=$(foreach SRC,$(SOURCE),$(TRACE_PATH)/$(basename $(notdir $(SRC)))Traces.h)
       
    46 
       
    47 $(TRACE_HEADERS): $(TRACE_MARKER)
       
    48 
    40 ifeq ($(GUARD_$(call sanitise,$(TRACE_MARKER))),)
    49 ifeq ($(GUARD_$(call sanitise,$(TRACE_MARKER))),)
    41 GUARD_$(call sanitise,$(TRACE_MARKER)):=1
    50 GUARD_$(call sanitise,$(TRACE_MARKER)):=1
    42 
    51 
    43 JAVA_COMMAND:=$(SBS_JAVATC)
    52 JAVA_COMMAND:=$(SBS_JAVATC)
    44 TRACE_COMPILER_PATH:=$(EPOCROOT)/epoc32/tools
    53 TRACE_COMPILER_PATH:=$(EPOCROOT)/epoc32/tools
    45 TRACE_COMPILER_START:=-classpath $(TRACE_COMPILER_PATH)/tracecompiler com.nokia.tracecompiler.TraceCompiler
    54 TRACE_COMPILER_START:=-classpath $(TRACE_COMPILER_PATH)/tracecompiler com.nokia.tracecompiler.TraceCompiler
    46 
    55 
    47 TRACE_HEADERS:=$(foreach SRC,$(SOURCE),$(TRACE_PATH)/$(basename $(notdir $(SRC)))Traces.h)
       
    48 
    56 
    49 # 1. Use pipe to send inputs to trace compiler to process
    57 # 1. Use pipe to send inputs to trace compiler to process
    50 # 2. Create a hash regarding to source names and put it in marker.
    58 # 2. Create a hash regarding to source names and put it in marker.
    51 # 3. Show source names that are processed by trace compiler
    59 # 3. Show source names that are processed by trace compiler
    52 define trace_compile
    60 define trace_compile
    61 	$(call endrule,tracecompile)
    69 	$(call endrule,tracecompile)
    62 endef
    70 endef
    63 
    71 
    64 $(eval $(trace_compile))
    72 $(eval $(trace_compile))
    65 
    73 
    66 $(eval $(call GenerateStandardCleanTarget,$(TRACE_HEADERS) $(TRACE_PATH)/tracebuilder.cache $(TRACE_MARKER) $(TRACE_SOURCE_LIST),,))
    74 $(eval $(call GenerateStandardCleanTarget, $(TRACE_PATH)/tracebuilder.cache $(TRACE_MARKER) $(TRACE_SOURCE_LIST),,))
    67 
    75 
    68 # End sanity guard
    76 # End sanity guard
    69 endif
    77 endif
       
    78 
       
    79 $(eval $(call GenerateStandardCleanTarget,$(TRACE_HEADERS),,))
    70 
    80 
    71 else
    81 else
    72 # Indicate to following parts of the FLM that we actually won't run
    82 # Indicate to following parts of the FLM that we actually won't run
    73 # trace compiler so they can set dependencies accordingly.
    83 # trace compiler so they can set dependencies accordingly.
    74 USE_TRACE_COMPILER:=
    84 USE_TRACE_COMPILER:=