Generate a binary lzma-loader
authorFlorian Fainelli <florian@openwrt.org>
Wed, 26 Mar 2008 13:33:22 +0000 (13:33 +0000)
committerFlorian Fainelli <florian@openwrt.org>
Wed, 26 Mar 2008 13:33:22 +0000 (13:33 +0000)
SVN-Revision: 10661

target/linux/generic-2.6/image/lzma-loader/Makefile
target/linux/generic-2.6/image/lzma-loader/src/Makefile

index e3a98afbce0dd70f055c8aa56683aaa51ee49d3e..171c3c39380c0910d9dbab81a1f0f79bf87bb4c8 100644 (file)
@@ -33,11 +33,15 @@ $(PKG_BUILD_DIR)/vmlinux.lzma: $(KDIR)/vmlinux.lzma
 $(KDIR)/loader$(LOADER_TYPE).elf: $(PKG_BUILD_DIR)/lzma.elf
        $(CP) $< $@
 
+$(KDIR)/loader$(LOADER_TYPE).bin: $(PKG_BUILD_DIR)/lzma.bin
+       $(CP) $< $@
+
 download: 
 prepare: $(PKG_BUILD_DIR)/.prepared
-compile: $(KDIR)/loader$(LOADER_TYPE).elf
+compile: $(KDIR)/loader$(LOADER_TYPE).elf $(KDIR)/loader$(LOADER_TYPE).bin
 install:
 
 clean:
        rm -rf $(PKG_BUILD_DIR)
        rm -f $(KDIR)/loader.elf
+       rm -f $(KDIR)/loader.bin
index 13ed96213e6ba557166766ee91c5eee9b94a7b05..910172c4f8963ba9d362f05620d3aaf5aa5b5d80 100644 (file)
@@ -36,7 +36,7 @@ O_FORMAT = $(shell $(OBJDUMP) -i | head -2 | grep elf32)
 drop-sections   = .reginfo .mdebug .comment
 strip-flags     = $(addprefix --remove-section=,$(drop-sections))
 
-all : lzma.elf
+all : lzma.elf lzma.bin
 
 lzma.lds: lzma.lds.in
        sed -e 's,@LOADADDR@,$(LOADADDR),g' -e 's,@ENTRY@,_start,g' $< >$@
@@ -44,6 +44,9 @@ lzma.lds: lzma.lds.in
 kernel.o: vmlinux.lzma lzma.lds
        $(LD) -r -b binary --oformat $(O_FORMAT) -o $@ $<
 
+lzma.bin: lzma.elf
+       $(OBJCOPY) $< $@
+
 ifeq ($(IMAGE_COPY),1)
 LOADER_ENTRY ?= $(KERNEL_ENTRY)
 lzma.o: decompress.o LzmaDecode.o kernel.o
@@ -62,4 +65,4 @@ lzma.elf: start.o decompress.o LzmaDecode.o kernel.o
 endif
 
 clean:
-       rm -f *.o lzma.elf *.tmp *.lds
+       rm -f *.o lzma.elf lzma.bin *.tmp *.lds