Root/target/linux/adm8668/image/Makefile

1#
2# Copyright (C) 2010 OpenWrt.org
3#
4# This is free software, licensed under the GNU General Public License v2.
5# See /LICENSE for more information.
6#
7include $(TOPDIR)/rules.mk
8include $(INCLUDE_DIR)/image.mk
9
10VMLINUX:=$(BIN_DIR)/$(IMG_PREFIX)-vmlinux
11UIMAGE:=$(IMG_PREFIX)-uImage
12ifeq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),y)
13    VMLINUX:=$(BIN_DIR)/$(IMG_PREFIX)-vmlinux-initramfs
14    UIMAGE:=$(IMG_PREFIX)-uImage-initramfs
15endif
16
17define kernel_entry
18-a 0x80002000 -e 0x80002000
19endef
20
21
22define CompressGzip
23    gzip -9 -c $(1) > $(2)
24endef
25
26define MkImage
27    mkimage -A mips -O linux -T kernel $(call kernel_entry) -C $(1) $(2) \
28        -n "ADM8668 Linux Kernel(2.4.31)" \
29        -d $(3) $(4)
30endef
31
32define Build/Clean
33    $(MAKE) -C lzma-loader clean
34endef
35
36define Image/Prepare
37    cat $(KDIR)/vmlinux | $(STAGING_DIR_HOST)/bin/lzma e -si -so -eos -lc1 -lp2 -pb2 > $(KDIR)/vmlinux.lzma
38    $(MAKE) -C lzma-loader \
39        KDIR="$(KDIR)" \
40        clean compile
41    rm -f $(KDIR)/fs_mark
42    touch $(KDIR)/fs_mark
43    $(call prepare_generic_squashfs,$(KDIR)/fs_mark)
44endef
45
46define Image/Build
47    ./my-mkimage $(KDIR)/loader.bin $(KDIR)/root.squashfs \
48        $(KDIR)/fs_mark $(BIN_DIR)/$(IMG_PREFIX)-$(1).bin
49endef
50
51define Image/BuildKernel
52    cp $(KDIR)/vmlinux.elf $(VMLINUX).elf
53    cp $(KDIR)/vmlinux $(VMLINUX).bin
54    $(call CompressGzip,$(KDIR)/vmlinux,$(KDIR)/vmlinux.bin.gz)
55    $(call MkImage,gzip,,$(KDIR)/vmlinux.bin.gz,$(BIN_DIR)/$(UIMAGE)-gzip.bin)
56endef
57
58$(eval $(call BuildImage))
59

Archive Download this file



interactive