sbsv2/raptor/lib/flm/tracecompiler.mk
author timothy.murphy@nokia.com
Fri, 30 Apr 2010 16:07:17 +0100
branchfix
changeset 511 7581d432643a
parent 300 e87b08dc4b44
child 515 49a9c0e288ac
permissions -rw-r--r--
fix: support new trace compiler features for preventing clashes. Automatically turn on OST_TRACE_COMPILER_IN_USE macro. Look for trace header in systemincludes. Make directories in makefile parse to prevent clashes during build. Correct path for autogen headers. Correct case issue with autogen headers on Linux.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
277
dbd582b8c0ab SF Bug 1562 - [Raptor] Tracecompiler SYSTEMINCLUDE should be based on TARGETEXT not TARGETTYPE
timothy.murphy@nokia.com
parents: 236
diff changeset
     1
# Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
3
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
     2
# All rights reserved.
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
     3
# This component and the accompanying materials are made available
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
     4
# under the terms of the License "Eclipse Public License v1.0"
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
     5
# which accompanies this distribution, and is available
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
     6
# at the URL "http://www.eclipse.org/legal/epl-v10.html".
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
     7
# 
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
     8
# Initial Contributors:
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
     9
# Nokia Corporation - initial contribution.
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
    10
#
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
    11
# Contributors:
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
    12
#
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
    13
# Description:
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
    14
# Run Trace Compiler on source files to generate trace headers and decode files
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
    15
277
dbd582b8c0ab SF Bug 1562 - [Raptor] Tracecompiler SYSTEMINCLUDE should be based on TARGETEXT not TARGETTYPE
timothy.murphy@nokia.com
parents: 236
diff changeset
    16
# Set project name as <mmp_name>
3
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
    17
TRACE_PRJNAME:=$(basename $(notdir $(PROJECT_META)))
277
dbd582b8c0ab SF Bug 1562 - [Raptor] Tracecompiler SYSTEMINCLUDE should be based on TARGETEXT not TARGETTYPE
timothy.murphy@nokia.com
parents: 236
diff changeset
    18
dbd582b8c0ab SF Bug 1562 - [Raptor] Tracecompiler SYSTEMINCLUDE should be based on TARGETEXT not TARGETTYPE
timothy.murphy@nokia.com
parents: 236
diff changeset
    19
TARGETEXT:=$(if $(REQUESTEDTARGETEXT),$(REQUESTEDTARGETEXT),$(POSTLINKFILETYPE))
dbd582b8c0ab SF Bug 1562 - [Raptor] Tracecompiler SYSTEMINCLUDE should be based on TARGETEXT not TARGETTYPE
timothy.murphy@nokia.com
parents: 236
diff changeset
    20
3
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
    21
# Find out TRACE_PATH
277
dbd582b8c0ab SF Bug 1562 - [Raptor] Tracecompiler SYSTEMINCLUDE should be based on TARGETEXT not TARGETTYPE
timothy.murphy@nokia.com
parents: 236
diff changeset
    22
# first look for .*/traces/traces_<target_name>_<target_extension>
511
7581d432643a fix: support new trace compiler features for preventing clashes. Automatically turn on OST_TRACE_COMPILER_IN_USE macro. Look for trace header in systemincludes. Make directories in makefile parse to prevent clashes during build. Correct path for autogen headers. Correct case issue with autogen headers on Linux.
timothy.murphy@nokia.com
parents: 300
diff changeset
    23
TRACE_PATH:=$(strip $(foreach DIR,$(USERINCLUDE) $(SYSTEMINCLUDE),$(filter %/traces/$(TARGET)_$(TARGETEXT),$(DIR))))
7581d432643a fix: support new trace compiler features for preventing clashes. Automatically turn on OST_TRACE_COMPILER_IN_USE macro. Look for trace header in systemincludes. Make directories in makefile parse to prevent clashes during build. Correct path for autogen headers. Correct case issue with autogen headers on Linux.
timothy.murphy@nokia.com
parents: 300
diff changeset
    24
277
dbd582b8c0ab SF Bug 1562 - [Raptor] Tracecompiler SYSTEMINCLUDE should be based on TARGETEXT not TARGETTYPE
timothy.murphy@nokia.com
parents: 236
diff changeset
    25
dbd582b8c0ab SF Bug 1562 - [Raptor] Tracecompiler SYSTEMINCLUDE should be based on TARGETEXT not TARGETTYPE
timothy.murphy@nokia.com
parents: 236
diff changeset
    26
ifneq ($(TRACE_PATH),)
dbd582b8c0ab SF Bug 1562 - [Raptor] Tracecompiler SYSTEMINCLUDE should be based on TARGETEXT not TARGETTYPE
timothy.murphy@nokia.com
parents: 236
diff changeset
    27
# set project name as <target_name>_<target_extension> instead of <mmp_name>
dbd582b8c0ab SF Bug 1562 - [Raptor] Tracecompiler SYSTEMINCLUDE should be based on TARGETEXT not TARGETTYPE
timothy.murphy@nokia.com
parents: 236
diff changeset
    28
TRACE_PRJNAME:=$(TARGET)_$(TARGETEXT)
dbd582b8c0ab SF Bug 1562 - [Raptor] Tracecompiler SYSTEMINCLUDE should be based on TARGETEXT not TARGETTYPE
timothy.murphy@nokia.com
parents: 236
diff changeset
    29
endif
dbd582b8c0ab SF Bug 1562 - [Raptor] Tracecompiler SYSTEMINCLUDE should be based on TARGETEXT not TARGETTYPE
timothy.murphy@nokia.com
parents: 236
diff changeset
    30
511
7581d432643a fix: support new trace compiler features for preventing clashes. Automatically turn on OST_TRACE_COMPILER_IN_USE macro. Look for trace header in systemincludes. Make directories in makefile parse to prevent clashes during build. Correct path for autogen headers. Correct case issue with autogen headers on Linux.
timothy.murphy@nokia.com
parents: 300
diff changeset
    31
7581d432643a fix: support new trace compiler features for preventing clashes. Automatically turn on OST_TRACE_COMPILER_IN_USE macro. Look for trace header in systemincludes. Make directories in makefile parse to prevent clashes during build. Correct path for autogen headers. Correct case issue with autogen headers on Linux.
timothy.murphy@nokia.com
parents: 300
diff changeset
    32
# if not found look for .*/traces_<target_name>_<target_type>
7581d432643a fix: support new trace compiler features for preventing clashes. Automatically turn on OST_TRACE_COMPILER_IN_USE macro. Look for trace header in systemincludes. Make directories in makefile parse to prevent clashes during build. Correct path for autogen headers. Correct case issue with autogen headers on Linux.
timothy.murphy@nokia.com
parents: 300
diff changeset
    33
ifeq ($(TRACE_PATH),)
7581d432643a fix: support new trace compiler features for preventing clashes. Automatically turn on OST_TRACE_COMPILER_IN_USE macro. Look for trace header in systemincludes. Make directories in makefile parse to prevent clashes during build. Correct path for autogen headers. Correct case issue with autogen headers on Linux.
timothy.murphy@nokia.com
parents: 300
diff changeset
    34
TRACE_PATH:=$(strip $(foreach DIR,$(USERINCLUDE) $(SYSTEMINCLUDE),$(filter %/traces_$(TARGET)_$(TARGETTYPE),$(DIR))))
7581d432643a fix: support new trace compiler features for preventing clashes. Automatically turn on OST_TRACE_COMPILER_IN_USE macro. Look for trace header in systemincludes. Make directories in makefile parse to prevent clashes during build. Correct path for autogen headers. Correct case issue with autogen headers on Linux.
timothy.murphy@nokia.com
parents: 300
diff changeset
    35
# set project name as <target_name>_<target_type> instead of <mmp_name>
7581d432643a fix: support new trace compiler features for preventing clashes. Automatically turn on OST_TRACE_COMPILER_IN_USE macro. Look for trace header in systemincludes. Make directories in makefile parse to prevent clashes during build. Correct path for autogen headers. Correct case issue with autogen headers on Linux.
timothy.murphy@nokia.com
parents: 300
diff changeset
    36
ifneq ($(TRACE_PATH),)
7581d432643a fix: support new trace compiler features for preventing clashes. Automatically turn on OST_TRACE_COMPILER_IN_USE macro. Look for trace header in systemincludes. Make directories in makefile parse to prevent clashes during build. Correct path for autogen headers. Correct case issue with autogen headers on Linux.
timothy.murphy@nokia.com
parents: 300
diff changeset
    37
TRACE_PRJNAME:=$(TARGET)_$(TARGETTYPE)
7581d432643a fix: support new trace compiler features for preventing clashes. Automatically turn on OST_TRACE_COMPILER_IN_USE macro. Look for trace header in systemincludes. Make directories in makefile parse to prevent clashes during build. Correct path for autogen headers. Correct case issue with autogen headers on Linux.
timothy.murphy@nokia.com
parents: 300
diff changeset
    38
endif
7581d432643a fix: support new trace compiler features for preventing clashes. Automatically turn on OST_TRACE_COMPILER_IN_USE macro. Look for trace header in systemincludes. Make directories in makefile parse to prevent clashes during build. Correct path for autogen headers. Correct case issue with autogen headers on Linux.
timothy.murphy@nokia.com
parents: 300
diff changeset
    39
endif
7581d432643a fix: support new trace compiler features for preventing clashes. Automatically turn on OST_TRACE_COMPILER_IN_USE macro. Look for trace header in systemincludes. Make directories in makefile parse to prevent clashes during build. Correct path for autogen headers. Correct case issue with autogen headers on Linux.
timothy.murphy@nokia.com
parents: 300
diff changeset
    40
277
dbd582b8c0ab SF Bug 1562 - [Raptor] Tracecompiler SYSTEMINCLUDE should be based on TARGETEXT not TARGETTYPE
timothy.murphy@nokia.com
parents: 236
diff changeset
    41
# if not found look for .*/traces_<mmp_name>
dbd582b8c0ab SF Bug 1562 - [Raptor] Tracecompiler SYSTEMINCLUDE should be based on TARGETEXT not TARGETTYPE
timothy.murphy@nokia.com
parents: 236
diff changeset
    42
ifeq ($(TRACE_PATH),)
511
7581d432643a fix: support new trace compiler features for preventing clashes. Automatically turn on OST_TRACE_COMPILER_IN_USE macro. Look for trace header in systemincludes. Make directories in makefile parse to prevent clashes during build. Correct path for autogen headers. Correct case issue with autogen headers on Linux.
timothy.murphy@nokia.com
parents: 300
diff changeset
    43
TRACE_PATH:=$(strip $(foreach DIR,$(USERINCLUDE) $(SYSTEMINCLUDE),$(filter %/traces_$(TRACE_PRJNAME),$(DIR))))
277
dbd582b8c0ab SF Bug 1562 - [Raptor] Tracecompiler SYSTEMINCLUDE should be based on TARGETEXT not TARGETTYPE
timothy.murphy@nokia.com
parents: 236
diff changeset
    44
endif
dbd582b8c0ab SF Bug 1562 - [Raptor] Tracecompiler SYSTEMINCLUDE should be based on TARGETEXT not TARGETTYPE
timothy.murphy@nokia.com
parents: 236
diff changeset
    45
dbd582b8c0ab SF Bug 1562 - [Raptor] Tracecompiler SYSTEMINCLUDE should be based on TARGETEXT not TARGETTYPE
timothy.murphy@nokia.com
parents: 236
diff changeset
    46
# if not found look for .*/traces
3
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
    47
ifeq ($(TRACE_PATH),)
511
7581d432643a fix: support new trace compiler features for preventing clashes. Automatically turn on OST_TRACE_COMPILER_IN_USE macro. Look for trace header in systemincludes. Make directories in makefile parse to prevent clashes during build. Correct path for autogen headers. Correct case issue with autogen headers on Linux.
timothy.murphy@nokia.com
parents: 300
diff changeset
    48
TRACE_PATH:=$(strip $(foreach DIR,$(USERINCLUDE) $(SYSTEMINCLUDE),$(filter %/traces,$(DIR))))
3
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
    49
endif
277
dbd582b8c0ab SF Bug 1562 - [Raptor] Tracecompiler SYSTEMINCLUDE should be based on TARGETEXT not TARGETTYPE
timothy.murphy@nokia.com
parents: 236
diff changeset
    50
dbd582b8c0ab SF Bug 1562 - [Raptor] Tracecompiler SYSTEMINCLUDE should be based on TARGETEXT not TARGETTYPE
timothy.murphy@nokia.com
parents: 236
diff changeset
    51
# if not found look for .*/traces_<target_name>_<target_type>
3
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
    52
ifeq ($(TRACE_PATH),)
511
7581d432643a fix: support new trace compiler features for preventing clashes. Automatically turn on OST_TRACE_COMPILER_IN_USE macro. Look for trace header in systemincludes. Make directories in makefile parse to prevent clashes during build. Correct path for autogen headers. Correct case issue with autogen headers on Linux.
timothy.murphy@nokia.com
parents: 300
diff changeset
    53
TRACE_PATH:=$(strip $(foreach DIR,$(USERINCLUDE) $(SYSTEMINCLUDE),$(filter %/traces_$(TARGET)_$(TARGETTYPE),$(DIR))))
277
dbd582b8c0ab SF Bug 1562 - [Raptor] Tracecompiler SYSTEMINCLUDE should be based on TARGETEXT not TARGETTYPE
timothy.murphy@nokia.com
parents: 236
diff changeset
    54
# set project name as <target_name>_<target_type> instead of <mmp_name>
3
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
    55
TRACE_PRJNAME:=$(TARGET)_$(TARGETTYPE)
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
    56
endif
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
    57
236
a2dc04c8e649 fix: Don't print what information if we have no intention of running the trace compiler.
timothy.murphy@nokia.com
parents: 173
diff changeset
    58
# initialise (so what output will be correct if we don't actually run the TC)
a2dc04c8e649 fix: Don't print what information if we have no intention of running the trace compiler.
timothy.murphy@nokia.com
parents: 173
diff changeset
    59
TRACE_DICTIONARY:=
a2dc04c8e649 fix: Don't print what information if we have no intention of running the trace compiler.
timothy.murphy@nokia.com
parents: 173
diff changeset
    60
AUTOGEN_HEADER:=
161
62c28226cde4 Bug 1494 - Trace compiler files not in whatlog - FIX and TESTS though UNTESTED
Iain Williamson <iain.williamson@nokia.com>
parents: 3
diff changeset
    61
3
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
    62
$(if $(FLMDEBUG),$(info <debug>TRACE_PATH = $(TRACE_PATH)</debug>))
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
    63
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
    64
# Run trace compiler only if TRACE_PATH exists
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
    65
ifneq ($(TRACE_PATH),)
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
    66
TRACE_MARKER:=$(TRACE_MARKER_PATH)/tracecompile_$(TRACE_PRJNAME)_$(UID_TC).done
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
    67
TRACE_HEADERS:=
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
    68
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
    69
TRACE_SOURCE_LIST:=$(TRACE_MARKER_PATH)/tracecompile_$(TRACE_PRJNAME)_$(UID_TC).sourcelist
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
    70
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
    71
# 1. Append to or create the list of source files for trace compiler to process
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
    72
# 2. Check if the hash in trace marker remain unchanged. If not, remove marker so trace compiler will run again. 
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
    73
X:=$(shell set -x ; $(GNUMKDIR) -p $(TRACE_MARKER_PATH) ; $(GNUTOUCH) $(TRACE_SOURCE_LIST) ; echo -e "$(subst $(CHAR_SPACE),\\n,$(SOURCE))" | $(GNUSORT) -u $(TRACE_SOURCE_LIST) - > $(TRACE_SOURCE_LIST).tmp && $(GNUMV) $(TRACE_SOURCE_LIST).tmp $(TRACE_SOURCE_LIST) ; $(GNUMD5SUM) -c $(TRACE_MARKER) || $(GNURM) $(TRACE_MARKER))
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
    74
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
    75
$(if $(FLMDEBUG),$(info <debug>Trace Compiler sourcelist generation output: $(X)</debug>))
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
    76
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
    77
$(TRACE_MARKER) : $(SOURCE)
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
    78
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
    79
TRACE_HEADERS:=$(foreach SRC,$(SOURCE),$(TRACE_PATH)/$(basename $(notdir $(SRC)))Traces.h)
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
    80
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
    81
$(TRACE_HEADERS): $(TRACE_MARKER)
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
    82
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
    83
ifeq ($(GUARD_$(call sanitise,$(TRACE_MARKER))),)
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
    84
GUARD_$(call sanitise,$(TRACE_MARKER)):=1
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
    85
300
e87b08dc4b44 SF Bug 2125 - [Raptor] - tracecompiler what output incorrect if mmp basename contains '.' e.g. fred.prd.mmp
timothy.murphy@nokia.com
parents: 293
diff changeset
    86
# The trace compiler likes to change . into _ so we must do the same in the case of mmps with a name like
e87b08dc4b44 SF Bug 2125 - [Raptor] - tracecompiler what output incorrect if mmp basename contains '.' e.g. fred.prd.mmp
timothy.murphy@nokia.com
parents: 293
diff changeset
    87
# fred.prd.mmp we want fred_prd
e87b08dc4b44 SF Bug 2125 - [Raptor] - tracecompiler what output incorrect if mmp basename contains '.' e.g. fred.prd.mmp
timothy.murphy@nokia.com
parents: 293
diff changeset
    88
TRACE_PRJNAME_SANITISED:=$(subst .,_,$(TRACE_PRJNAME))
e87b08dc4b44 SF Bug 2125 - [Raptor] - tracecompiler what output incorrect if mmp basename contains '.' e.g. fred.prd.mmp
timothy.murphy@nokia.com
parents: 293
diff changeset
    89
236
a2dc04c8e649 fix: Don't print what information if we have no intention of running the trace compiler.
timothy.murphy@nokia.com
parents: 173
diff changeset
    90
3
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
    91
JAVA_COMMAND:=$(SBS_JAVATC)
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
    92
TRACE_COMPILER_PATH:=$(EPOCROOT)/epoc32/tools
511
7581d432643a fix: support new trace compiler features for preventing clashes. Automatically turn on OST_TRACE_COMPILER_IN_USE macro. Look for trace header in systemincludes. Make directories in makefile parse to prevent clashes during build. Correct path for autogen headers. Correct case issue with autogen headers on Linux.
timothy.murphy@nokia.com
parents: 300
diff changeset
    93
7581d432643a fix: support new trace compiler features for preventing clashes. Automatically turn on OST_TRACE_COMPILER_IN_USE macro. Look for trace header in systemincludes. Make directories in makefile parse to prevent clashes during build. Correct path for autogen headers. Correct case issue with autogen headers on Linux.
timothy.murphy@nokia.com
parents: 300
diff changeset
    94
#
7581d432643a fix: support new trace compiler features for preventing clashes. Automatically turn on OST_TRACE_COMPILER_IN_USE macro. Look for trace header in systemincludes. Make directories in makefile parse to prevent clashes during build. Correct path for autogen headers. Correct case issue with autogen headers on Linux.
timothy.murphy@nokia.com
parents: 300
diff changeset
    95
#try to find TraceCompilerMain.class (the new posix-like interface)
7581d432643a fix: support new trace compiler features for preventing clashes. Automatically turn on OST_TRACE_COMPILER_IN_USE macro. Look for trace header in systemincludes. Make directories in makefile parse to prevent clashes during build. Correct path for autogen headers. Correct case issue with autogen headers on Linux.
timothy.murphy@nokia.com
parents: 300
diff changeset
    96
#
7581d432643a fix: support new trace compiler features for preventing clashes. Automatically turn on OST_TRACE_COMPILER_IN_USE macro. Look for trace header in systemincludes. Make directories in makefile parse to prevent clashes during build. Correct path for autogen headers. Correct case issue with autogen headers on Linux.
timothy.murphy@nokia.com
parents: 300
diff changeset
    97
ifeq ($(trace_compile),)
7581d432643a fix: support new trace compiler features for preventing clashes. Automatically turn on OST_TRACE_COMPILER_IN_USE macro. Look for trace header in systemincludes. Make directories in makefile parse to prevent clashes during build. Correct path for autogen headers. Correct case issue with autogen headers on Linux.
timothy.murphy@nokia.com
parents: 300
diff changeset
    98
TCClass:=$(wildcard  $(TRACE_COMPILER_PATH)/tracecompiler/com/nokia/tracecompiler/TraceCompilerMain.class)
3
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
    99
511
7581d432643a fix: support new trace compiler features for preventing clashes. Automatically turn on OST_TRACE_COMPILER_IN_USE macro. Look for trace header in systemincludes. Make directories in makefile parse to prevent clashes during build. Correct path for autogen headers. Correct case issue with autogen headers on Linux.
timothy.murphy@nokia.com
parents: 300
diff changeset
   100
ifneq ($(TCClass),) #New Interface
7581d432643a fix: support new trace compiler features for preventing clashes. Automatically turn on OST_TRACE_COMPILER_IN_USE macro. Look for trace header in systemincludes. Make directories in makefile parse to prevent clashes during build. Correct path for autogen headers. Correct case issue with autogen headers on Linux.
timothy.murphy@nokia.com
parents: 300
diff changeset
   101
TCAUTOGENDIR:=platform
7581d432643a fix: support new trace compiler features for preventing clashes. Automatically turn on OST_TRACE_COMPILER_IN_USE macro. Look for trace header in systemincludes. Make directories in makefile parse to prevent clashes during build. Correct path for autogen headers. Correct case issue with autogen headers on Linux.
timothy.murphy@nokia.com
parents: 300
diff changeset
   102
TRACE_COMPILER_START:=-classpath $(TRACE_COMPILER_PATH)/tracecompiler com.nokia.tracecompiler.TraceCompilerMain
7581d432643a fix: support new trace compiler features for preventing clashes. Automatically turn on OST_TRACE_COMPILER_IN_USE macro. Look for trace header in systemincludes. Make directories in makefile parse to prevent clashes during build. Correct path for autogen headers. Correct case issue with autogen headers on Linux.
timothy.murphy@nokia.com
parents: 300
diff changeset
   103
define trace_compile
7581d432643a fix: support new trace compiler features for preventing clashes. Automatically turn on OST_TRACE_COMPILER_IN_USE macro. Look for trace header in systemincludes. Make directories in makefile parse to prevent clashes during build. Correct path for autogen headers. Correct case issue with autogen headers on Linux.
timothy.murphy@nokia.com
parents: 300
diff changeset
   104
$(TRACE_MARKER) : $(PROJECT_META)
7581d432643a fix: support new trace compiler features for preventing clashes. Automatically turn on OST_TRACE_COMPILER_IN_USE macro. Look for trace header in systemincludes. Make directories in makefile parse to prevent clashes during build. Correct path for autogen headers. Correct case issue with autogen headers on Linux.
timothy.murphy@nokia.com
parents: 300
diff changeset
   105
	$(call startrule,tracecompile) \
7581d432643a fix: support new trace compiler features for preventing clashes. Automatically turn on OST_TRACE_COMPILER_IN_USE macro. Look for trace header in systemincludes. Make directories in makefile parse to prevent clashes during build. Correct path for autogen headers. Correct case issue with autogen headers on Linux.
timothy.murphy@nokia.com
parents: 300
diff changeset
   106
	( $(GNUCAT) $(TRACE_SOURCE_LIST); \
7581d432643a fix: support new trace compiler features for preventing clashes. Automatically turn on OST_TRACE_COMPILER_IN_USE macro. Look for trace header in systemincludes. Make directories in makefile parse to prevent clashes during build. Correct path for autogen headers. Correct case issue with autogen headers on Linux.
timothy.murphy@nokia.com
parents: 300
diff changeset
   107
	  echo -en "*ENDOFSOURCEFILES*\n" ) | \
7581d432643a fix: support new trace compiler features for preventing clashes. Automatically turn on OST_TRACE_COMPILER_IN_USE macro. Look for trace header in systemincludes. Make directories in makefile parse to prevent clashes during build. Correct path for autogen headers. Correct case issue with autogen headers on Linux.
timothy.murphy@nokia.com
parents: 300
diff changeset
   108
	$(JAVA_COMMAND) $(TRACE_COMPILER_START) -d --uid=$(UID_TC) --project=$(TRACE_PRJNAME) --mmp=$(PROJECT_META) --traces=$(TRACE_PATH) &&  \
7581d432643a fix: support new trace compiler features for preventing clashes. Automatically turn on OST_TRACE_COMPILER_IN_USE macro. Look for trace header in systemincludes. Make directories in makefile parse to prevent clashes during build. Correct path for autogen headers. Correct case issue with autogen headers on Linux.
timothy.murphy@nokia.com
parents: 300
diff changeset
   109
	$(GNUMD5SUM) $(TRACE_SOURCE_LIST) > $(TRACE_MARKER) && \
7581d432643a fix: support new trace compiler features for preventing clashes. Automatically turn on OST_TRACE_COMPILER_IN_USE macro. Look for trace header in systemincludes. Make directories in makefile parse to prevent clashes during build. Correct path for autogen headers. Correct case issue with autogen headers on Linux.
timothy.murphy@nokia.com
parents: 300
diff changeset
   110
	{ $(GNUTOUCH) $(TRACE_DICTIONARY) $(AUTOGEN_HEADER); \
7581d432643a fix: support new trace compiler features for preventing clashes. Automatically turn on OST_TRACE_COMPILER_IN_USE macro. Look for trace header in systemincludes. Make directories in makefile parse to prevent clashes during build. Correct path for autogen headers. Correct case issue with autogen headers on Linux.
timothy.murphy@nokia.com
parents: 300
diff changeset
   111
	 $(GNUCAT) $(TRACE_SOURCE_LIST) ; true ; } \
7581d432643a fix: support new trace compiler features for preventing clashes. Automatically turn on OST_TRACE_COMPILER_IN_USE macro. Look for trace header in systemincludes. Make directories in makefile parse to prevent clashes during build. Correct path for autogen headers. Correct case issue with autogen headers on Linux.
timothy.murphy@nokia.com
parents: 300
diff changeset
   112
	$(call endrule,tracecompile)
7581d432643a fix: support new trace compiler features for preventing clashes. Automatically turn on OST_TRACE_COMPILER_IN_USE macro. Look for trace header in systemincludes. Make directories in makefile parse to prevent clashes during build. Correct path for autogen headers. Correct case issue with autogen headers on Linux.
timothy.murphy@nokia.com
parents: 300
diff changeset
   113
endef
7581d432643a fix: support new trace compiler features for preventing clashes. Automatically turn on OST_TRACE_COMPILER_IN_USE macro. Look for trace header in systemincludes. Make directories in makefile parse to prevent clashes during build. Correct path for autogen headers. Correct case issue with autogen headers on Linux.
timothy.murphy@nokia.com
parents: 300
diff changeset
   114
else # Old inteface
7581d432643a fix: support new trace compiler features for preventing clashes. Automatically turn on OST_TRACE_COMPILER_IN_USE macro. Look for trace header in systemincludes. Make directories in makefile parse to prevent clashes during build. Correct path for autogen headers. Correct case issue with autogen headers on Linux.
timothy.murphy@nokia.com
parents: 300
diff changeset
   115
TCAUTOGENDIR:=internal
7581d432643a fix: support new trace compiler features for preventing clashes. Automatically turn on OST_TRACE_COMPILER_IN_USE macro. Look for trace header in systemincludes. Make directories in makefile parse to prevent clashes during build. Correct path for autogen headers. Correct case issue with autogen headers on Linux.
timothy.murphy@nokia.com
parents: 300
diff changeset
   116
TRACE_COMPILER_START:=-classpath $(TRACE_COMPILER_PATH)/tracecompiler com.nokia.tracecompiler.TraceCompiler
3
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
   117
# 1. Use pipe to send inputs to trace compiler to process
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
   118
# 2. Create a hash regarding to source names and put it in marker.
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
   119
# 3. Show source names that are processed by trace compiler
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
   120
define trace_compile
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
   121
$(TRACE_MARKER) : $(PROJECT_META)
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
   122
	$(call startrule,tracecompile) \
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
   123
	( echo -en "$(TRACE_PRJNAME)\n$(PROJECT_META)\n"; \
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
   124
	  $(GNUCAT) $(TRACE_SOURCE_LIST); \
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
   125
	  echo -en "*ENDOFSOURCEFILES*\n" ) | \
293
5bbbb5fd2a8a fix: remove OSTv2 dependency so we will still work with the old one
timothy.murphy@nokia.com
parents: 291
diff changeset
   126
	$(JAVA_COMMAND) $(TRACE_COMPILER_START) $(UID_TC) &&  \
89
315b0aa777bd Make TC fail when there is an error. This is hypothetical in this version but the next version of the TC is in testing.
timothy.murphy@nokia.com
parents: 3
diff changeset
   127
	$(GNUMD5SUM) $(TRACE_SOURCE_LIST) > $(TRACE_MARKER) && \
300
e87b08dc4b44 SF Bug 2125 - [Raptor] - tracecompiler what output incorrect if mmp basename contains '.' e.g. fred.prd.mmp
timothy.murphy@nokia.com
parents: 293
diff changeset
   128
	{ $(GNUTOUCH) $(TRACE_DICTIONARY) $(AUTOGEN_HEADER); \
e87b08dc4b44 SF Bug 2125 - [Raptor] - tracecompiler what output incorrect if mmp basename contains '.' e.g. fred.prd.mmp
timothy.murphy@nokia.com
parents: 293
diff changeset
   129
	 $(GNUCAT) $(TRACE_SOURCE_LIST) ; true ; } \
3
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
   130
	$(call endrule,tracecompile)
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
   131
endef
511
7581d432643a fix: support new trace compiler features for preventing clashes. Automatically turn on OST_TRACE_COMPILER_IN_USE macro. Look for trace header in systemincludes. Make directories in makefile parse to prevent clashes during build. Correct path for autogen headers. Correct case issue with autogen headers on Linux.
timothy.murphy@nokia.com
parents: 300
diff changeset
   132
endif
7581d432643a fix: support new trace compiler features for preventing clashes. Automatically turn on OST_TRACE_COMPILER_IN_USE macro. Look for trace header in systemincludes. Make directories in makefile parse to prevent clashes during build. Correct path for autogen headers. Correct case issue with autogen headers on Linux.
timothy.murphy@nokia.com
parents: 300
diff changeset
   133
7581d432643a fix: support new trace compiler features for preventing clashes. Automatically turn on OST_TRACE_COMPILER_IN_USE macro. Look for trace header in systemincludes. Make directories in makefile parse to prevent clashes during build. Correct path for autogen headers. Correct case issue with autogen headers on Linux.
timothy.murphy@nokia.com
parents: 300
diff changeset
   134
endif
7581d432643a fix: support new trace compiler features for preventing clashes. Automatically turn on OST_TRACE_COMPILER_IN_USE macro. Look for trace header in systemincludes. Make directories in makefile parse to prevent clashes during build. Correct path for autogen headers. Correct case issue with autogen headers on Linux.
timothy.murphy@nokia.com
parents: 300
diff changeset
   135
7581d432643a fix: support new trace compiler features for preventing clashes. Automatically turn on OST_TRACE_COMPILER_IN_USE macro. Look for trace header in systemincludes. Make directories in makefile parse to prevent clashes during build. Correct path for autogen headers. Correct case issue with autogen headers on Linux.
timothy.murphy@nokia.com
parents: 300
diff changeset
   136
TRACE_DICTIONARY:=$(EPOCROOT)/epoc32/ost_dictionaries/$(TRACE_PRJNAME_SANITISED)_0x$(UID_TC)_Dictionary.xml
7581d432643a fix: support new trace compiler features for preventing clashes. Automatically turn on OST_TRACE_COMPILER_IN_USE macro. Look for trace header in systemincludes. Make directories in makefile parse to prevent clashes during build. Correct path for autogen headers. Correct case issue with autogen headers on Linux.
timothy.murphy@nokia.com
parents: 300
diff changeset
   137
AUTOGEN_HEADER:=$(EPOCROOT)/epoc32/include/$(TCAUTOGENDIR)/symbiantraces/autogen/$(TRACE_PRJNAME_SANITISED)_0x$(UID_TC)_TraceDefinitions.h
3
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
   138
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
   139
$(eval $(trace_compile))
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
   140
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
   141
$(eval $(call GenerateStandardCleanTarget, $(TRACE_PATH)/tracebuilder.cache $(TRACE_MARKER) $(TRACE_SOURCE_LIST),,))
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
   142
511
7581d432643a fix: support new trace compiler features for preventing clashes. Automatically turn on OST_TRACE_COMPILER_IN_USE macro. Look for trace header in systemincludes. Make directories in makefile parse to prevent clashes during build. Correct path for autogen headers. Correct case issue with autogen headers on Linux.
timothy.murphy@nokia.com
parents: 300
diff changeset
   143
$(call makepath,$(TRACE_PATH) $(dir $(TRACE_DICTIONARY) $(AUTOGEN_HEADER)))
3
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
   144
# End sanity guard
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
   145
endif
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
   146
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
   147
$(eval $(call GenerateStandardCleanTarget,$(TRACE_HEADERS),,))
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
   148
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
   149
else
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
   150
# Indicate to following parts of the FLM that we actually won't run
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
   151
# trace compiler so they can set dependencies accordingly.
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
   152
USE_TRACE_COMPILER:=
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
   153
endif
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
   154