sbsv2/raptor/lib/flm/resource.flm
changeset 713 7b7f0409fc00
parent 674 37ee82a83d43
equal deleted inserted replaced
712:df89378e9223 713:7b7f0409fc00
    41 ifneq ($(TARGETPATH),)
    41 ifneq ($(TARGETPATH),)
    42 RSCDIR:=$(subst //,/,$(EPOCROOT)/epoc32/data/z/$(TARGETPATH))
    42 RSCDIR:=$(subst //,/,$(EPOCROOT)/epoc32/data/z/$(TARGETPATH))
    43 else
    43 else
    44 RSCDIR:=$(subst //,/,$(EPOCROOT)/epoc32/data)
    44 RSCDIR:=$(subst //,/,$(EPOCROOT)/epoc32/data)
    45 endif
    45 endif
    46 RESBASE:=$(RSCDIR)/$(TARGET_lower)
       
    47 
    46 
    48 # Ensure that RELEASABLES and CLEANTARGETS cannot expand indefinitely in successive calls to this flm:
    47 # Ensure that RELEASABLES and CLEANTARGETS cannot expand indefinitely in successive calls to this flm:
    49 CLEANTARGETS:=
    48 CLEANTARGETS:=
    50 RELEASABLES:=
    49 RELEASABLES:=
    51 CREATABLEPATHS:=
    50 CREATABLEPATHS:=
    62 else
    61 else
    63         RESOURCEHEADER:=
    62         RESOURCEHEADER:=
    64 endif
    63 endif
    65 
    64 
    66 # we create intermediate .rpp and .d files
    65 # we create intermediate .rpp and .d files
    67 INTERBASE_TMP:=$(OUTPUTPATH)/$(TARGET_lower)_$(notdir $(basename $(SOURCE)))
    66 INTERBASE_TMP:=$(OUTPUTPATH)/$(TARGET_var)_$(notdir $(basename $(SOURCE)))
    68 
    67 
    69 LANGUAGES:=$(LANGUAGES:SC=sc) # ensure that we don't ever have to worry about case consistency w.r.t languages or get confused into thinking that SC!=sc (which it is)
    68 LANGUAGES:=$(LANGUAGES:SC=sc) # ensure that we don't ever have to worry about case consistency w.r.t languages or get confused into thinking that SC!=sc (which it is)
    70 LANGUAGES:=$(call uniq,$(LANGUAGES)) # remove any duplicates from the list (usually the result of multiple LANG lists both in and out of START RESOURCE blocks)
    69 LANGUAGES:=$(call uniq,$(LANGUAGES)) # remove any duplicates from the list (usually the result of multiple LANG lists both in and out of START RESOURCE blocks)
    71 
    70 
    72 
    71 
   165     else
   164     else
   166         RESOURCE:: $(PRIMARYFILE)
   165         RESOURCE:: $(PRIMARYFILE)
   167 
   166 
   168         # invoke the macro that creates targets for building resources, once per language
   167         # invoke the macro that creates targets for building resources, once per language
   169         # For sc we generate $(INTERBASE_TMP).rsc and define LANGUAGE_SC and LANGUAGE_sc.
   168         # For sc we generate $(INTERBASE_TMP).rsc and define LANGUAGE_SC and LANGUAGE_sc.
   170         $(foreach L,$(LANGUAGES),$(eval $(call resource.build,$(INTERBASE_TMP).r$(L),$(L),$(TARGET_lower).r$(L))))
   169         $(foreach L,$(LANGUAGES),$(eval $(call resource.build,$(INTERBASE_TMP).r$(L),$(L),$(TARGET_var).r$(L))))
   171 
   170 
   172 
   171 
   173         DEPENDFILE:=$(wildcard $(DEPENDFILENAME))
   172         DEPENDFILE:=$(wildcard $(DEPENDFILENAME))
   174         ifneq "$(DEPENDFILE)" ""
   173         ifneq "$(DEPENDFILE)" ""
   175           ifeq "$(filter %CLEAN,$(call uppercase,$(MAKECMDGOALS)))" ""
   174           ifeq "$(filter %CLEAN,$(call uppercase,$(MAKECMDGOALS)))" ""
   184     # resource block, check if there are any new copies to be made for
   183     # resource block, check if there are any new copies to be made for
   185     # this variant. e.g. winscw requires that we make some extra copies.
   184     # this variant. e.g. winscw requires that we make some extra copies.
   186     # We tried to copy after running rcomp itself but we still need these
   185     # We tried to copy after running rcomp itself but we still need these
   187     # targets for the sake of dependencies or, for example, if someone
   186     # targets for the sake of dependencies or, for example, if someone
   188     # merely adds a new copy when the resource is up-to-date
   187     # merely adds a new copy when the resource is up-to-date
   189     $(foreach L,$(LANGUAGES),$(eval $(call resource.makecopies,$(INTERBASE_TMP).r$(L),$(TARGET_lower).r$(L))))
   188     $(foreach L,$(LANGUAGES),$(eval $(call resource.makecopies,$(INTERBASE_TMP).r$(L),$(TARGET_var).r$(L))))
   190 
   189 
   191   endif
   190   endif
   192 else
   191 else
   193   #
   192   #
   194   # HEADERONLY was specified
   193   # HEADERONLY was specified
   195   #
   194   #
   196   GUARD:=TARGET_$(call sanitise,$(INTERBASE_TMP))_rsg
   195   GUARD:=TARGET_$(call sanitise,$(INTERBASE_TMP))_rsg
   197   $(if $(FLMDEBUG),$(info <debug>resource.flm: Headeronly $(INTERBASE_TMP) $(TARGET_lower).rsg LANGUAGES:=$(LANGUAGES)</debug>))
   196   $(if $(FLMDEBUG),$(info <debug>resource.flm: Headeronly $(INTERBASE_TMP) $(TARGET_var).rsg LANGUAGES:=$(LANGUAGES)</debug>))
   198 
   197 
   199   ifeq ($($(GUARD)),)
   198   ifeq ($($(GUARD)),)
   200       $(GUARD):=1  
   199       $(GUARD):=1  
   201       $(eval $(call resource.headeronly,$(INTERBASE_TMP),$(HEADLANG)))
   200       $(eval $(call resource.headeronly,$(INTERBASE_TMP),$(HEADLANG)))
   202       # The headeronly macro manages dependency including on its own
   201       # The headeronly macro manages dependency including on its own