author | Jon Chatten |
Thu, 25 Feb 2010 14:57:54 +0000 | |
branch | fix |
changeset 267 | ed4edcfbc38c |
parent 236 | a2dc04c8e649 |
child 277 | dbd582b8c0ab |
permissions | -rw-r--r-- |
3 | 1 |
# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
2 |
# All rights reserved. |
|
3 |
# This component and the accompanying materials are made available |
|
4 |
# under the terms of the License "Eclipse Public License v1.0" |
|
5 |
# which accompanies this distribution, and is available |
|
6 |
# at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 |
# |
|
8 |
# Initial Contributors: |
|
9 |
# Nokia Corporation - initial contribution. |
|
10 |
# |
|
11 |
# Contributors: |
|
12 |
# |
|
13 |
# Description: |
|
14 |
# Run Trace Compiler on source files to generate trace headers and decode files |
|
15 |
||
16 |
TRACE_PRJNAME:=$(basename $(notdir $(PROJECT_META))) |
|
17 |
# Find out TRACE_PATH |
|
18 |
TRACE_PATH:=$(strip $(foreach DIR,$(USERINCLUDE),$(filter %/traces_$(TRACE_PRJNAME),$(DIR)))) |
|
19 |
ifeq ($(TRACE_PATH),) |
|
20 |
TRACE_PATH:=$(strip $(foreach DIR,$(USERINCLUDE),$(filter %/traces,$(DIR)))) |
|
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 |
||
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
|
28 |
# 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
|
29 |
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
|
30 |
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
|
31 |
|
3 | 32 |
$(if $(FLMDEBUG),$(info <debug>TRACE_PATH = $(TRACE_PATH)</debug>)) |
33 |
||
34 |
# Run trace compiler only if TRACE_PATH exists |
|
35 |
ifneq ($(TRACE_PATH),) |
|
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
|
36 |
|
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
|
37 |
|
3 | 38 |
TRACE_MARKER:=$(TRACE_MARKER_PATH)/tracecompile_$(TRACE_PRJNAME)_$(UID_TC).done |
39 |
TRACE_HEADERS:= |
|
40 |
||
41 |
TRACE_SOURCE_LIST:=$(TRACE_MARKER_PATH)/tracecompile_$(TRACE_PRJNAME)_$(UID_TC).sourcelist |
|
42 |
||
43 |
# 1. Append to or create the list of source files for trace compiler to process |
|
44 |
# 2. Check if the hash in trace marker remain unchanged. If not, remove marker so trace compiler will run again. |
|
45 |
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)) |
|
46 |
||
47 |
$(if $(FLMDEBUG),$(info <debug>Trace Compiler sourcelist generation output: $(X)</debug>)) |
|
48 |
||
49 |
$(TRACE_MARKER) : $(SOURCE) |
|
50 |
||
51 |
TRACE_HEADERS:=$(foreach SRC,$(SOURCE),$(TRACE_PATH)/$(basename $(notdir $(SRC)))Traces.h) |
|
52 |
||
53 |
$(TRACE_HEADERS): $(TRACE_MARKER) |
|
54 |
||
55 |
ifeq ($(GUARD_$(call sanitise,$(TRACE_MARKER))),) |
|
56 |
GUARD_$(call sanitise,$(TRACE_MARKER)):=1 |
|
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 |
TRACE_DICTIONARY:=$(EPOCROOT)/epoc32/ost_dictionaries/$(TRACE_PRJNAME)_0x$(UID_TC)_Dictionary.xml |
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 |
AUTOGEN_HEADER:=$(EPOCROOT)/epoc32/include/internal/SymbianTraces/autogen/$(TRACE_PRJNAME)_0x$(UID_TC)_TraceDefinitions.h |
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 |
|
3 | 61 |
JAVA_COMMAND:=$(SBS_JAVATC) |
62 |
TRACE_COMPILER_PATH:=$(EPOCROOT)/epoc32/tools |
|
63 |
TRACE_COMPILER_START:=-classpath $(TRACE_COMPILER_PATH)/tracecompiler com.nokia.tracecompiler.TraceCompiler |
|
64 |
||
65 |
||
66 |
# 1. Use pipe to send inputs to trace compiler to process |
|
67 |
# 2. Create a hash regarding to source names and put it in marker. |
|
68 |
# 3. Show source names that are processed by trace compiler |
|
69 |
define trace_compile |
|
70 |
$(TRACE_MARKER) : $(PROJECT_META) |
|
71 |
$(call startrule,tracecompile) \ |
|
72 |
( echo -en "$(TRACE_PRJNAME)\n$(PROJECT_META)\n"; \ |
|
73 |
$(GNUCAT) $(TRACE_SOURCE_LIST); \ |
|
74 |
echo -en "*ENDOFSOURCEFILES*\n" ) | \ |
|
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
|
75 |
$(JAVA_COMMAND) $(TRACE_COMPILER_START) $(UID_TC) && \ |
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
|
76 |
$(GNUMD5SUM) $(TRACE_SOURCE_LIST) > $(TRACE_MARKER) && \ |
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
|
77 |
{ $(GNUCAT) $(TRACE_SOURCE_LIST) ; true ; } \ |
3 | 78 |
$(call endrule,tracecompile) |
79 |
endef |
|
80 |
||
81 |
$(eval $(trace_compile)) |
|
82 |
||
83 |
$(eval $(call GenerateStandardCleanTarget, $(TRACE_PATH)/tracebuilder.cache $(TRACE_MARKER) $(TRACE_SOURCE_LIST),,)) |
|
84 |
||
85 |
# End sanity guard |
|
86 |
endif |
|
87 |
||
88 |
$(eval $(call GenerateStandardCleanTarget,$(TRACE_HEADERS),,)) |
|
89 |
||
90 |
else |
|
91 |
# Indicate to following parts of the FLM that we actually won't run |
|
92 |
# trace compiler so they can set dependencies accordingly. |
|
93 |
USE_TRACE_COMPILER:= |
|
94 |
endif |
|
95 |