author | Richard Taylor <richard.i.taylor@nokia.com> |
Thu, 25 Feb 2010 16:02:22 +0000 | |
branch | fix |
changeset 370 | c86748d54051 |
parent 260 | 6956be913ed6 |
permissions | -rw-r--r-- |
260
6956be913ed6
apply review #3865 comments
Richard Taylor <richard.i.taylor@nokia.com>
parents:
257
diff
changeset
|
1 |
# Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies). |
3 | 2 |
# All rights reserved. |
3 |
# This component and the accompanying materials are made available |
|
4 |
# under the terms of the License "Eclipse Public License v1.0" |
|
5 |
# which accompanies this distribution, and is available |
|
6 |
# at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 |
# |
|
8 |
# Initial Contributors: |
|
9 |
# Nokia Corporation - initial contribution. |
|
10 |
# |
|
11 |
# Contributors: |
|
12 |
# |
|
13 |
# Description: |
|
14 |
# Header file exporting Function Like Makefile (FLM) |
|
15 |
# The file destinations relative to EPOCROOT |
|
16 |
# |
|
17 |
# |
|
18 |
||
19 |
## Parameters that are expected: |
|
20 |
# BMCONV |
|
21 |
# EPOCROOT |
|
22 |
# HEADER |
|
23 |
# OUTPUTPATH |
|
24 |
# SOURCE |
|
25 |
# BMTARGET |
|
26 |
# TARGETPATH |
|
27 |
# BINCOPYDIRS |
|
28 |
||
29 |
ifneq ($(TARGETPATH),) |
|
30 |
DATAPATH:=$(subst //,/,$(EPOCROOT)/epoc32/data/z/$(TARGETPATH)) |
|
31 |
else |
|
32 |
DATAPATH:=$(subst //,/,$(EPOCROOT)/epoc32/data) |
|
33 |
endif |
|
34 |
CREATABLEPATHS:=$(DATAPATH) $(OUTPUTPATH) |
|
35 |
||
36 |
BITMAPFILE:=$(subst //,/,$(DATAPATH)/$(BMTARGET)) |
|
37 |
||
38 |
# additional binary resource copies performed based on BINCOPYDIRS |
|
39 |
MBMCOPYDIRS:= |
|
40 |
MBMCOPYFILES:= |
|
41 |
ifneq ($(BINCOPYDIRS),) |
|
42 |
MBMCOPYDIRS:=$(subst //,/,$(patsubst %,%/$(if $(TARGETPATH),/z/$(TARGETPATH),),$(BINCOPYDIRS))) |
|
43 |
CREATABLEPATHS:=$(CREATABLEPATHS) $(MBMCOPYDIRS) |
|
44 |
MBMCOPYFILES:=$(subst //,/,$(patsubst %, %/$(notdir $(BITMAPFILE)),$(MBMCOPYDIRS))) |
|
45 |
endif |
|
46 |
||
47 |
||
48 |
ifneq ($(HEADER),) |
|
49 |
BITMAPHEADER:=$(subst //,/,$(EPOCROOT)/epoc32/include/$(basename $(BMTARGET)).mbg) |
|
50 |
else |
|
51 |
BITMAPHEADER:= |
|
52 |
endif |
|
53 |
||
54 |
||
55 |
# SOURCE is something like "DEPTH=2 FILE=/var/local/fred.bmp" |
|
56 |
# Extract the file parts for the dependencies. |
|
57 |
# Generate -2/var/local/fred.bmp for the command-line argument. |
|
58 |
SOURCEDEPS:=$(subst //,/,$(subst FILE=,,$(filter FILE=%,$(SOURCE)))) |
|
59 |
SOURCEARGS:=$(subst //,/,$(subst DEPTH=,-,$(subst $(CHAR_SPACE)FILE=,,$(SOURCE)))) |
|
60 |
||
61 |
BMCONVCMDFILE:=$(OUTPUTPATH)/$(BMTARGET)_bmconvcommands |
|
62 |
RELEASEABLES:=$(BITMAPHEADER) $(BITMAPFILE) |
|
5 | 63 |
CLEANTARGETS:=$(BMCONVCMDFILE) |
3 | 64 |
|
65 |
# The groupbmpin10 macro allows us to construct a command file, 10 |
|
66 |
# bitmap objects at a time to avoid limits on argument lengths and |
|
67 |
# sizes on Windows. |
|
68 |
define groupbmpin10 |
|
69 |
$(if $1,$(shell echo -e $(foreach L,$(wordlist 1,10,$1),"$(L)\\n") >>$(BMCONVCMDFILE)),) |
|
70 |
$(if $1,$(call groupbmpin10,$(wordlist 11,$(words $1),$1))) |
|
71 |
endef |
|
72 |
||
73 |
GUARD:=$(call sanitise,TARGET_$(BITMAPFILE)) |
|
74 |
define generatebitmap |
|
75 |
$(GUARD):=1 |
|
76 |
||
77 |
BITMAP:: $(RELEASEABLES) |
|
78 |
||
79 |
ifneq ($(BITMAPHEADER),) |
|
80 |
$(BITMAPHEADER): $(BITMAPFILE) |
|
81 |
endif |
|
82 |
||
83 |
# Create commandfile during parse so that the log is not littered with |
|
84 |
# these commands in parallel builds. |
|
85 |
$(info <bmconvcmdfile>) |
|
86 |
$(info $(BMCONVCMDFILE)) |
|
87 |
$(shell $(GNUMKDIR) -p "$(dir $(BMCONVCMDFILE))") |
|
88 |
$(if $(BITMAPHEADER),$(shell echo -e "-h$(BITMAPHEADER)\n$(BITMAPFILE)" >$(BMCONVCMDFILE)),$(shell echo "$(BITMAPFILE)" >$(BMCONVCMDFILE)) ) |
|
89 |
$(call groupbmpin10, $(SOURCEARGS)) |
|
90 |
$(info </bmconvcmdfile>) |
|
91 |
||
92 |
$(BITMAPFILE): $(SOURCEDEPS) $(BMCONV) |
|
93 |
$(call startrule,bitmapcompile,FORCESUCCESS) \ |
|
94 |
$(BMCONV) $(BMCONVCMDFILE) \ |
|
95 |
$(call endrule,bitmapcompile) |
|
96 |
||
97 |
endef |
|
98 |
||
99 |
||
100 |
# Some builds require further copies of the generated mbm binaries |
|
101 |
define copybitmap |
|
102 |
||
103 |
BITMAP:: $(MBMCOPYFILES) |
|
104 |
||
105 |
$(MBMCOPYFILES): $(BITMAPFILE) |
|
106 |
$(call startrule,bitmapcopy,FORCESUCCESS) \ |
|
107 |
$(GNUCP) $$< $$@ \ |
|
108 |
$(call endrule,bitmapcopy) |
|
109 |
||
110 |
endef |
|
111 |
||
112 |
||
113 |
ifeq ($($(GUARD)),) |
|
114 |
$(eval $(call generatebitmap)) |
|
115 |
endif |
|
116 |
||
117 |
ifneq ($(MBMCOPYFILES),) |
|
118 |
$(eval $(call copybitmap)) |
|
119 |
endif |
|
120 |
||
121 |
||
122 |
## Clean up |
|
5 | 123 |
$(call raptor_clean,$(CLEANTARGETS)) |
3 | 124 |
$(call makepath,$(CREATABLEPATHS)) |
125 |
$(call makepathfor,$(BITMAPHEADER)) |
|
126 |
||
127 |
# for the abld -what target |
|
257
634a95a81cec
remove redundant bmp file copying
Richard Taylor <richard.i.taylor@nokia.com>
parents:
5
diff
changeset
|
128 |
BMPRELEASEABLES:=$(RELEASEABLES) $(MBMCOPYFILES) |
5 | 129 |
$(call raptor_release,$(BMPRELEASEABLES),BITMAP) |
3 | 130 |