sbsv2/raptor/lib/flm/stringtable.flm
author timothy.murphy@nokia.com
Fri, 20 Nov 2009 20:10:58 +0000
branchwip
changeset 9 b211d87c390a
parent 5 593a8820b912
permissions -rw-r--r--
Update to 2.11.0 from perforce

# Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
# All rights reserved.
# This component and the accompanying materials are made available
# under the terms of the License "Eclipse Public License v1.0"
# which accompanies this distribution, and is available
# at the URL "http://www.eclipse.org/legal/epl-v10.html".
#
# Initial Contributors:
# Nokia Corporation - initial contribution.
#
# Contributors:
#
# Description:
# Header file exporting Function Like Makefile (FLM)
# The file destinations  relative to EPOCROOT
# 
#

## Parameters that are expected:
# SOURCE
# HEADERONLY
# OUTPUTPATH
# EPOCROOT
# EXPORTPATH

## GLOBAL TARGETS ###############################################
.PHONY:: $(ALLTARGET)
$(ALLTARGET):: $(RELEASEABLES)


# StringTable FLM


EXPORT::

CLEANTARGETS:=
RELEASEEXPORTS:=
CREATABLEPATHS:=$(OUTPUTPATH) $(EXPORTPATH)

# Work out the names of the various output files before
# trying to use them in rules and dependencies. Cuts repetition
# and avoids mistakes.
EXPORTEDSTRINGTABLEHEADER:=$(EXPORTPATH)/$(TARGET).h
STRINGTABLECPP:=$(OUTPUTPATH)/$(TARGET).cpp
STRINGTABLEHEADER:=$(OUTPUTPATH)/$(TARGET).h
STRINGTABLEPHONYTARGET:=$(OUTPUTPATH)_$(TARGET)
TEMPSOURCE:=$(OUTPUTPATH)/$(TARGET).st

# Macro to generate string table targets and rules
# Always return true if the make engine doesn't support 
# the .IGNORE:: target.
define exportstringtableheader

EXPORT:: $(EXPORTEDSTRINGTABLEHEADER)

$(EXPORTEDSTRINGTABLEHEADER): $(STRINGTABLEHEADER) 
	$(call startrule,exportstringtableheader,FORCESUCCESS) \
	$(GNUCP) '$(STRINGTABLEHEADER)' '$$@'  \
	$(call endrule,exportstringtableheader) 

RELEASEEXPORTS:=$(EXPORTEDSTRINGTABLEHEADER)
endef

define genstringtable
$(STRINGTABLECPP) : $(STRINGTABLEHEADER)

$(STRINGTABLEHEADER): $(SOURCE) 
	$(call startrule,stringtable,FORCESUCCESS) \
	$(GNUCP) --no-preserve=mode $(SOURCE) $(TEMPSOURCE)  && $(GNUCHMOD) a+w $(TEMPSOURCE) &&  \
	$(STRINGTABLE) $(TEMPSOURCE)  \
	$(call endrule,stringtable)

CLEANTARGETS:=$(STRINGTABLEHEADER) $(STRINGTABLECPP)

endef


$(if $(EXPORTPATH),$(eval $(exportstringtableheader)),)
$(if $(EXPORTPATH),,$(eval EXPORT:: $(STRINGTABLEHEADER)))
$(eval $(genstringtable))


## Clean up and log releasables
$(call raptor_clean,$(CLEANTARGETS))
# make the output directories while reading makefile - some build engines prefer this
$(call makepath,$(CREATABLEPATHS))
$(call raptor_release,$(RELEASEEXPORTS),STRINGTABLE)