resync config-ramdisk to config
[openwrt.git] / openwrt / target / linux / image / brcm / Makefile
1 include $(TOPDIR)/rules.mk
2
3 KDIR:=$(BUILD_DIR)/linux-$(KERNEL)-$(BOARD)
4
5 lzma-loader-clean:
6 $(MAKE) -C lzma-loader clean
7
8 lzma-loader-prepare:
9 $(MAKE) -C lzma-loader prepare
10
11 lzma-loader-compile: lzma-loader-prepare
12 $(MAKE) -C lzma-loader compile
13
14 ifeq ($(IB),)
15 $(KDIR)/vmlinux.lzma: $(KDIR)/vmlinux
16 cat $^ | $(STAGING_DIR)/bin/lzma e -si -so -eos -lc1 -lp2 -pb2 > $@ || (rm -f $@ && false)
17
18 $(KDIR)/loader.tmp.gz: compile
19 $(BIN_DIR)/openwrt-$(BOARD)-$(KERNEL)-$(FS).trx: $(KDIR)/vmlinux.lzma
20 endif
21
22 ifeq ($(FS),jffs2-8MB)
23 TRXALIGN:=-a 0x20000
24 endif
25 ifeq ($(FS),jffs2-4MB)
26 TRXALIGN:=-a 0x10000
27 endif
28 # see ticket #155
29 ifeq ($(FS),squashfs)
30 TRXALIGN:=-a 1024
31 endif
32
33
34 $(KDIR)/loader.tmp.gz:
35 $(CP) $(BUILD_DIR)/loader.gz $@
36 echo -ne "\\x00" >> $@
37
38 $(BIN_DIR)/openwrt-$(BOARD)-$(KERNEL)-$(FS).trx: $(KDIR)/loader.tmp.gz
39 $(STAGING_DIR)/bin/trx -o $@ $(KDIR)/loader.tmp.gz $(KDIR)/vmlinux.lzma $(TRXALIGN) $(KDIR)/root.$(FS)
40
41 ifeq ($(KERNEL),2.6)
42 FSNAME:=$(patsubst jffs2-%,jffs2,$(FS))
43
44 ifneq ($(FS),jffs2-4MB)
45 $(BIN_DIR)/openwrt-wgt634u-$(KERNEL)-$(FSNAME).bin: $(BIN_DIR)/openwrt-$(BOARD)-$(KERNEL)-$(FS).trx
46 dd if=$(BUILD_DIR)/loader.elf of=$@ bs=131072 conv=sync
47 cat $(BIN_DIR)/openwrt-$(BOARD)-$(KERNEL)-$(FS).trx >> $@
48
49 $(BIN_DIR)/openwrt-wrt54gs-$(KERNEL)-$(FSNAME).bin: $(BIN_DIR)/openwrt-$(BOARD)-$(KERNEL)-$(FS).trx
50 $(STAGING_DIR)/bin/addpattern -4 -p W54S -v v4.70.6 -i $< -o $@ -g
51
52 install: $(BIN_DIR)/openwrt-wgt634u-$(KERNEL)-$(FSNAME).bin $(BIN_DIR)/openwrt-wrt54gs-$(KERNEL)-$(FSNAME).bin
53
54 endif
55
56 ifneq ($(FS),jffs2-8MB)
57 $(BIN_DIR)/openwrt-wrt54g3g-$(KERNEL)-$(FSNAME).bin: $(BIN_DIR)/openwrt-$(BOARD)-$(KERNEL)-$(FS).trx
58 $(STAGING_DIR)/bin/addpattern -4 -p W54F -v v1.99.5 -i $< -o $@ -g
59
60 $(BIN_DIR)/openwrt-wrt54g-$(KERNEL)-$(FSNAME).bin: $(BIN_DIR)/openwrt-$(BOARD)-$(KERNEL)-$(FS).trx
61 $(STAGING_DIR)/bin/addpattern -4 -p W54G -v v4.20.6 -i $< -o $@ -g
62
63 $(BIN_DIR)/openwrt-wrt54gs_v4-$(KERNEL)-$(FSNAME).bin: $(BIN_DIR)/openwrt-$(BOARD)-$(KERNEL)-$(FS).trx
64 $(STAGING_DIR)/bin/addpattern -4 -p W54s -v v1.05.2 -i $< -o $@ -g
65
66 install: $(BIN_DIR)/openwrt-wrt54g-$(KERNEL)-$(FSNAME).bin $(BIN_DIR)/openwrt-wrt54gs_v4-$(KERNEL)-$(FSNAME).bin $(BIN_DIR)/openwrt-wrt54g3g-$(KERNEL)-$(FSNAME).bin
67
68 endif
69 endif
70
71 ifeq ($(KERNEL),2.4)
72 FSNAME:=$(patsubst jffs2-%,jffs2,$(FS))
73
74 # ifeq ($(FS),squashfs)
75 # $(BIN_DIR)/openwrt-wap54g-$(KERNEL)-$(FSNAME).trx: $(BIN_DIR)/openwrt-$(BOARD)-$(KERNEL)-$(FS).trx
76 # $(CP) $< $@
77 # echo -ne '\x01' >> $@
78 #
79 # install: $(BIN_DIR)/openwrt-wap54g-$(KERNEL)-$(FSNAME).trx
80 # endif
81
82 ifneq ($(FS),jffs2-8MB)
83 $(BIN_DIR)/openwrt-wrt54g3g-$(KERNEL)-$(FSNAME).bin: $(BIN_DIR)/openwrt-$(BOARD)-$(KERNEL)-$(FS).trx
84 $(STAGING_DIR)/bin/addpattern -4 -p W54F -v v1.99.5 -i $< -o $@ -g
85
86 $(BIN_DIR)/openwrt-wrt54g-$(KERNEL)-$(FSNAME).bin: $(BIN_DIR)/openwrt-$(BOARD)-$(KERNEL)-$(FS).trx
87 $(STAGING_DIR)/bin/addpattern -4 -p W54G -v v4.20.6 -i $< -o $@ -g
88
89 $(BIN_DIR)/openwrt-wrt54gs_v4-$(KERNEL)-$(FSNAME).bin: $(BIN_DIR)/openwrt-$(BOARD)-$(KERNEL)-$(FS).trx
90 $(STAGING_DIR)/bin/addpattern -4 -p W54s -v v1.05.2 -i $< -o $@ -g
91
92 $(BIN_DIR)/openwrt-wr850g-$(FSNAME).bin: $(BIN_DIR)/openwrt-$(BOARD)-$(KERNEL)-$(FS).trx
93 $(STAGING_DIR)/bin/motorola-bin -1 $< $@
94
95 $(BIN_DIR)/openwrt-wa840g-$(FSNAME).bin: $(BIN_DIR)/openwrt-$(BOARD)-$(KERNEL)-$(FS).trx
96 $(STAGING_DIR)/bin/motorola-bin -2 $< $@
97
98 $(BIN_DIR)/openwrt-we800g-$(FSNAME).bin: $(BIN_DIR)/openwrt-$(BOARD)-$(KERNEL)-$(FS).trx
99 $(STAGING_DIR)/bin/motorola-bin -3 $< $@
100
101 install: $(BIN_DIR)/openwrt-wrt54g-$(KERNEL)-$(FSNAME).bin $(BIN_DIR)/openwrt-wrt54gs_v4-$(KERNEL)-$(FSNAME).bin $(BIN_DIR)/openwrt-wrt54g3g-$(KERNEL)-$(FSNAME).bin $(BIN_DIR)/openwrt-wr850g-$(FSNAME).bin $(BIN_DIR)/openwrt-wa840g-$(FSNAME).bin $(BIN_DIR)/openwrt-we800g-$(FSNAME).bin
102 endif
103
104 ifneq ($(FS),jffs2-4MB)
105 $(BIN_DIR)/openwrt-wgt634u-$(KERNEL)-$(FSNAME).bin: $(BIN_DIR)/openwrt-$(BOARD)-$(KERNEL)-$(FS).trx
106 dd if=$(BUILD_DIR)/loader.elf of=$@ bs=131072 conv=sync
107 cat $(BIN_DIR)/openwrt-$(BOARD)-$(KERNEL)-$(FS).trx >> $@
108
109 $(BIN_DIR)/openwrt-wrt54gs-$(KERNEL)-$(FSNAME).bin: $(BIN_DIR)/openwrt-$(BOARD)-$(KERNEL)-$(FS).trx
110 $(STAGING_DIR)/bin/addpattern -4 -p W54S -v v4.70.6 -i $< -o $@ -g
111
112 $(BIN_DIR)/openwrt-wrtsl54gs-$(FSNAME).bin: $(BIN_DIR)/openwrt-$(BOARD)-$(KERNEL)-$(FS).trx
113 $(STAGING_DIR)/bin/addpattern -4 -p W54U -v v2.00.0 -i $< -o $@ -g
114
115 install: $(BIN_DIR)/openwrt-wrt54gs-$(KERNEL)-$(FSNAME).bin $(BIN_DIR)/openwrt-wgt634u-$(KERNEL)-$(FSNAME).bin $(BIN_DIR)/openwrt-wrtsl54gs-$(FSNAME).bin
116 endif
117 endif
118
119 ifeq ($(IB),)
120 clean: lzma-loader-clean
121 prepare: lzma-loader-prepare
122 compile: lzma-loader-compile
123 else
124 clean:
125 prepare:
126 compile:
127 endif
128 install: $(BIN_DIR)/openwrt-$(BOARD)-$(KERNEL)-$(FS).trx
129 install-ib:
130 mkdir -p $(IB_DIR)/staging_dir_$(ARCH)/bin
131 $(CP) $(STAGING_DIR)/bin/addpattern $(STAGING_DIR)/bin/trx $(STAGING_DIR)/bin/motorola-bin $(IB_DIR)/staging_dir_$(ARCH)/bin
132 mkdir -p $(IB_DIR)/build_$(ARCH)/linux-$(KERNEL)-$(BOARD)
133 $(CP) $(BUILD_DIR)/loader.gz $(IB_DIR)/build_$(ARCH)/
134 $(CP) $(BUILD_DIR)/loader.elf $(IB_DIR)/build_$(ARCH)/
135 $(CP) $(KDIR)/vmlinux.lzma $(IB_DIR)/build_$(ARCH)/linux-$(KERNEL)-$(BOARD)/
This page took 0.047108 seconds and 5 git commands to generate.