sbsv2/raptor/lib/flm/tracecompiler.mk
changeset 291 0e6a0a765dcd
parent 243 007900c31eef
parent 277 dbd582b8c0ab
child 293 5bbbb5fd2a8a
equal deleted inserted replaced
244:aba9fdf7e825 291:0e6a0a765dcd
     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:=
    68 $(TRACE_MARKER) : $(PROJECT_META)
    87 $(TRACE_MARKER) : $(PROJECT_META)
    69 	$(call startrule,tracecompile) \
    88 	$(call startrule,tracecompile) \
    70 	( echo -en "$(TRACE_PRJNAME)\n$(PROJECT_META)\n"; \
    89 	( echo -en "$(TRACE_PRJNAME)\n$(PROJECT_META)\n"; \
    71 	  $(GNUCAT) $(TRACE_SOURCE_LIST); \
    90 	  $(GNUCAT) $(TRACE_SOURCE_LIST); \
    72 	  echo -en "*ENDOFSOURCEFILES*\n" ) | \
    91 	  echo -en "*ENDOFSOURCEFILES*\n" ) | \
    73 	$(JAVA_COMMAND) $(TRACE_COMPILER_START) $(UID_TC) &&  \
    92 	$(JAVA_COMMAND) $(TRACE_COMPILER_START) -vb $(UID_TC) &&  \
    74 	$(GNUMD5SUM) $(TRACE_SOURCE_LIST) > $(TRACE_MARKER) && \
    93 	$(GNUMD5SUM) $(TRACE_SOURCE_LIST) > $(TRACE_MARKER) && \
    75 	{ $(GNUCAT) $(TRACE_SOURCE_LIST) ; true ; } \
    94 	{ $(GNUCAT) $(TRACE_SOURCE_LIST) ; true ; } \
    76 	$(call endrule,tracecompile)
    95 	$(call endrule,tracecompile)
    77 endef
    96 endef
    78 
    97