omadrm/drmengine/group/CryptoPrep.flm
author hgs
Wed, 20 Oct 2010 14:56:54 +0300
changeset 87 c938d010410d
parent 46 78de010160a8
permissions -rw-r--r--
201041

# Copyright (c) 2009-2010 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: DRM Crypto Library build configuration
#

ifeq ($(_CRYPTOPREP_FLM_),)
# first instance of this FLM
_CRYPTOPREP_FLM_:= 1


# NB: abspath doesn't like Windows drive letters
CRYPTO_SOURCE_DRIVE:=$(firstword $(subst :, ,$(EXTENSION_ROOT)))
ifeq ($(CRYPTO_SOURCE_DRIVE),$(EXTENSION_ROOT))
CRYPTO_ROOT:=$(abspath $(EXTENSION_ROOT)/../drmengine/drmcrypto))
else
CRYPTO_SOURCE_REST:=$(subst $(CRYPTO_SOURCE_DRIVE):, ,$(EXTENSION_ROOT)/../drmengine/drmcrypto)
CRYPTO_ABSPATH:=$(abspath $(CRYPTO_SOURCE_REST))

#Ensure that drive letter appears in absolute path once and only once.
ifeq (,$(findstring $(CRYPTO_SOURCE_DRIVE):,$(CRYPTO_ABSPATH)))
CRYPTO_ROOT:=$(CRYPTO_SOURCE_DRIVE):$(CRYPTO_ABSPATH)
else
CRYPTO_ROOT:=$(CRYPTO_ABSPATH)
endif

endif

CREATABLEPATH:=$(CRYPTO_ROOT)/build

crypto_files:=$(wildcard $(CRYPTO_ROOT)/CMLA/*.cpp)

ifeq ($(crypto_files),)
CMLA_CRYPTO_SOURCE:=$(CRYPTO_ROOT)/stub/CmlaCryptoStub.cpp
else
CMLA_CRYPTO_SOURCE:=$(CRYPTO_ROOT)/CMLA/CmlaCrypto.cpp
endif
CLEANTARGETS:=$(CREATABLEPATH)/cmlacrypto.cpp

define drmcryptoprep

BITMAP:: $(CLEANTARGETS)
	$(call startrule,drmcryptoprep) \
	echo created $(CLEANTARGETS) \
	$(call endrule,drmcryptoprep)


$(CLEANTARGETS): $(CMLA_CRYPTO_SOURCE)
	$(call startrule,drmcryptoprep) \
	$(GNUCP) $$< $$@ && \
	$(GNUCHMOD) u+w $$@ \
	$(call endrule,drmcryptoprep)

endef

# Create dirs
$(call makepath,$(CREATABLEPATH))
$(eval $(call drmcryptoprep))
## Clean up
$(eval $(call GenerateStandardCleanTarget,$(CLEANTARGETS)))

## What
$(eval $(call whatmacro,$(CLEANTARGETS)))

$(info <debug>$(PLATFORM) $(CFG), selecting $(CMLA_CRYPTO_SOURCE)</debug>)

else
$(info <debug>$(PLATFORM) $(CFG), already handled $(CMLA_CRYPTO_SOURCE)</debug>)
# FLM already included - don't duplicate the targets

endif