sbsv2/raptor/lib/flm/tracecompiler.mk
branchfix
changeset 521 53251dd57e58
parent 519 206fd7d7ef46
child 563 51b77162794b
equal deleted inserted replaced
520:e5a5f48080cc 521:53251dd57e58
    95 
    95 
    96 
    96 
    97 JAVA_COMMAND:=$(SBS_JAVATC)
    97 JAVA_COMMAND:=$(SBS_JAVATC)
    98 TRACE_COMPILER_PATH:=$(EPOCROOT)/epoc32/tools
    98 TRACE_COMPILER_PATH:=$(EPOCROOT)/epoc32/tools
    99 
    99 
   100 #
   100 # declare the trace_compile macro but only do it once in the build
   101 #try to find TraceCompilerMain.class (the new posix-like interface)
       
   102 #
       
   103 ifeq ($(trace_compile),)
   101 ifeq ($(trace_compile),)
       
   102 
       
   103 # Find out which macro to declare - the one supporting the new CLI 
       
   104 # or the old one.  First try to find TraceCompilerMain.class 
       
   105 # If it is there then it might be the new posix-like interface
       
   106 TRACE_VER:=
       
   107 TRACE_VSTR:=
       
   108 
   104 TCClass:=$(wildcard  $(TRACE_COMPILER_PATH)/tracecompiler/com/nokia/tracecompiler/TraceCompilerMain.class)
   109 TCClass:=$(wildcard  $(TRACE_COMPILER_PATH)/tracecompiler/com/nokia/tracecompiler/TraceCompilerMain.class)
       
   110 ifneq ($(TCClass),) 
       
   111 # Get the version string from the TC (assume it's the new one)
       
   112 TRACE_COMPILER_START:=-classpath $(TRACE_COMPILER_PATH)/tracecompiler com.nokia.tracecompiler.TraceCompilerMain
       
   113 TRACE_VSTR:=$(firstword $(subst TraceCompiler version ,,$(shell $(JAVA_COMMAND) $(TRACE_COMPILER_START) --version)))
       
   114 # check if it looks like a version that supports the new cli interface: supporting up to verion 9 in the future.
       
   115 TRACE_VER:=$(findstring new,$(foreach version,2 3 4 5 6 7 8 9,$(patsubst $(version).%,new,$(TRACE_VSTR))))
       
   116 endif
       
   117 $(if $(FLMDEBUG),$(info <debug>TRACE_VSTR=$(TRACE_VSTR) TRACE_VER=$(TRACE_VER)</debug>))
   105 
   118 
   106 ifneq ($(TCClass),) #New Interface
   119 ifeq ($(TRACE_VER),new)
   107 TRACE_VER:=new
       
   108 TRACE_COMPILER_START:=-classpath $(TRACE_COMPILER_PATH)/tracecompiler com.nokia.tracecompiler.TraceCompilerMain
       
   109 define trace_compile
   120 define trace_compile
   110 $(TRACE_MARKER) : $(PROJECT_META)
   121 $(TRACE_MARKER) : $(PROJECT_META)
   111 	$(call startrule,tracecompile) \
   122 	$(call startrule,tracecompile) \
   112 	( $(GNUCAT) $(TRACE_SOURCE_LIST); \
   123 	( $(GNUCAT) $(TRACE_SOURCE_LIST); \
   113 	  echo -en "*ENDOFSOURCEFILES*\n" ) | \
   124 	  echo -en "*ENDOFSOURCEFILES*\n" ) | \
   133 	$(GNUMD5SUM) $(TRACE_SOURCE_LIST) > $(TRACE_MARKER) && \
   144 	$(GNUMD5SUM) $(TRACE_SOURCE_LIST) > $(TRACE_MARKER) && \
   134 	{ $(GNUTOUCH) $(TRACE_DICTIONARY) $(AUTOGEN_HEADER); \
   145 	{ $(GNUTOUCH) $(TRACE_DICTIONARY) $(AUTOGEN_HEADER); \
   135 	 $(GNUCAT) $(TRACE_SOURCE_LIST) ; true ; } \
   146 	 $(GNUCAT) $(TRACE_SOURCE_LIST) ; true ; } \
   136 	$(call endrule,tracecompile)
   147 	$(call endrule,tracecompile)
   137 endef
   148 endef
   138 TRACE_VER:=old
       
   139 
   149 
   140 # End - new/old trace compiler
   150 # End - new/old trace compiler
   141 endif
   151 endif
   142 
   152 
   143 # End - tracecompile is defined
   153 # End - tracecompile is defined