sbsv2/raptor/lib/flm/resource.mk
author srilekhas <srilekhas@symbian.org>
Wed, 18 Aug 2010 11:18:38 +0100
changeset 627 cb3264f4c6e6
parent 625 a1925fb7753a
child 630 31ef8a13d4f4
permissions -rw-r--r--
Merge : re-applies missing part of fix for Bug 2901,Add export for s60ibymacros.pm
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
625
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
     1
# Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
     2
# All rights reserved.
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
     3
# This component and the accompanying materials are made available
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
     4
# under the terms of the License "Eclipse Public License v1.0"
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
     5
# which accompanies this distribution, and is available
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
     6
# at the URL "http://www.eclipse.org/legal/epl-v10.html".
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
     7
#
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
     8
# Initial Contributors:
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
     9
# Nokia Corporation - initial contribution.
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
    10
#
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
    11
# Contributors:
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
    12
#
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
    13
# Description:
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
    14
# Function Like Makefile (FLM): Shared macros for resource.flm
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
    15
#
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
    16
#
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
    17
###############################################################################
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
    18
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
    19
###############################################################################
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
    20
# $1 is the name of the intermediate RESOURCEFILE that is to be produced
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
    21
# $2 is the LANGUAGE		(eg. sc or 01 or 02 ...)
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
    22
# $3 is the name of the dependency file
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
    23
define resource.deps
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
    24
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
    25
    $(if $(FLMDEBUG),$$(info <debug>resource.deps: $1 LANG:$2 dep $3 </debug>))
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
    26
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
    27
    RESOURCE_DEPS:: $3
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
    28
    
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
    29
    # could  force deps to be generated always - debatable.
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
    30
    # .PHONY: $3
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
    31
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
    32
    $3: $(SOURCE)
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
    33
	$(call startrule,resourcedependencies,FORCESUCCESS) \
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
    34
	$(GNUCPP) -DLANGUAGE_$(3) -DLANGUAGE_$(subst sc,SC,$2) $(call makemacrodef,-D,$(MMPDEFS))\
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
    35
	$(CPPOPT) $(SOURCE) -M -MG -MT"$1" | \
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
    36
	$$(DEPENDENCY_CORRECTOR) >$3 \
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
    37
	$(call endrule,resourcedependencies)
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
    38
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
    39
    SOURCETARGET_$(call sanitise,$(SOURCE)): $3
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
    40
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
    41
    CLEANTARGETS:=$$(CLEANTARGETS) $3
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
    42
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
    43
endef # resource.deps #
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
    44
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
    45
###############################################################################
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
    46
# $1 is the name of the intermediate RESOURCEFILE
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
    47
# $2 is the LANGUAGE		(eg. sc or 01 or 02 ...)
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
    48
# Uses $(RESOURCEHEADER),$(SOURCE),$(HEADLANG),$(MMPDEFS) apart from some tools
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
    49
define resource.build
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
    50
    $(if $(FLMDEBUG),$$(info <debug>resource.build: $1 LANG:$2 </debug>))
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
    51
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
    52
      DOHEADER:=
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
    53
      ifeq ($(HEADLANG),$2)
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
    54
        ifneq ($(RESOURCEHEADER),)
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
    55
          RESOURCE:: $(RESOURCEHEADER)
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
    56
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
    57
          DOHEADER:=-h$(RESOURCEHEADER)
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
    58
          # strictly speaking if $1 is made then the header file should be there too
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
    59
          # but suppose someone adds a header statement to their MMP after doing a build?
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
    60
          # so here we recreate the resource header if its missing even if the intermediate resource
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
    61
          # has actually been built.  The problem is: what if the rpp file is not there (oops)? 
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
    62
          # So this is not perfect but I think that the situation is fairly unlikely.
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
    63
          # We can afford to put in an if statement for the rsg file - it's not a race condition because
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
    64
          # $1 is done and the build engine guarantees that it's there so no resource header
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
    65
          # can be attempted while we're trying to test.
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
    66
          $(RESOURCEHEADER) : $1
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
    67
	    $(call startrule,resourcecompile.headerfill,FORCESUCCESS) \
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
    68
	    if [ ! -f "$(RESOURCEHEADER)" ]; then $(GNUCPP)  -DLANGUAGE_$2 \
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
    69
	      -DLANGUAGE_$(subst sc,SC,$(2)) $(call makemacrodef,-D,$(MMPDEFS))\
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
    70
	      $(CPPOPT) $(SOURCE) -o $1.rpp; fi && \
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
    71
	    if [ ! -f "$(RESOURCEHEADER)" ]; then $(RCOMP) -m045,046,047 -u -h$$@ -s$1.rpp; fi \
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
    72
	    $(call endrule,resourcecompile.headerfill)
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
    73
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
    74
          # we will add the resourceheader to RELEASABLES globally
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
    75
        endif
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
    76
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
    77
      else
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
    78
        # Use the headlang resource (in primaryfile) as the dependency 
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
    79
        # "leader" for this resource
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
    80
        $1: $(PRIMARYFILE)
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
    81
      endif
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
    82
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
    83
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
    84
      RESOURCE:: $1
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
    85
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
    86
      $1: $(SOURCE)
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
    87
	  $(call startrule,resourcecompile,FORCESUCCESS) \
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
    88
	  $(GNUCPP)  -DLANGUAGE_$2 -DLANGUAGE_$(subst sc,SC,$(2)) $(call makemacrodef,-D,$(MMPDEFS))\
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
    89
	  $(CPPOPT) $(SOURCE) -o $1.rpp && \
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
    90
	  $(RCOMP) -m045,046,047 -u $$(DOHEADER) -o$$@ -s$1.rpp \
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
    91
	  $(call endrule,resourcecompile)
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
    92
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
    93
    SOURCETARGET_$(call sanitise,$(SOURCE)): $1
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
    94
    CLEANTARGETS:=$$(CLEANTARGETS) $1 $1.rpp 
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
    95
endef # resource.build
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
    96
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
    97
###############################################################################
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
    98
# $1 is the name of the intermediate RESOURCEFILE
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
    99
# $2 is the target name (without path) of the final resource file
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
   100
define resource.makecopies
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
   101
  
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
   102
  $(call copyresource,$1,$(sort $(addsuffix /$2,$(RSCCOPYDIRS))))
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
   103
endef
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
   104
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
   105
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
   106
###############################################################################
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
   107
# $1 is the intermediate filename base (eg. /epoc32/build/xxx/b_)
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
   108
# $2 is the LANGUAGE		(eg. sc or 01 or 02 ...)
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
   109
define resource.headeronly
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
   110
  ifeq "$(MAKEFILE_GROUP)" "RESOURCE_DEPS"
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
   111
    # generate the resource header dependency files
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
   112
    $(eval DEPENDFILENAME:=$1_$2.rsg.d)
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
   113
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
   114
    RESOURCE_DEPS:: $(DEPENDFILENAME)
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
   115
        
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
   116
    # could  force deps to be generated always - debatable.
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
   117
    # .PHONY: $(DEPENDFILENAME)
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
   118
   
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
   119
    $(DEPENDFILENAME): $(SOURCE)
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
   120
	$(call startrule,resource.headeronly.deps,FORCESUCCESS) \
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
   121
	$(GNUCPP) -DLANGUAGE_$2 -DLANGUAGE_$(subst sc,SC,$2) $(call makemacrodef,-D,$(MMPDEFS))\
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
   122
	$(CPPOPT) $(SOURCE) -M -MG -MT"$(RESOURCEHEADER)" | \
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
   123
	$$(DEPENDENCY_CORRECTOR) > $$@ \
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
   124
	$(call endrule,resource.headeronly.deps)
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
   125
   
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
   126
    SOURCETARGET_$(call sanitise,$(SOURCE)): $(DEPENDFILENAME)
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
   127
   
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
   128
    CLEANTARGETS:=$$(CLEANTARGETS) $(DEPENDFILENAME)
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
   129
  else # generate the resource header
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
   130
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
   131
    RESOURCE:: $(RESOURCEHEADER)
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
   132
    
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
   133
    $(RESOURCEHEADER): $(SOURCE)
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
   134
	$(call startrule,resource.headeronly,FORCESUCCESS) \
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
   135
	$(GNUCPP)  -DLANGUAGE_$2 -DLANGUAGE_$(subst sc,SC,$(3)) $(call makemacrodef,-D,$(MMPDEFS))\
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
   136
	$(CPPOPT) $(SOURCE) -o $1_$2.rsg.rpp && \
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
   137
	$(RCOMP) -m045,046,047 -u -h$$@ -s$1_$2.rsg.rpp \
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
   138
	$(call endrule,resource.headeronly)
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
   139
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
   140
    CLEANTARGETS:=$$(CLEANTARGETS) $1_$2.rsg.rpp
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
   141
    # we will add the resourceheader to RELEASABLES globally
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
   142
    # individual source file compilation
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
   143
    
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
   144
    SOURCETARGET_$(call sanitise,$(SOURCE)): $(RESOURCEHEADER)
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
   145
    
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
   146
    $(eval DEPENDFILE:=$(wildcard $(DEPENDFILENAME)))
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
   147
    
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
   148
    ifneq "$(DEPENDFILE)" ""
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
   149
      ifeq "$(filter %CLEAN,$(call uppercase,$(MAKECMDGOALS)))" ""
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
   150
         -include $(DEPENDFILE)
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
   151
      endif
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
   152
    endif
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
   153
  endif
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
   154
endef # resource.headeronly #
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
   155
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
   156
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
   157
###############################################################################
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
   158
define copyresource
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
   159
# $(1) is the source
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
   160
# $(2) is the space separated list of destinations which must be filenames
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
   161
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
   162
   RELEASABLES:=$$(RELEASABLES) $(2)
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
   163
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
   164
   $(info <finalcopy source='$1'>$2</finalcopy>)
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
   165
 
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
   166
endef # copyresource #