92143d64e8d512b5ce5f062130f2f868ec728de0
[openwrt.git] / target / linux / image / image.mk
1 include $(TOPDIR)/rules.mk
2
3 KDIR:=$(BUILD_DIR)/linux-$(KERNEL)-$(BOARD)
4
5 ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),y)
6 ifeq ($(CONFIG_TARGET_ROOTFS_JFFS2),y)
7 include $(TOPDIR)/target/linux/image/jffs2.mk
8 endif
9
10 ifeq ($(CONFIG_TARGET_ROOTFS_SQUASHFS_LZMA),y)
11 include $(TOPDIR)/target/linux/image/squashfs.mk
12 endif
13
14 ifeq ($(CONFIG_TARGET_ROOTFS_TGZ),y)
15 include $(TOPDIR)/target/linux/image/tgz.mk
16 endif
17 endif
18
19 define Image/mkfs/prepare/default
20         find $(BUILD_DIR)/root -type f -not -perm +0100 | xargs chmod 0644
21         find $(BUILD_DIR)/root -type f -perm +0100 | xargs chmod 0755
22         find $(BUILD_DIR)/root -type d | xargs chmod 0755
23         mkdir -p $(BUILD_DIR)/root/tmp
24         chmod 0777 $(BUILD_DIR)/root/tmp
25 endef
26
27 define Image/mkfs/prepare
28         $(call Image/mkfs/prepare/default)
29 endef
30
31 define BuildImage
32 compile:
33         $(call Build/Compile)
34
35 install:
36         $(call Image/Prepare)
37         $(call Image/mkfs/prepare)
38         $(call Image/BuildKernel)
39         $(call Image/mkfs/jffs2)
40         $(call Image/mkfs/squashfs)
41         $(call Image/mkfs/tgz)
42         
43 clean:
44         $(call Build/Clean)
45 endef
46
47 compile-targets:
48 install-targets:
49 clean-targets:
50
51 source:
52 prepare:
53 compile: compile-targets
54 install: compile install-targets
55 clean: clean-targets