69 ifneq ($(TRACE_PATH),) |
69 ifneq ($(TRACE_PATH),) |
70 TRACE_MARKER:=$(TRACE_MARKER_PATH)/tracecompile_$(TRACE_RELEASABLE_ID)_$(UID_TC).done |
70 TRACE_MARKER:=$(TRACE_MARKER_PATH)/tracecompile_$(TRACE_RELEASABLE_ID)_$(UID_TC).done |
71 TRACE_HEADERS:= |
71 TRACE_HEADERS:= |
72 |
72 |
73 TRACE_SOURCE_LIST:=$(TRACE_MARKER_PATH)/tracecompile_$(TRACE_RELEASABLE_ID)_$(UID_TC).sourcelist |
73 TRACE_SOURCE_LIST:=$(TRACE_MARKER_PATH)/tracecompile_$(TRACE_RELEASABLE_ID)_$(UID_TC).sourcelist |
74 |
74 TRACE_VARIANT_SOURCE_LIST:=$(OUTPUTPATH)/$(VARIANTPLATFORM)/$(VARIANTTYPE)/tracecompile_$(TRACE_RELEASABLE_ID)_$(UID_TC).sourcelist |
75 # 1. Append to or create the list of source files for trace compiler to process |
75 |
76 # 2. Check if the hash in trace marker remain unchanged. If not, remove marker so trace compiler will run again. |
76 # Write the list of sources for this variant to a file |
77 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)) |
77 # Make the combined sourcelist for this target depend on it |
|
78 define sourcelist_write |
|
79 $(TRACE_SOURCE_LIST): $(TRACE_VARIANT_SOURCE_LIST) |
|
80 |
|
81 .PHONY:: $(TRACE_VARIANT_SOURCE_LIST) |
|
82 |
|
83 $(TRACE_VARIANT_SOURCE_LIST): $(SOURCE) |
|
84 $(call startrule,sourcelist_write) \ |
|
85 echo -en '$$(subst $$(CHAR_SPACE),\n,$$(strip $$^))\n' > $$@ \ |
|
86 $(call endrule,sourcelist_write) |
|
87 |
|
88 endef |
|
89 |
|
90 $(eval $(sourcelist_write)) |
|
91 $(eval $(call GenerateStandardCleanTarget,$(TRACE_VARIANT_SOURCE_LIST),,)) |
|
92 |
78 |
93 |
79 $(if $(FLMDEBUG),$(info <debug>Trace Compiler sourcelist generation output: $(X)</debug>)) |
94 $(if $(FLMDEBUG),$(info <debug>Trace Compiler sourcelist generation output: $(X)</debug>)) |
80 |
95 |
81 $(TRACE_MARKER) : $(SOURCE) |
96 $(TRACE_MARKER) : $(SOURCE) |
82 |
97 |
114 # check if it looks like a version that supports the new cli interface: supporting up to verion 9 in the future. |
129 # 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)))) |
130 TRACE_VER:=$(findstring new,$(foreach version,2 3 4 5 6 7 8 9,$(patsubst $(version).%,new,$(TRACE_VSTR)))) |
116 endif |
131 endif |
117 $(if $(FLMDEBUG),$(info <debug>TRACE_VSTR=$(TRACE_VSTR) TRACE_VER=$(TRACE_VER)</debug>)) |
132 $(if $(FLMDEBUG),$(info <debug>TRACE_VSTR=$(TRACE_VSTR) TRACE_VER=$(TRACE_VER)</debug>)) |
118 |
133 |
|
134 |
|
135 # 0. Generate a combined sourcelist from all variants. |
|
136 # 0.1 Write the combined list to a temporary file |
|
137 # 0.2 Check if there are new files since the last build |
|
138 # md5 stored in the trace marker. |
|
139 # 0.3 Rewrite the combined sourcelist if new sourcefiles have appeared |
|
140 # since the last build |
|
141 # 1. Use pipe to send inputs to trace compiler to process |
|
142 # 2. Create a hash regarding to source names and put it in marker. |
|
143 # 3. Show source names that are processed by trace compiler |
|
144 |
119 ifeq ($(TRACE_VER),new) |
145 ifeq ($(TRACE_VER),new) |
120 define trace_compile |
146 define trace_compile |
121 $(TRACE_MARKER) : $(PROJECT_META) |
147 |
|
148 $(TRACE_SOURCE_LIST): |
|
149 $(call startrule,sourcelist_combine) \ |
|
150 $(GNUCAT) $$^ | $(GNUSORT) -u > $$@.new && \ |
|
151 $(GNUMD5SUM) -c $(TRACE_MARKER) 2>/dev/null || \ |
|
152 $(GNUCP) $$@.new $$@ \ |
|
153 $(call endrule,sourcelist_combine) |
|
154 |
|
155 $(TRACE_MARKER) : $(PROJECT_META) $(TRACE_SOURCE_LIST) |
122 $(call startrule,tracecompile) \ |
156 $(call startrule,tracecompile) \ |
123 ( $(GNUCAT) $(TRACE_SOURCE_LIST); \ |
157 ( $(GNUCAT) $(TRACE_SOURCE_LIST); \ |
124 echo -en "*ENDOFSOURCEFILES*\n" ) | \ |
158 echo -en "*ENDOFSOURCEFILES*\n" ) | \ |
125 $(JAVA_COMMAND) $(TRACE_COMPILER_START) $(if $(FLMDEBUG),-d,) --uid=$(UID_TC) --project=$(TRACE_PRJNAME) --mmp=$(PROJECT_META) --traces=$(TRACE_PATH) && \ |
159 $(JAVA_COMMAND) $(TRACE_COMPILER_START) $(if $(FLMDEBUG),-d,) --uid=$(UID_TC) --project=$(TRACE_PRJNAME) --mmp=$(PROJECT_META) --traces=$(TRACE_PATH) && \ |
126 $(GNUMD5SUM) $(TRACE_SOURCE_LIST) > $(TRACE_MARKER) && \ |
160 $(GNUMD5SUM) $(TRACE_SOURCE_LIST).new > $(TRACE_MARKER) 2>/dev/null && \ |
127 { $(GNUTOUCH) $(TRACE_DICTIONARY) $(AUTOGEN_HEADER); \ |
161 { $(GNUTOUCH) $(TRACE_DICTIONARY) $(AUTOGEN_HEADER); \ |
128 $(GNUCAT) $(TRACE_SOURCE_LIST) ; true ; } \ |
162 $(GNUCAT) $(TRACE_SOURCE_LIST) ; true ; } \ |
129 $(call endrule,tracecompile) |
163 $(call endrule,tracecompile) |
130 endef |
164 endef |
131 |
165 |
132 else # Old inteface |
166 else # Old inteface |
133 TRACE_COMPILER_START:=-classpath $(TRACE_COMPILER_PATH)/tracecompiler com.nokia.tracecompiler.TraceCompiler |
167 TRACE_COMPILER_START:=-classpath $(TRACE_COMPILER_PATH)/tracecompiler com.nokia.tracecompiler.TraceCompiler |
134 # 1. Use pipe to send inputs to trace compiler to process |
168 |
135 # 2. Create a hash regarding to source names and put it in marker. |
|
136 # 3. Show source names that are processed by trace compiler |
|
137 define trace_compile |
169 define trace_compile |
138 $(TRACE_MARKER) : $(PROJECT_META) |
170 |
|
171 $(TRACE_SOURCE_LIST): |
|
172 $(call startrule,sourcelist_combine) \ |
|
173 $(GNUCAT) $$^ | $(GNUSORT) -u > $$@.new && \ |
|
174 $(GNUMD5SUM) -c $(TRACE_MARKER) || \ |
|
175 $(GNUCP) $$@.new $$@ \ |
|
176 $(call endrule,sourcelist_combine) |
|
177 |
|
178 $(TRACE_MARKER) : $(PROJECT_META) $(TRACE_SOURCE_LIST) |
139 $(call startrule,tracecompile) \ |
179 $(call startrule,tracecompile) \ |
140 ( echo -en "$(OLDTC_TRACE_PRJNAME)\n$(PROJECT_META)\n"; \ |
180 ( echo -en "$(OLDTC_TRACE_PRJNAME)\n$(PROJECT_META)\n"; \ |
141 $(GNUCAT) $(TRACE_SOURCE_LIST); \ |
181 $(GNUCAT) $(TRACE_SOURCE_LIST); \ |
142 echo -en "*ENDOFSOURCEFILES*\n" ) | \ |
182 echo -en "*ENDOFSOURCEFILES*\n" ) | \ |
143 $(JAVA_COMMAND) $(TRACE_COMPILER_START) $(UID_TC) && \ |
183 $(JAVA_COMMAND) $(TRACE_COMPILER_START) $(UID_TC) && \ |
144 $(GNUMD5SUM) $(TRACE_SOURCE_LIST) > $(TRACE_MARKER) && \ |
184 $(GNUMD5SUM) $(TRACE_SOURCE_LIST).new > $(TRACE_MARKER) && \ |
145 { $(GNUTOUCH) $(TRACE_DICTIONARY) $(AUTOGEN_HEADER); \ |
185 { $(GNUTOUCH) $(TRACE_DICTIONARY) $(AUTOGEN_HEADER); \ |
146 $(GNUCAT) $(TRACE_SOURCE_LIST) ; true ; } \ |
186 $(GNUCAT) $(TRACE_SOURCE_LIST) ; true ; } \ |
147 $(call endrule,tracecompile) |
187 $(call endrule,tracecompile) |
148 endef |
188 endef |
149 |
189 |