diff options
Diffstat (limited to 'firmware/Makefile')
-rw-r--r-- | firmware/Makefile | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/firmware/Makefile b/firmware/Makefile index 185c8dc0bcb2..95fb42c2285a 100644 --- a/firmware/Makefile +++ b/firmware/Makefile | |||
@@ -180,15 +180,27 @@ $(patsubst %,$(obj)/%.gen.o, $(fw-external-y)): $(obj)/%.gen.o: $(fwdir)/% | |||
180 | $(obj)/%: $(obj)/%.ihex | $(objtree)/$(obj)/$$(dir %) | 180 | $(obj)/%: $(obj)/%.ihex | $(objtree)/$(obj)/$$(dir %) |
181 | $(call cmd,ihex) | 181 | $(call cmd,ihex) |
182 | 182 | ||
183 | # Don't depend on ihex2fw if we're installing and it already exists. | ||
184 | # Putting it after | in the dependencies doesn't seem sufficient when | ||
185 | # we're installing after a cross-compile, because ihex2fw has dependencies | ||
186 | # on stuff like /usr/lib/gcc/ppc64-redhat-linux/4.3.0/include/stddef.h and | ||
187 | # thus wants to be rebuilt. Which it can't be, if the prebuilt kernel tree | ||
188 | # is exported read-only for someone to run 'make install'. | ||
189 | ifeq ($(INSTALL):$(wildcard $(obj)/ihex2fw),install:$(obj)/ihex2fw) | ||
190 | ihex2fw_dep := | ||
191 | else | ||
192 | ihex2fw_dep := $(obj)/ihex2fw | ||
193 | endif | ||
194 | |||
183 | # .HEX is also Intel HEX, but where the offset and length in each record | 195 | # .HEX is also Intel HEX, but where the offset and length in each record |
184 | # is actually meaningful, because the firmware has to be loaded in a certain | 196 | # is actually meaningful, because the firmware has to be loaded in a certain |
185 | # order rather than as a single binary blob. Thus, we convert them into our | 197 | # order rather than as a single binary blob. Thus, we convert them into our |
186 | # more compact binary representation of ihex records (<linux/ihex.h>) | 198 | # more compact binary representation of ihex records (<linux/ihex.h>) |
187 | $(obj)/%.fw: $(obj)/%.HEX $(obj)/ihex2fw | $(objtree)/$(obj)/$$(dir %) | 199 | $(obj)/%.fw: $(obj)/%.HEX $(ihex2fw_dep) | $(objtree)/$(obj)/$$(dir %) |
188 | $(call cmd,ihex2fw) | 200 | $(call cmd,ihex2fw) |
189 | 201 | ||
190 | # .H16 is our own modified form of Intel HEX, with 16-bit length for records. | 202 | # .H16 is our own modified form of Intel HEX, with 16-bit length for records. |
191 | $(obj)/%.fw: $(obj)/%.H16 $(obj)/ihex2fw | $(objtree)/$(obj)/$$(dir %) | 203 | $(obj)/%.fw: $(obj)/%.H16 $(ihex2fw_dep) | $(objtree)/$(obj)/$$(dir %) |
192 | $(call cmd,h16tofw) | 204 | $(call cmd,h16tofw) |
193 | 205 | ||
194 | $(firmware-dirs): | 206 | $(firmware-dirs): |