58646638eac9a0f7e0aae1425f9ba1d966b7a346
[openwrt-working-2016/.git] / 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 #
7 include $(TOPDIR)/rules.mk
8 include $(INCLUDE_DIR)/image.mk
9
10 VMLINUX:=$(BIN_DIR)/$(IMG_PREFIX)-vmlinux
11 ifeq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),y)
12         VMLINUX:=$(BIN_DIR)/$(IMG_PREFIX)-vmlinux-initramfs
13 endif
14
15 define Build/Clean
16         $(MAKE) -C lzma-loader clean
17 endef
18
19 define Image/Prepare
20         cat $(KDIR)/vmlinux | $(STAGING_DIR_HOST)/bin/lzma e -si -so -eos -lc1 -lp2 -pb2 > $(KDIR)/vmlinux.lzma
21         $(MAKE) -C lzma-loader \
22                 KDIR="$(KDIR)" \
23                 clean compile
24         rm -f $(KDIR)/fs_mark
25         touch $(KDIR)/fs_mark
26         $(call prepare_generic_squashfs,$(KDIR)/fs_mark)
27 endef
28
29 define Image/Build
30         ./my-mkimage $(KDIR)/loader.bin $(KDIR)/root.squashfs   \
31                 $(KDIR)/fs_mark $(BIN_DIR)/$(IMG_PREFIX)-$(1).bin
32 endef
33
34 define Image/BuildKernel
35         cp $(KDIR)/vmlinux.elf $(VMLINUX).elf
36         cp $(KDIR)/vmlinux $(VMLINUX).bin
37 endef
38
39 $(eval $(call BuildImage))