sbsv2/raptor/lib/flm/resource.mk
author Jon Chatten
Mon, 13 Sep 2010 14:04:04 +0100
changeset 641 8dd670a9f34f
parent 630 31ef8a13d4f4
permissions -rw-r--r--
sbs version 2.15.2
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) \
630
31ef8a13d4f4 sbs version 2.15.1
Jon Chatten
parents: 625
diff changeset
    34
	$(GNUCPP) -DLANGUAGE_$(2) -DLANGUAGE_$(subst sc,SC,$2) $(call makemacrodef,-D,$(MMPDEFS))\
625
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
630
31ef8a13d4f4 sbs version 2.15.1
Jon Chatten
parents: 625
diff changeset
    47
# Must be a separate macro since we 
31ef8a13d4f4 sbs version 2.15.1
Jon Chatten
parents: 625
diff changeset
    48
define resource.decideheader
625
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
    49
      DOHEADER:=
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
    50
      ifeq ($(HEADLANG),$2)
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
    51
        ifneq ($(RESOURCEHEADER),)
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
    52
          RESOURCE:: $(RESOURCEHEADER)
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
    53
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
    54
          DOHEADER:=-h$(RESOURCEHEADER)
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
    55
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
    56
          # we will add the resourceheader to RELEASABLES globally
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
    57
        endif
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
    58
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
    59
      else
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
    60
        # 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
    61
        # "leader" for this resource
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
    62
        $1: $(PRIMARYFILE)
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
    63
      endif
630
31ef8a13d4f4 sbs version 2.15.1
Jon Chatten
parents: 625
diff changeset
    64
endef
31ef8a13d4f4 sbs version 2.15.1
Jon Chatten
parents: 625
diff changeset
    65
31ef8a13d4f4 sbs version 2.15.1
Jon Chatten
parents: 625
diff changeset
    66
# $1 is the name of the intermediate RESOURCEFILE
31ef8a13d4f4 sbs version 2.15.1
Jon Chatten
parents: 625
diff changeset
    67
# $2 is the LANGUAGE		(eg. sc or 01 or 02 ...)
31ef8a13d4f4 sbs version 2.15.1
Jon Chatten
parents: 625
diff changeset
    68
# Uses $(RESOURCEHEADER),$(SOURCE),$(HEADLANG),$(MMPDEFS) apart from some tools
31ef8a13d4f4 sbs version 2.15.1
Jon Chatten
parents: 625
diff changeset
    69
define resource.build
31ef8a13d4f4 sbs version 2.15.1
Jon Chatten
parents: 625
diff changeset
    70
    $(if $(FLMDEBUG),$$(info <debug>resource.build: $1 LANG:$2 </debug>))
31ef8a13d4f4 sbs version 2.15.1
Jon Chatten
parents: 625
diff changeset
    71
31ef8a13d4f4 sbs version 2.15.1
Jon Chatten
parents: 625
diff changeset
    72
    $(eval $(resource.decideheader))
31ef8a13d4f4 sbs version 2.15.1
Jon Chatten
parents: 625
diff changeset
    73
31ef8a13d4f4 sbs version 2.15.1
Jon Chatten
parents: 625
diff changeset
    74
    ifneq ($(DOHEADER),)
31ef8a13d4f4 sbs version 2.15.1
Jon Chatten
parents: 625
diff changeset
    75
        # Strictly speaking if $1 is made then the header file should be there too
31ef8a13d4f4 sbs version 2.15.1
Jon Chatten
parents: 625
diff changeset
    76
        # but suppose someone adds a header statement to their MMP after doing a build?
31ef8a13d4f4 sbs version 2.15.1
Jon Chatten
parents: 625
diff changeset
    77
        # so here we recreate the resource header if its missing even if the intermediate resource
31ef8a13d4f4 sbs version 2.15.1
Jon Chatten
parents: 625
diff changeset
    78
        # has actually been built.  The problem is: what if the rpp file is not there (oops)? 
31ef8a13d4f4 sbs version 2.15.1
Jon Chatten
parents: 625
diff changeset
    79
        # So this is not perfect but I think that the situation is fairly unlikely.
31ef8a13d4f4 sbs version 2.15.1
Jon Chatten
parents: 625
diff changeset
    80
        # We can afford to put in an if statement for the rsg file - it's not a race condition because
31ef8a13d4f4 sbs version 2.15.1
Jon Chatten
parents: 625
diff changeset
    81
        # $1 is done and the build engine guarantees that it's there so no resource header
31ef8a13d4f4 sbs version 2.15.1
Jon Chatten
parents: 625
diff changeset
    82
        # can be attempted while we're trying to test.
31ef8a13d4f4 sbs version 2.15.1
Jon Chatten
parents: 625
diff changeset
    83
        $(RESOURCEHEADER) : $1
31ef8a13d4f4 sbs version 2.15.1
Jon Chatten
parents: 625
diff changeset
    84
	    $(call startrule,resourcecompile.headerfill,FORCESUCCESS) \
31ef8a13d4f4 sbs version 2.15.1
Jon Chatten
parents: 625
diff changeset
    85
	    if [ ! -f "$(RESOURCEHEADER)" ]; then $(GNUCPP)  -DLANGUAGE_$2 \
31ef8a13d4f4 sbs version 2.15.1
Jon Chatten
parents: 625
diff changeset
    86
	      -DLANGUAGE_$(subst sc,SC,$(2)) $(call makemacrodef,-D,$(MMPDEFS))\
31ef8a13d4f4 sbs version 2.15.1
Jon Chatten
parents: 625
diff changeset
    87
	      $(CPPOPT) $(SOURCE) -o $1.rpp; fi && \
31ef8a13d4f4 sbs version 2.15.1
Jon Chatten
parents: 625
diff changeset
    88
	    if [ ! -f "$(RESOURCEHEADER)" ]; then $(RCOMP) -m045,046,047 -u -h$$@ -s$1.rpp; fi \
31ef8a13d4f4 sbs version 2.15.1
Jon Chatten
parents: 625
diff changeset
    89
	    $(call endrule,resourcecompile.headerfill)
31ef8a13d4f4 sbs version 2.15.1
Jon Chatten
parents: 625
diff changeset
    90
    endif
625
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
    91
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
630
31ef8a13d4f4 sbs version 2.15.1
Jon Chatten
parents: 625
diff changeset
    94
    RESOURCE:: $1
31ef8a13d4f4 sbs version 2.15.1
Jon Chatten
parents: 625
diff changeset
    95
    
31ef8a13d4f4 sbs version 2.15.1
Jon Chatten
parents: 625
diff changeset
    96
    $1: $(SOURCE)
31ef8a13d4f4 sbs version 2.15.1
Jon Chatten
parents: 625
diff changeset
    97
	$(call startrule,resourcecompile,FORCESUCCESS) \
31ef8a13d4f4 sbs version 2.15.1
Jon Chatten
parents: 625
diff changeset
    98
	$(GNUCPP)  -DLANGUAGE_$2 -DLANGUAGE_$(subst sc,SC,$(2)) $(call makemacrodef,-D,$(MMPDEFS))\
31ef8a13d4f4 sbs version 2.15.1
Jon Chatten
parents: 625
diff changeset
    99
	$(CPPOPT) $(SOURCE) -o $1.rpp && \
31ef8a13d4f4 sbs version 2.15.1
Jon Chatten
parents: 625
diff changeset
   100
	$(RCOMP) -m045,046,047 -u $(DOHEADER) -o$$@ -s$1.rpp \
31ef8a13d4f4 sbs version 2.15.1
Jon Chatten
parents: 625
diff changeset
   101
	$(call endrule,resourcecompile)
625
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
   102
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
   103
    SOURCETARGET_$(call sanitise,$(SOURCE)): $1
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
   104
    CLEANTARGETS:=$$(CLEANTARGETS) $1 $1.rpp 
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
   105
endef # resource.build
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
###############################################################################
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
   108
# $1 is the name of the intermediate RESOURCEFILE
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
   109
# $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
   110
define resource.makecopies
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
   111
  
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
   112
  $(call copyresource,$1,$(sort $(addsuffix /$2,$(RSCCOPYDIRS))))
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
   113
endef
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
   114
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
###############################################################################
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
   117
# $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
   118
# $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
   119
define resource.headeronly
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
   120
  ifeq "$(MAKEFILE_GROUP)" "RESOURCE_DEPS"
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
   121
    # generate the resource header dependency files
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
   122
    $(eval DEPENDFILENAME:=$1_$2.rsg.d)
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
   123
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
   124
    RESOURCE_DEPS:: $(DEPENDFILENAME)
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
    # could  force deps to be generated always - debatable.
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
   127
    # .PHONY: $(DEPENDFILENAME)
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
   128
   
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
   129
    $(DEPENDFILENAME): $(SOURCE)
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
   130
	$(call startrule,resource.headeronly.deps,FORCESUCCESS) \
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
   131
	$(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
   132
	$(CPPOPT) $(SOURCE) -M -MG -MT"$(RESOURCEHEADER)" | \
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
   133
	$$(DEPENDENCY_CORRECTOR) > $$@ \
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
   134
	$(call endrule,resource.headeronly.deps)
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
   135
   
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
   136
    SOURCETARGET_$(call sanitise,$(SOURCE)): $(DEPENDFILENAME)
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
   137
   
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
   138
    CLEANTARGETS:=$$(CLEANTARGETS) $(DEPENDFILENAME)
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
   139
  else # generate the resource header
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
   140
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
   141
    RESOURCE:: $(RESOURCEHEADER)
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
   142
    
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
   143
    $(RESOURCEHEADER): $(SOURCE)
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
   144
	$(call startrule,resource.headeronly,FORCESUCCESS) \
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
   145
	$(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
   146
	$(CPPOPT) $(SOURCE) -o $1_$2.rsg.rpp && \
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
   147
	$(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
   148
	$(call endrule,resource.headeronly)
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
   149
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
   150
    CLEANTARGETS:=$$(CLEANTARGETS) $1_$2.rsg.rpp
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
   151
    # we will add the resourceheader to RELEASABLES globally
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
   152
    # individual source file compilation
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
   153
    
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
   154
    SOURCETARGET_$(call sanitise,$(SOURCE)): $(RESOURCEHEADER)
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
    $(eval DEPENDFILE:=$(wildcard $(DEPENDFILENAME)))
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
    ifneq "$(DEPENDFILE)" ""
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
   159
      ifeq "$(filter %CLEAN,$(call uppercase,$(MAKECMDGOALS)))" ""
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
   160
         -include $(DEPENDFILE)
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
   161
      endif
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
   162
    endif
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
   163
  endif
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
   164
endef # resource.headeronly #
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
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
   167
###############################################################################
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
   168
define copyresource
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
   169
# $(1) is the source
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
   170
# $(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
   171
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
   172
   RELEASABLES:=$$(RELEASABLES) $(2)
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
   173
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
   174
   $(info <finalcopy source='$1'>$2</finalcopy>)
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
   175
 
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff changeset
   176
endef # copyresource #