23072bde9bc83213f7fc72b6c3bace5244a5a452
[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 $(BIN_DIR)/openwrt-$(BOARD)-$(KERNEL)-$(FS).trx: $(KDIR)/vmlinux.lzma compile
19 endif
20
21 ifeq ($(FS),jffs2-8MB)
22 TRXALIGN:=-a 0x20000
23 endif
24 ifeq ($(FS),jffs2-4MB)
25 TRXALIGN:=-a 0x10000
26 endif
27 $(BIN_DIR)/openwrt-$(BOARD)-$(KERNEL)-$(FS).trx:
28 $(STAGING_DIR)/bin/trx -o $@ $(BUILD_DIR)/loader.gz $(KDIR)/vmlinux.lzma $(TRXALIGN) $(KDIR)/root.$(FS)
29
30 ifeq ($(KERNEL),2.6)
31 FSNAME:=$(patsubst jffs2-%,jffs2,$(FS))
32
33 ifneq ($(FS),jffs2-4MB)
34 $(BIN_DIR)/openwrt-wgt634u-$(KERNEL)-$(FSNAME).bin: $(BIN_DIR)/openwrt-$(BOARD)-$(KERNEL)-$(FS).trx
35 dd if=$(BUILD_DIR)/loader.elf of=$@ bs=131072 conv=sync
36 cat $(BIN_DIR)/openwrt-$(BOARD)-$(KERNEL)-$(FS).trx >> $@
37
38 install: $(BIN_DIR)/openwrt-wgt634u-$(KERNEL)-$(FSNAME).bin
39 endif
40 endif
41
42 ifeq ($(KERNEL),2.4)
43 FSNAME:=$(patsubst jffs2-%,jffs2,$(FS))
44
45 ifneq ($(FS),jffs2-8MB)
46 $(BIN_DIR)/openwrt-wrt54g-$(FSNAME).bin: $(BIN_DIR)/openwrt-$(BOARD)-$(KERNEL)-$(FS).trx
47 $(STAGING_DIR)/bin/addpattern -4 -p W54G -v v4.20.6 -i $< -o $@ -g
48
49 install: $(BIN_DIR)/openwrt-wrt54g-$(FSNAME).bin
50 endif
51
52 ifneq ($(FS),jffs2-4MB)
53 $(BIN_DIR)/openwrt-wrt54gs-$(FSNAME).bin: $(BIN_DIR)/openwrt-$(BOARD)-$(KERNEL)-$(FS).trx
54 $(STAGING_DIR)/bin/addpattern -4 -p W54S -v v4.70.6 -i $< -o $@ -g
55
56 install: $(BIN_DIR)/openwrt-wrt54gs-$(FSNAME).bin
57 endif
58
59 $(BIN_DIR)/openwrt-motorola-$(FS).bin: $(BIN_DIR)/openwrt-$(BOARD)-$(KERNEL)-$(FS).trx
60 $(STAGING_DIR)/bin/motorola-bin $< $@
61 install: $(BIN_DIR)/openwrt-motorola-$(FS).bin
62 endif
63
64 ifeq ($(IB),)
65 clean: lzma-loader-clean
66 prepare: lzma-loader-prepare
67 compile: lzma-loader-compile
68 else
69 clean:
70 prepare:
71 compile:
72 endif
73 install: $(BIN_DIR)/openwrt-$(BOARD)-$(KERNEL)-$(FS).trx
74 install-ib:
75 mkdir -p $(IB_DIR)/staging_dir_$(ARCH)/bin
76 cp -fpR $(STAGING_DIR)/bin/addpattern $(STAGING_DIR)/bin/trx $(STAGING_DIR)/bin/motorola-bin $(IB_DIR)/staging_dir_$(ARCH)/bin
77 mkdir -p $(IB_DIR)/build_$(ARCH)/linux-$(KERNEL)-$(BOARD)
78 cp -fpR $(BUILD_DIR)/loader.gz $(IB_DIR)/build_$(ARCH)/
79 cp -fpR $(KDIR)/vmlinux.lzma $(IB_DIR)/build_$(ARCH)/linux-$(KERNEL)-$(BOARD)/
This page took 0.041826 seconds and 3 git commands to generate.