sbsv2/raptor/lib/flm/tracecompiler.mk
branchfix
changeset 277 dbd582b8c0ab
parent 236 a2dc04c8e649
child 291 0e6a0a765dcd
equal deleted inserted replaced
267:ed4edcfbc38c 277:dbd582b8c0ab
     1 # Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
     1 # Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
     2 # All rights reserved.
     2 # All rights reserved.
     3 # This component and the accompanying materials are made available
     3 # This component and the accompanying materials are made available
     4 # under the terms of the License "Eclipse Public License v1.0"
     4 # under the terms of the License "Eclipse Public License v1.0"
     5 # which accompanies this distribution, and is available
     5 # which accompanies this distribution, and is available
     6 # at the URL "http://www.eclipse.org/legal/epl-v10.html".
     6 # at the URL "http://www.eclipse.org/legal/epl-v10.html".
    11 # Contributors:
    11 # Contributors:
    12 #
    12 #
    13 # Description:
    13 # Description:
    14 # 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
    15 
    15 
       
    16 # Set project name as <mmp_name>
    16 TRACE_PRJNAME:=$(basename $(notdir $(PROJECT_META)))
    17 TRACE_PRJNAME:=$(basename $(notdir $(PROJECT_META)))
       
    18 
       
    19 TARGETEXT:=$(if $(REQUESTEDTARGETEXT),$(REQUESTEDTARGETEXT),$(POSTLINKFILETYPE))
       
    20 
    17 # Find out TRACE_PATH
    21 # Find out TRACE_PATH
       
    22 # first look for .*/traces/traces_<target_name>_<target_extension>
       
    23 TRACE_PATH:=$(strip $(foreach DIR,$(USERINCLUDE),$(filter %/traces/traces_$(TARGET)_$(TARGETEXT),$(DIR))))
       
    24 
       
    25 ifneq ($(TRACE_PATH),)
       
    26 # set project name as <target_name>_<target_extension> instead of <mmp_name>
       
    27 TRACE_PRJNAME:=$(TARGET)_$(TARGETEXT)
       
    28 endif
       
    29 
       
    30 # if not found look for .*/traces_<mmp_name>
       
    31 ifeq ($(TRACE_PATH),)
    18 TRACE_PATH:=$(strip $(foreach DIR,$(USERINCLUDE),$(filter %/traces_$(TRACE_PRJNAME),$(DIR))))
    32 TRACE_PATH:=$(strip $(foreach DIR,$(USERINCLUDE),$(filter %/traces_$(TRACE_PRJNAME),$(DIR))))
       
    33 endif
       
    34 
       
    35 # if not found look for .*/traces
    19 ifeq ($(TRACE_PATH),)
    36 ifeq ($(TRACE_PATH),)
    20 TRACE_PATH:=$(strip $(foreach DIR,$(USERINCLUDE),$(filter %/traces,$(DIR))))
    37 TRACE_PATH:=$(strip $(foreach DIR,$(USERINCLUDE),$(filter %/traces,$(DIR))))
    21 endif
    38 endif
       
    39 
       
    40 # if not found look for .*/traces_<target_name>_<target_type>
    22 ifeq ($(TRACE_PATH),)
    41 ifeq ($(TRACE_PATH),)
    23 TRACE_PATH:=$(strip $(foreach DIR,$(USERINCLUDE),$(filter %/traces_$(TARGET)_$(TARGETTYPE),$(DIR))))
    42 TRACE_PATH:=$(strip $(foreach DIR,$(USERINCLUDE),$(filter %/traces_$(TARGET)_$(TARGETTYPE),$(DIR))))
    24 # Use target name instead of mmp file name
    43 # set project name as <target_name>_<target_type> instead of <mmp_name>
    25 TRACE_PRJNAME:=$(TARGET)_$(TARGETTYPE)
    44 TRACE_PRJNAME:=$(TARGET)_$(TARGETTYPE)
    26 endif
    45 endif
    27 
    46 
    28 # initialise (so what output will be correct if we don't actually run the TC)
    47 # initialise (so what output will be correct if we don't actually run the TC)
    29 TRACE_DICTIONARY:=
    48 TRACE_DICTIONARY:=
    31 
    50 
    32 $(if $(FLMDEBUG),$(info <debug>TRACE_PATH = $(TRACE_PATH)</debug>))
    51 $(if $(FLMDEBUG),$(info <debug>TRACE_PATH = $(TRACE_PATH)</debug>))
    33 
    52 
    34 # Run trace compiler only if TRACE_PATH exists
    53 # Run trace compiler only if TRACE_PATH exists
    35 ifneq ($(TRACE_PATH),)
    54 ifneq ($(TRACE_PATH),)
    36 
       
    37 
       
    38 TRACE_MARKER:=$(TRACE_MARKER_PATH)/tracecompile_$(TRACE_PRJNAME)_$(UID_TC).done
    55 TRACE_MARKER:=$(TRACE_MARKER_PATH)/tracecompile_$(TRACE_PRJNAME)_$(UID_TC).done
    39 TRACE_HEADERS:=
    56 TRACE_HEADERS:=
    40 
    57 
    41 TRACE_SOURCE_LIST:=$(TRACE_MARKER_PATH)/tracecompile_$(TRACE_PRJNAME)_$(UID_TC).sourcelist
    58 TRACE_SOURCE_LIST:=$(TRACE_MARKER_PATH)/tracecompile_$(TRACE_PRJNAME)_$(UID_TC).sourcelist
    42 
    59 
    70 $(TRACE_MARKER) : $(PROJECT_META)
    87 $(TRACE_MARKER) : $(PROJECT_META)
    71 	$(call startrule,tracecompile) \
    88 	$(call startrule,tracecompile) \
    72 	( echo -en "$(TRACE_PRJNAME)\n$(PROJECT_META)\n"; \
    89 	( echo -en "$(TRACE_PRJNAME)\n$(PROJECT_META)\n"; \
    73 	  $(GNUCAT) $(TRACE_SOURCE_LIST); \
    90 	  $(GNUCAT) $(TRACE_SOURCE_LIST); \
    74 	  echo -en "*ENDOFSOURCEFILES*\n" ) | \
    91 	  echo -en "*ENDOFSOURCEFILES*\n" ) | \
    75 	$(JAVA_COMMAND) $(TRACE_COMPILER_START) $(UID_TC) &&  \
    92 	$(JAVA_COMMAND) $(TRACE_COMPILER_START) -vb $(UID_TC) &&  \
    76 	$(GNUMD5SUM) $(TRACE_SOURCE_LIST) > $(TRACE_MARKER) && \
    93 	$(GNUMD5SUM) $(TRACE_SOURCE_LIST) > $(TRACE_MARKER) && \
    77 	{ $(GNUCAT) $(TRACE_SOURCE_LIST) ; true ; } \
    94 	{ $(GNUCAT) $(TRACE_SOURCE_LIST) ; true ; } \
    78 	$(call endrule,tracecompile)
    95 	$(call endrule,tracecompile)
    79 endef
    96 endef
    80 
    97