17 |
17 |
18 ########################################################################################## |
18 ########################################################################################## |
19 # Get list of files |
19 # Get list of files |
20 # |
20 # |
21 |
21 |
22 # First get SVG files from SOURCEDIR, then .bmp files from SOURCEDIR, then .svg from VECTORSOURCEDIR and finally .bmp from BITMAPSOURCEDIR |
22 # First get SVG files from SOURCEDIR, then .bmp files from SOURCEDIR, then .svg from VECTORSOURCEDIR, |
|
23 # then .bmp from BITMAPSOURCEDIR and finally .svg from all VECTORSOURCESUBDIR's |
23 SOURCEPATHS:=$(foreach FILE, \ |
24 SOURCEPATHS:=$(foreach FILE, \ |
24 $(basename $(FILES)), \ |
25 $(basename $(FILES)), \ |
25 $(firstword $(wildcard $(SOURCEDIR)$/$(FILE).svg $(SOURCEDIR)$/$(FILE).bmp $(VECTORSOURCEDIR)$/$(FILE).svg) $(BITMAPSOURCEDIR)$/$(FILE).bmp)) |
26 $(firstword \ |
26 |
27 $(wildcard $(SOURCEDIR)$/$(FILE).svg $(SOURCEDIR)$/$(FILE).bmp $(VECTORSOURCEDIR)$/$(FILE).svg) \ |
27 # Get a full list of SVG files |
28 $(wildcard $(VECTORSOURCESUBDIR_NSS)$/$(FILE).svg $(VECTORSOURCESUBDIR_NOKIA)$/$(FILE).svg $(VECTORSOURCESUBDIR_OEM)$/$(FILE).svg) \ |
|
29 $(BITMAPSOURCEDIR)$/$(FILE).bmp) \ |
|
30 ) |
|
31 |
|
32 # Get a list of SVG files including VECTORSOURCESUBDIRs |
28 SVGFILES:=$(filter %.svg,$(SOURCEPATHS)) |
33 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 |
34 |
33 # BMP files are all the other files |
35 # BMP files are all the other files |
34 BMPFILES:=$(filter-out $(SVGFILES),$(SOURCEPATHS)) |
36 BMPFILES:=$(filter-out $(SVGFILES),$(SOURCEPATHS)) |
|
37 |
|
38 # Filter VECTORSOURCESUBDIRs content out from SVGFILES |
|
39 SVGFILES:=$(filter-out $(VECTORSOURCESUBDIR_NSS)%,$(SVGFILES)) |
|
40 SVGFILES:=$(filter-out $(VECTORSOURCESUBDIR_NOKIA)%,$(SVGFILES)) |
|
41 SVGFILES:=$(filter-out $(VECTORSOURCESUBDIR_OEM)%,$(SVGFILES)) |
|
42 |
|
43 # Get SVG files from VECTORSOURCESUBDIRs |
|
44 SVGFILES_NSS:=$(foreach FILE, \ |
|
45 $(basename $(FILES)), \ |
|
46 $(wildcard $(VECTORSOURCESUBDIR_NSS)$/$(FILE).svg)) |
|
47 |
|
48 SVGFILES_NOKIA:=$(foreach FILE, \ |
|
49 $(basename $(FILES)), \ |
|
50 $(wildcard $(VECTORSOURCESUBDIR_NOKIA)$/$(FILE).svg)) |
|
51 |
|
52 SVGFILES_OEM:=$(foreach FILE, \ |
|
53 $(basename $(FILES)), \ |
|
54 $(wildcard $(VECTORSOURCESUBDIR_OEM)$/$(FILE).svg)) |
|
55 |
|
56 # Paths of SVGB files will be under the intermediate directory |
|
57 SVGBFILES:=$(addprefix $(VECTORINTERMEDIATEDIR)$/,$(notdir $(addsuffix b,$(SVGFILES)))) \ |
|
58 $(addprefix $(VECTORINTERMEDIATEDIR)$/,$(notdir $(addsuffix b,$(SVGFILES_NSS)))) \ |
|
59 $(addprefix $(VECTORINTERMEDIATEDIR)$/,$(notdir $(addsuffix b,$(SVGFILES_NOKIA)))) \ |
|
60 $(addprefix $(VECTORINTERMEDIATEDIR)$/,$(notdir $(addsuffix b,$(SVGFILES_OEM)))) |
35 |
61 |
36 # Resolve mask files. Mask files are assumed to locate in the same folder than the actual bmp-file. |
62 # Resolve mask files. Mask files are assumed to locate in the same folder than the actual bmp-file. |
37 MASKFILES:=$(foreach FILE, \ |
63 MASKFILES:=$(foreach FILE, \ |
38 $(BMPFILES), \ |
64 $(BMPFILES), \ |
39 $(FILE) $(foreach MASK, \ |
65 $(FILE) $(foreach MASK, \ |
49 # |
75 # |
50 |
76 |
51 # If SOURCEDIR is defined, we need to create a rule for copying the vector files into the intermediate directory |
77 # If SOURCEDIR is defined, we need to create a rule for copying the vector files into the intermediate directory |
52 ifneq ($(strip $(SOURCEDIR)),) |
78 ifneq ($(strip $(SOURCEDIR)),) |
53 |
79 |
54 # Create list of files |
80 # Create list of files |
55 USERSVGFILES:=$(filter $(SOURCEDIR)%,$(SVGFILES)) |
81 USERSVGFILES:=$(filter $(SOURCEDIR)%,$(SVGFILES)) |
56 USERBMPFILES:=$(filter $(SOURCEDIR)%,$(BMPFILES)) |
82 USERBMPFILES:=$(filter $(SOURCEDIR)%,$(BMPFILES)) |
57 USERINTERMEDIATESVGFILES := $(subst $(SOURCEDIR), \ |
83 USERINTERMEDIATESVGFILES := $(subst $(SOURCEDIR), \ |
58 $(VECTORINTERMEDIATEDIR), \ |
84 $(VECTORINTERMEDIATEDIR), \ |
59 $(USERSVGFILES) \ |
85 $(USERSVGFILES) \ |
60 ) |
86 ) |
61 |
87 |
62 # Now define the copy rule |
88 # Now define the copy rule |
63 ifeq ($(INIT_CFG),$(PLATFORM)$(CFG)) |
89 ifeq ($(INIT_CFG),$(PLATFORM)$(CFG)) |
64 $(USERINTERMEDIATESVGFILES) : $(VECTORINTERMEDIATEDIR)% : $(SOURCEDIR)% |
90 $(USERINTERMEDIATESVGFILES) : $(VECTORINTERMEDIATEDIR)% : $(SOURCEDIR)% |
70 endif |
96 endif |
71 |
97 |
72 |
98 |
73 # The same copy rule is needed for system files as well, first generate the lists |
99 # The same copy rule is needed for system files as well, first generate the lists |
74 SYSTEMSVGFILES:=$(filter $(VECTORSOURCEDIR)%,$(SVGFILES)) |
100 SYSTEMSVGFILES:=$(filter $(VECTORSOURCEDIR)%,$(SVGFILES)) |
|
101 SYSTEMINTERMEDIATESVGFILES := $(subst $(VECTORSOURCEDIR), \ |
|
102 $(VECTORINTERMEDIATEDIR), \ |
|
103 $(SYSTEMSVGFILES) \ |
|
104 ) |
|
105 SYSTEMINTERMEDIATESVGFILES_NSS:=$(subst $(VECTORSOURCESUBDIR_NSS), \ |
|
106 $(VECTORINTERMEDIATEDIR), \ |
|
107 $(SVGFILES_NSS) \ |
|
108 ) |
|
109 SYSTEMINTERMEDIATESVGFILES_NOKIA:=$(subst $(VECTORSOURCESUBDIR_NOKIA), \ |
|
110 $(VECTORINTERMEDIATEDIR), \ |
|
111 $(SVGFILES_NOKIA) \ |
|
112 ) |
|
113 SYSTEMINTERMEDIATESVGFILES_OEM:=$(subst $(VECTORSOURCESUBDIR_OEM), \ |
|
114 $(VECTORINTERMEDIATEDIR), \ |
|
115 $(SVGFILES_OEM) \ |
|
116 ) |
75 SYSTEMBMPFILES:=$(filter $(BITMAPSOURCEDIR)%,$(BMPFILES)) |
117 SYSTEMBMPFILES:=$(filter $(BITMAPSOURCEDIR)%,$(BMPFILES)) |
76 SYSTEMINTERMEDIATESVGFILES := $(subst $(VECTORSOURCEDIR), \ |
118 |
77 $(VECTORINTERMEDIATEDIR), \ |
119 # Copy SVG files in reverse order of priority to enabele overriding SVG files with lesser priority |
78 $(SYSTEMSVGFILES) \ |
120 |
79 ) |
121 # Define the copy rules for VECTORSOURCESUBDIRs |
80 |
122 ifeq ($(INIT_CFG),$(PLATFORM)$(CFG)) |
81 # And finally define the copy rule |
123 $(SYSTEMINTERMEDIATESVGFILES_OEM) : $(VECTORINTERMEDIATEDIR)% : $(VECTORSOURCESUBDIR_OEM)% |
|
124 $(TOOLCOPY) $< $@ |
|
125 ifeq ($(OSTYPE),cygwin) |
|
126 $(GNUCHMOD) a+rw "$@" |
|
127 endif |
|
128 endif |
|
129 |
|
130 ifeq ($(INIT_CFG),$(PLATFORM)$(CFG)) |
|
131 $(SYSTEMINTERMEDIATESVGFILES_NOKIA) : $(VECTORINTERMEDIATEDIR)% : $(VECTORSOURCESUBDIR_NOKIA)% |
|
132 $(TOOLCOPY) $< $@ |
|
133 ifeq ($(OSTYPE),cygwin) |
|
134 $(GNUCHMOD) a+rw "$@" |
|
135 endif |
|
136 endif |
|
137 |
|
138 ifeq ($(INIT_CFG),$(PLATFORM)$(CFG)) |
|
139 $(SYSTEMINTERMEDIATESVGFILES_NSS) : $(VECTORINTERMEDIATEDIR)% : $(VECTORSOURCESUBDIR_NSS)% |
|
140 $(TOOLCOPY) $< $@ |
|
141 ifeq ($(OSTYPE),cygwin) |
|
142 $(GNUCHMOD) a+rw "$@" |
|
143 endif |
|
144 endif |
|
145 |
|
146 # Define the copy rule for VECTORSOURCEDIR |
82 ifeq ($(INIT_CFG),$(PLATFORM)$(CFG)) |
147 ifeq ($(INIT_CFG),$(PLATFORM)$(CFG)) |
83 $(SYSTEMINTERMEDIATESVGFILES) : $(VECTORINTERMEDIATEDIR)% : $(VECTORSOURCEDIR)% |
148 $(SYSTEMINTERMEDIATESVGFILES) : $(VECTORINTERMEDIATEDIR)% : $(VECTORSOURCEDIR)% |
84 $(TOOLCOPY) $< $@ |
149 $(TOOLCOPY) $< $@ |
85 ifeq ($(OSTYPE),cygwin) |
150 ifeq ($(OSTYPE),cygwin) |
86 $(GNUCHMOD) a+rw "$@" |
151 $(GNUCHMOD) a+rw "$@" |
87 endif |
152 endif |
88 endif |
153 endif |
89 |
154 |
|
155 |
90 # Get full list of intermediate files |
156 # Get full list of intermediate files |
91 VECTORINTERMEDIATESOURCES := $(SYSTEMINTERMEDIATESVGFILES) $(USERINTERMEDIATESVGFILES) |
157 VECTORINTERMEDIATESOURCES := $(SYSTEMINTERMEDIATESVGFILES) $(SYSTEMINTERMEDIATESVGFILES_NSS) $(SYSTEMINTERMEDIATESVGFILES_NOKIA) $(SYSTEMINTERMEDIATESVGFILES_OEM) $(USERINTERMEDIATESVGFILES) |
92 |
158 |
93 |
159 |
94 |
160 |
95 # Debug prints for debugging purposes |
161 # Debug prints for debugging purposes |
96 #$(warning SOURCEPATHS $(SOURCEPATHS)) |
162 #$(warning SOURCEPATHS $(SOURCEPATHS)) |
97 #$(warning SVGFILES $(SVGFILES)) |
163 #$(warning SVGFILES $(SVGFILES)) |
|
164 #$(warning SVGFILES_NSS $(SVGFILES_NSS)) |
|
165 #$(warning SVGFILES_NOKIA $(SVGFILES_NOKIA)) |
|
166 #$(warning SVGFILES_OEM $(SVGFILES_OEM)) |
98 #$(warning SVGBFILES $(SVGBFILES)) |
167 #$(warning SVGBFILES $(SVGBFILES)) |
99 #$(warning BMPFILES $(BMPFILES)) |
168 #$(warning BMPFILES $(BMPFILES)) |
100 #$(warning USERSVGFILES $(USERSVGFILES)) |
169 #$(warning USERSVGFILES $(USERSVGFILES)) |
101 #$(warning USERBMPFILES $(USERBMPFILES)) |
170 #$(warning USERBMPFILES $(USERBMPFILES)) |
102 #$(warning USERINTERMEDIATESVGFILES $(USERINTERMEDIATESVGFILES)) |
171 #$(warning USERINTERMEDIATESVGFILES $(USERINTERMEDIATESVGFILES)) |
103 #$(warning SYSTEMSVGFILES $(SYSTEMSVGFILES)) |
172 #$(warning SYSTEMSVGFILES $(SYSTEMSVGFILES)) |
104 #$(warning SYSTEMBMPFILES $(SYSTEMBMPFILES)) |
173 #$(warning SYSTEMBMPFILES $(SYSTEMBMPFILES)) |
105 #$(warning SYSTEMINTERMEDIATESVGFILES $(SYSTEMINTERMEDIATESVGFILES)) |
174 #$(warning SYSTEMINTERMEDIATESVGFILES $(SYSTEMINTERMEDIATESVGFILES)) |
|
175 #$(warning SYSTEMINTERMEDIATESVGFILES_NSS $(SYSTEMINTERMEDIATESVGFILES_NSS)) |
|
176 #$(warning SYSTEMINTERMEDIATESVGFILES_NOKIA $(SYSTEMINTERMEDIATESVGFILES_NOKIA)) |
|
177 #$(warning SYSTEMINTERMEDIATESVGFILES_OEM $(SYSTEMINTERMEDIATESVGFILES_OEM)) |
106 #$(warning VECTORINTERMEDIATESOURCES $(VECTORINTERMEDIATESOURCES)) |
178 #$(warning VECTORINTERMEDIATESOURCES $(VECTORINTERMEDIATESOURCES)) |
107 |
179 |
108 |
180 |
109 |
181 |
110 ########################################################################################## |
182 ########################################################################################## |