ea13017b1262293a0def9f531042026646bd7e4b
[openwrt.git] / target / linux / adm5120 / image / Makefile
1 #
2 # Copyright (C) 2006,2007 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 LOADER_MAKE := $(NO_TRACE_MAKE) -C lzma-loader KDIR=$(KDIR)
11 IMGNAME := $(BIN_DIR)/openwrt-$(BOARD)-$(KERNEL)
12
13 define imgname
14 $(BIN_DIR)/openwrt-$(BOARD)-$(KERNEL)-$(patsubst jffs2-%,jffs2,$(1))-$(2)
15 endef
16
17 define Build/Clean
18 $(LOADER_MAKE) clean
19 endef
20
21 define Image/Prepare
22 cat $(KDIR)/vmlinux | $(STAGING_DIR_HOST)/bin/lzma e -si -so -eos -lc1 -lp2 -pb2 > $(KDIR)/vmlinux.lzma
23 endef
24
25 define Image/Build/Loader
26 $(LOADER_MAKE) LOADER=loader-$(1).$(2) LOADER_DATA="" \
27 LZMA_TEXT_START=$(3) LZMA_STARTUP_ORG=$(4) \
28 CONFIG_PASS_KARGS=$(5) CONFIG_BOARD=$(6) \
29 compile loader.$(2)
30 endef
31
32 define Image/Build/LZMAKernel
33 $(LOADER_MAKE) TARGET_DIR=$(BIN_DIR) \
34 LOADER=openwrt-$(BOARD)-$(KERNEL)-ramfs-lzma-$(1).$(2) \
35 LOADER_DATA=$(KDIR)/vmlinux.lzma \
36 LZMA_TEXT_START=$(3) LZMA_STARTUP_ORG=$(4) \
37 CONFIG_PASS_KARGS=$(5) CONFIG_BOARD=$(6) \
38 compile loader.$(2)
39 endef
40
41 define Image/Build/LZMAKernel/Generic
42 $(call Image/Build/LZMAKernel,$(1),$(2),0x80500000,0)
43 endef
44
45 define Image/Build/LZMAKernel/Admboot
46 $(call Image/Build/LZMAKernel,$(1),$(2),0x80500000,0x6D8,y,$(1))
47 endef
48
49 define Image/Build/LZMAKernel/KArgs
50 $(call Image/Build/LZMAKernel,$(1),$(2),0x80500000,0,y,$(1))
51 endef
52
53 define trxalign/jffs2-128k
54 -a 0x20000 -f $(KDIR)/root.jffs2-128k
55 endef
56 define trxalign/jffs2-64k
57 -a 0x10000 -f $(KDIR)/root.jffs2-64k
58 endef
59 define trxalign/squashfs
60 -a 1024 -f $(KDIR)/root.squashfs
61 endef
62
63 define Image/Build/TRX
64 $(STAGING_DIR_HOST)/bin/trx -o $(1) -f $(3) -f $(KDIR)/vmlinux.lzma \
65 $(call trxalign/$(2))
66 endef
67
68 define Image/Build/TRXNoloader
69 $(STAGING_DIR_HOST)/bin/trx -o $(1) -f $(KDIR)/vmlinux.lzma \
70 $(call trxalign/$(2))
71 endef
72
73 include $(SUBTARGET).mk
74
75 define Image/Build
76 $(call Image/Build/Profile/$(PROFILE),$(1))
77 endef
78
79 define Image/Build/Initramfs
80 $(call Image/Build/Profile/$(PROFILE),Initramfs)
81 endef
82
83 $(eval $(call BuildImage))
This page took 0.047477 seconds and 3 git commands to generate.