fix: resource cleaning fix fix
authortimothy.murphy@nokia.com
Fri, 09 Apr 2010 13:26:40 +0100
branchfix
changeset 475 2b71dc28e5fc
parent 474 d22e74b2b0f8
child 476 c521ed6bf746
fix: resource cleaning fix fix: make copies immediately after generating the resource if possible since it will keep file caches hot.
sbsv2/raptor/lib/flm/resource.flm
--- a/sbsv2/raptor/lib/flm/resource.flm	Fri Apr 09 13:07:06 2010 +0100
+++ b/sbsv2/raptor/lib/flm/resource.flm	Fri Apr 09 13:26:40 2010 +0100
@@ -229,21 +229,26 @@
         ifeq ($(TARGET_$(call sanitise,$1)),)
                 TARGET_$(call sanitise,$1):=1
 
-            $(if $(FLMDEBUG),$(info generateresource: $(1) from $(2) LANG:$(3)),)
+            $(if $(FLMDEBUG),$(info generateresource: $(1) from $(2) LANG:$(3)),)	
+            $(if $(FLMDEBUG),$(info generateresource: copies: $(sort $(patsubst %,%/$(notdir $(1)),$(RSCCOPYDIRS)))))
 
+            CLEANTARGETS:=$$(CLEANTARGETS) $(1)
 
             RESOURCE:: $(1)
 
             $(1): $(2) $(RCOMP)
 			$(call startrule,resourcecompile,FORCESUCCESS) \
-			$(RCOMP) -m045,046,047 -u -o$(1) -s$(2) \
+			$(RCOMP) -m045,046,047 -u -o$(1) -s$(2) && \
+        		{ $(foreach F,$(sort $(patsubst %,%/$(notdir $(1)),$(RSCCOPYDIRS))),$(GNUCP) $(1) $(F) ; ) } \
 			$(call endrule,resourcecompile)
 
         endif
 
 #	Whether or not we have generated this resource for some other variant, check if there
 #       are any new copies to be made for this variant. e.g. winscw requires that we make
-#       some extra copies.
+#       some extra copies.  We tried to copy after running rcomp itself but we still need these
+#       targets for the sake of dependencies or, for example if someone merely adds a new copy 
+#       when the resource is up-to-date
 
         $(if $(FLMDEBUG),$(info <debug>resource copies of $(notdir $1) in: $(RSCCOPYDIRS)</debug>))
         $(foreach F,$(sort $(patsubst %,%/$(notdir $(1)),$(RSCCOPYDIRS))),$(call copyresource,$(1),$(F)))