omap: complete 3.18 support
[openwrt/svn-archive/archive.git] / target / linux / omap / image / Makefile
1 #
2 # Copyright (C) 2012-2014 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 UBIFS_OPTS = -F -m 2048 -e 124KiB -c 4096 -U
11 UBI_OPTS = -m 2048 -p 128KiB -s 512 -O 2048
12
13 define Image/BuildKernel
14 $(CP) $(KDIR)/zImage $(BIN_DIR)/openwrt-$(BOARD)-zImage
15 ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),)
16 $(CP) $(KDIR)/zImage-initramfs $(BIN_DIR)/openwrt-$(BOARD)-zImage-initramfs
17 endif
18
19 ifneq ($(CONFIG_TARGET_ROOTFS_INCLUDE_KERNEL),)
20 $(INSTALL_DIR) $(TARGET_DIR)/boot
21 $(CP) $(BIN_DIR)/openwrt-$(BOARD)-zImage $(TARGET_DIR)/boot/zImage
22 endif
23 ifneq ($(CONFIG_TARGET_ROOTFS_INCLUDE_DTB),)
24 $(INSTALL_DIR) $(TARGET_DIR)/boot
25 $(CP) $(DTS_DIR)/am335x*.dtb $(TARGET_DIR)/boot/
26 $(CP) $(DTS_DIR)/omap3*.dtb $(TARGET_DIR)/boot/
27 $(CP) $(DTS_DIR)/omap4*.dtb $(TARGET_DIR)/boot/
28 endif
29 -mkdir $(BIN_DIR)/dtbs
30 -$(CP) $(DTS_DIR)/am335x*.dtb $(BIN_DIR)/dtbs/
31 -$(CP) $(DTS_DIR)/omap3*.dtb $(BIN_DIR)/dtbs/
32 -$(CP) $(DTS_DIR)/omap4*.dtb $(BIN_DIR)/dtbs/
33 endef
34
35 define Image/Build
36 $(call Image/Build/$(1),$(1))
37 endef
38
39 define Image/Build/jffs2-64k
40 dd if=$(KDIR)/root.$(1) of=$(BIN_DIR)/openwrt-$(BOARD)-$(1).img bs=65536 conv=sync
41 endef
42
43 define Image/Build/jffs2-128k
44 dd if=$(KDIR)/root.$(1) of=$(BIN_DIR)/openwrt-$(BOARD)-$(1).img bs=131072 conv=sync
45 endef
46
47 define Image/Build/squashfs
48 $(call prepare_generic_squashfs,$(KDIR)/root.squashfs)
49 dd if=$(KDIR)/root.$(1) of=$(BIN_DIR)/openwrt-$(BOARD)-$(1).img bs=131072 conv=sync
50 endef
51
52 $(eval $(call BuildImage))