|
1 # |
|
2 # Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 # All rights reserved. |
|
4 # This component and the accompanying materials are made available |
|
5 # under the terms of "Eclipse Public License v1.0" |
|
6 # which accompanies this distribution, and is available |
|
7 # at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 # |
|
9 # Initial Contributors: |
|
10 # Nokia Corporation - initial contribution. |
|
11 # |
|
12 # Contributors: |
|
13 # |
|
14 # Description: |
|
15 # |
|
16 # |
|
17 |
|
18 ########################################################################################## |
|
19 # Get list of files |
|
20 # |
|
21 |
|
22 # First get SVG files from SOURCEDIR, then .bmp files from SOURCEDIR, then .svg from VECTORSOURCEDIR and finally .bmp from BITMAPSOURCEDIR |
|
23 SOURCEPATHS:=$(foreach FILE, \ |
|
24 $(basename $(FILES)), \ |
|
25 $(firstword $(wildcard $(SOURCEDIR)$/$(FILE).svg $(SOURCEDIR)$/$(FILE).bmp $(VECTORSOURCEDIR)$/$(FILE).svg) $(BITMAPSOURCEDIR)$/$(FILE).bmp)) |
|
26 |
|
27 # Get a full list of SVG files |
|
28 SVGFILES:=$(filter %.svg,$(SOURCEPATHS)) |
|
29 |
|
30 # Paths of SVGB files will be under the intermediate directory |
|
31 SVGBFILES:=$(addprefix $(VECTORINTERMEDIATEDIR)$/,$(notdir $(addsuffix b,$(SVGFILES)))) |
|
32 |
|
33 # BMP files are all the other files |
|
34 BMPFILES:=$(filter-out $(SVGFILES),$(SOURCEPATHS)) |
|
35 |
|
36 # Resolve mask files. Mask files are assumed to locate in the same folder than the actual bmp-file. |
|
37 MASKFILES:=$(foreach FILE, \ |
|
38 $(BMPFILES), \ |
|
39 $(FILE) $(foreach MASK, \ |
|
40 $(filter $(notdir $(basename $(FILE)))$(MASK_OPTION_1) $(notdir $(basename $(FILE)))$(MASK_OPTION_8),$(MASKFILES)), \ |
|
41 $(dir $(FILE))$(MASK).bmp) ) |
|
42 |
|
43 # Filter out the actual bmp-files: |
|
44 MASKFILES:=$(filter-out $(BMPFILES), $(MASKFILES)) |
|
45 |
|
46 |
|
47 ########################################################################################## |
|
48 # Define copy rules |
|
49 # |
|
50 |
|
51 # If SOURCEDIR is defined, we need to create a rule for copying the vector files into the intermediate directory |
|
52 ifneq ($(strip $(SOURCEDIR)),) |
|
53 |
|
54 # Create list of files |
|
55 USERSVGFILES:=$(filter $(SOURCEDIR)%,$(SVGFILES)) |
|
56 USERBMPFILES:=$(filter $(SOURCEDIR)%,$(BMPFILES)) |
|
57 USERINTERMEDIATESVGFILES := $(subst $(SOURCEDIR), \ |
|
58 $(VECTORINTERMEDIATEDIR), \ |
|
59 $(USERSVGFILES) \ |
|
60 ) |
|
61 |
|
62 # Now define the copy rule |
|
63 ifeq ($(INIT_CFG),$(PLATFORM)$(CFG)) |
|
64 $(USERINTERMEDIATESVGFILES) : $(VECTORINTERMEDIATEDIR)% : $(SOURCEDIR)% |
|
65 $(TOOLCOPY) $< $@ |
|
66 ifeq ($(OSTYPE),cygwin) |
|
67 $(GNUCHMOD) a+rw "$@" |
|
68 endif |
|
69 endif |
|
70 endif |
|
71 |
|
72 |
|
73 # The same copy rule is needed for system files as well, first generate the lists |
|
74 SYSTEMSVGFILES:=$(filter $(VECTORSOURCEDIR)%,$(SVGFILES)) |
|
75 SYSTEMBMPFILES:=$(filter $(BITMAPSOURCEDIR)%,$(BMPFILES)) |
|
76 SYSTEMINTERMEDIATESVGFILES := $(subst $(VECTORSOURCEDIR), \ |
|
77 $(VECTORINTERMEDIATEDIR), \ |
|
78 $(SYSTEMSVGFILES) \ |
|
79 ) |
|
80 |
|
81 # And finally define the copy rule |
|
82 ifeq ($(INIT_CFG),$(PLATFORM)$(CFG)) |
|
83 $(SYSTEMINTERMEDIATESVGFILES) : $(VECTORINTERMEDIATEDIR)% : $(VECTORSOURCEDIR)% |
|
84 $(TOOLCOPY) $< $@ |
|
85 ifeq ($(OSTYPE),cygwin) |
|
86 $(GNUCHMOD) a+rw "$@" |
|
87 endif |
|
88 endif |
|
89 |
|
90 # Get full list of intermediate files |
|
91 VECTORINTERMEDIATESOURCES := $(SYSTEMINTERMEDIATESVGFILES) $(USERINTERMEDIATESVGFILES) |
|
92 |
|
93 |
|
94 |
|
95 # Debug prints for debugging purposes |
|
96 #$(warning SOURCEPATHS $(SOURCEPATHS)) |
|
97 #$(warning SVGFILES $(SVGFILES)) |
|
98 #$(warning SVGBFILES $(SVGBFILES)) |
|
99 #$(warning BMPFILES $(BMPFILES)) |
|
100 #$(warning USERSVGFILES $(USERSVGFILES)) |
|
101 #$(warning USERBMPFILES $(USERBMPFILES)) |
|
102 #$(warning USERINTERMEDIATESVGFILES $(USERINTERMEDIATESVGFILES)) |
|
103 #$(warning SYSTEMSVGFILES $(SYSTEMSVGFILES)) |
|
104 #$(warning SYSTEMBMPFILES $(SYSTEMBMPFILES)) |
|
105 #$(warning SYSTEMINTERMEDIATESVGFILES $(SYSTEMINTERMEDIATESVGFILES)) |
|
106 #$(warning VECTORINTERMEDIATESOURCES $(VECTORINTERMEDIATESOURCES)) |
|
107 |
|
108 |
|
109 |
|
110 ########################################################################################## |
|
111 # Rules for creating directories |
|
112 # |
|
113 # Please note that this implementation assumes that Mifconv core takes care of creating |
|
114 # directories for files which it generates |
|
115 # |
|
116 |
|
117 # Check if the intermediate directory exists - if not, create it |
|
118 ifeq ($(wildcard $(VECTORINTERMEDIATEDIR)$/),) |
|
119 __DUMMY_MKDIR := $(shell $(TOOLMKDIR) $(VECTORINTERMEDIATEDIR)) |
|
120 endif |
|
121 |
|
122 |
|
123 |
|
124 ########################################################################################## |
|
125 # Rule for calling SVGTBINENCODE ie SVG to SVGB conversion |
|
126 # |
|
127 |
|
128 %.svgb : %.svg |
|
129 # If SVGENCODINGVERSION contains anything else but whitespace, provide it to svgtbinencode with -v option |
|
130 $(SVGTBINENCODE) $(addprefix -v ,$(SVGENCODINGVERSION)) $< |
|
131 |
|
132 |
|
133 |
|
134 ########################################################################################## |
|
135 # MBM file name resolution. BMCONV is called by mifconv. |
|
136 # |
|
137 |
|
138 # Check if we have any bitmap sources available |
|
139 ifneq ($(strip $(BMPFILES)),) |
|
140 |
|
141 # The name of the bitmap file is decided from the miffile or header file depending which one is defined |
|
142 BITMAPFILE:=$(addsuffix .mbm,$(basename $(firstword $(TARGETFILE) $(HEADERFILE)))) |
|
143 #$(warning BITMAPFILE $(BITMAPFILE)) |
|
144 |
|
145 # No bitmap sources, so the filename of the MBM file is empty |
|
146 else |
|
147 BITMAPFILE:= |
|
148 endif |
|
149 |
|
150 ########################################################################################## |
|
151 # This may require some explaining |
|
152 # Line 5: Strip paths from SOURCEPATHS (the input files with paths) |
|
153 # Line 3: For all .svg files in previous, change suffix to .svgb |
|
154 # Line 2: From previous, list each item twice, once with VECTORINTERMEDIATEDIR path, and once without any path |
|
155 # Now we should have all the files in correct order in format: |
|
156 # file.bmp VECTORINTERMEDIATEDIR/file.bmp otherfile.svgb VECTORINTERMEDIATEDIR/otherfile.svgb ... |
|
157 # Line 1: Use filter to select only one or either from the list above |
|
158 |
|
159 MIFCONVFILES:=$(filter $(SVGBFILES) $(notdir $(BMPFILES)), \ |
|
160 $(foreach FILE, \ |
|
161 $(patsubst %.svg, \ |
|
162 %.svgb,\ |
|
163 $(notdir $(SOURCEPATHS)) \ |
|
164 ) , \ |
|
165 $(FILE) $(VECTORINTERMEDIATEDIR)$/$(FILE) \ |
|
166 ) \ |
|
167 ) |
|
168 |
|
169 MIFCONVOPTS:=$(foreach FILE,$(MIFCONVFILES),$(OPTION_$(notdir $(basename $(FILE)))) $(FILE)) |
|
170 |