Merge fix
authortimothy.murphy@nokia.com
Fri, 09 Apr 2010 14:10:41 +0100
branchfix
changeset 476 c521ed6bf746
parent 475 2b71dc28e5fc (diff)
parent 473 ae731bee7d46 (current diff)
child 477 ecf6886a5469
Merge
--- a/sbsv2/raptor/lib/flm/resource.flm	Thu Apr 08 15:30:47 2010 +0100
+++ b/sbsv2/raptor/lib/flm/resource.flm	Fri Apr 09 14:10:41 2010 +0100
@@ -159,7 +159,7 @@
       DEPENDENCY_CORRECTOR:={ $(GNUSED) -n -r '1 p;\% [^ \/]+\.((rsg)|(mbg))%I {s% ([^ \/]+\.((rsg)|(mbg)))% $(EPOCROOT)\/epoc32\/include\/\1%ig; p}' && echo "" ; }
     else
       # Generate full dependency information
-      DEPENDENCY_CORRECTOR:=$(GNUSED)  -r 's% ([^ \/]+\.((rsg)|(mbg)))% $(EPOCROOT)\/epoc32\/include\/\1%ig'
+      DEPENDENCY_CORRECTOR:=$(GNUSED)  -r 's% ([^ \/]+\.((rsg)|(mbg)))% $(EPOCROOT)\/epoc32\/include\/\1%ig' 
     endif
 
 
@@ -168,7 +168,7 @@
 	  $(call startrule,resourcedependencies,FORCESUCCESS) \
 	  $(GNUCPP) -C -DLANGUAGE_$(3) -DLANGUAGE_$(subst sc,SC,$(3)) $(call makemacrodef,-D,$(MMPDEFS))\
 	  $(CPPOPT) $(SOURCE) -M -MG -MT"$(1)" | \
-	  $(DEPENDENCY_CORRECTOR) >$$@ \
+	  $$(DEPENDENCY_CORRECTOR) >$$@ \
 	  $(call endrule,resourcedependencies)
 
     $(1): $(1).d
@@ -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)))