11 # Contributors: |
11 # Contributors: |
12 # |
12 # |
13 # Description: DRM Crypto Library build configuration |
13 # Description: DRM Crypto Library build configuration |
14 # |
14 # |
15 |
15 |
16 CREATABLEPATH:=$(EXTENSION_ROOT)/../drmengine/drmcrypto/build |
16 ifeq ($(_CRYPTOPREP_FLM_),) |
17 CLEANTARGETS:=$(CREATABLEPATH)/cmlacrypto.cpp $(CREATABLEPATH)/omacrypto.cpp |
17 # first instance of this FLM |
|
18 _CRYPTOPREP_FLM_:= 1 |
|
19 |
|
20 |
|
21 # NB: abspath doesn't like Windows drive letters |
|
22 CRYPTO_SOURCE_DRIVE:=$(firstword $(subst :, ,$(EXTENSION_ROOT))) |
|
23 ifeq ($(CRYPTO_SOURCE_DRIVE),$(EXTENSION_ROOT)) |
|
24 CREATABLEPATH:=$(abspath $(EXTENSION_ROOT)/../drmengine/drmcrypto/build)) |
|
25 else |
|
26 CRYPTO_ABSPATH:=$(abspath $(subst $(CRYPTO_SOURCE_DRIVE):,,$(EXTENSION_ROOT)/../drmengine/drmcrypto/build)) |
|
27 CREATABLEPATH:=$(CRYPTO_SOURCE_DRIVE):$(CRYPTO_ABSPATH) |
|
28 endif |
18 |
29 |
19 crypto_files:=$(wildcard $(EXTENSION_ROOT)/../drmengine/drmcrypto/CMLA/*.cpp) |
30 crypto_files:=$(wildcard $(EXTENSION_ROOT)/../drmengine/drmcrypto/CMLA/*.cpp) |
20 |
31 |
|
32 ifeq ($(crypto_files),) |
|
33 CMLA_CRYPTO_SOURCE:=$(CREATABLEPATH)/../stub/CmlaCryptoStub.cpp |
|
34 else |
|
35 CMLA_CRYPTO_SOURCE:=$(CREATABLEPATH)/../CMLA/CmlaCrypto.cpp |
|
36 endif |
21 |
37 |
22 GUARD:=done_$(call sanitise,$(CLEANTARGETS)) |
38 $(CREATABLEPATH)/cmlacrypto.cpp: $(CMLA_CRYPTO_SOURCE) |
23 ifeq ($($(GUARD)),) |
39 $(GNUCP) $< $@ |
24 $(GUARD):=1 |
|
25 |
|
26 BITMAP :: $(CREATABLEPATH) |
|
27 |
|
28 ifeq ($(crypto_files),) |
|
29 $(GNUCP) $(CREATABLEPATH)/../stub/CmlaCryptoStub.cpp $(CREATABLEPATH)/cmlacrypto.cpp |
|
30 else |
|
31 $(GNUCP) $(CREATABLEPATH)/../CMLA/CmlaCrypto.cpp $(CREATABLEPATH)/cmlacrypto.cpp |
|
32 endif |
|
33 $(GNUCP) $(CREATABLEPATH)/../src/OmaCrypto.cpp $(CREATABLEPATH)/omacrypto.cpp |
|
34 $(GNUCHMOD) u+w $(CREATABLEPATH)/cmlacrypto.cpp |
|
35 $(GNUCHMOD) u+w $(CREATABLEPATH)/omacrypto.cpp |
|
36 |
40 |
37 # Create dirs |
41 # Create dirs |
38 $(call makepath,$(CREATABLEPATH)) |
42 $(call makepath,$(CREATABLEPATH)) |
39 |
43 |
40 ## Clean up |
44 ## Clean up |
41 $(eval $(call GenerateStandardCleanTarget,$(CLEANTARGETS))) |
45 $(eval $(call GenerateStandardCleanTarget,$(CLEANTARGETS))) |
42 |
46 |
43 ## What |
47 $(info <debug>$(PLATFORM) $(CFG), selecting $(CMLA_CRYPTO_SOURCE)</debug>) |
44 $(eval $(call whatmacro,$(CLEANTARGETS))) |
|
45 |
|
46 |
48 |
47 else |
49 else |
48 $(info <debug>$(PLATFORM) $(CFG), up-to-date $(CLEANTARGETS)</debug>) |
50 $(info <debug>$(PLATFORM) $(CFG), already handled $(CMLA_CRYPTO_SOURCE)</debug>) |
|
51 # FLM already included - don't duplicate the targets |
49 |
52 |
50 endif |
53 endif |