large build system cleanup. added some stuff to control the verbosity level, but...
[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 $(BIN_DIR)/openwrt-$(BOARD)-$(KERNEL)-$(FS).trx:
29 $(STAGING_DIR)/bin/trx -o $@ $(BUILD_DIR)/loader.gz $(KDIR)/vmlinux.lzma $(TRXALIGN) $(KDIR)/root.$(FS)
30
31 ifeq ($(KERNEL),2.6)
32 FSNAME:=$(patsubst jffs2-%,jffs2,$(FS))
33
34 ifneq ($(FS),jffs2-4MB)
35 $(BIN_DIR)/openwrt-wgt634u-$(KERNEL)-$(FSNAME).bin: $(BIN_DIR)/openwrt-$(BOARD)-$(KERNEL)-$(FS).trx
36 dd if=$(BUILD_DIR)/loader.elf of=$@ bs=131072 conv=sync
37 cat $(BIN_DIR)/openwrt-$(BOARD)-$(KERNEL)-$(FS).trx >> $@
38
39 install: $(BIN_DIR)/openwrt-wgt634u-$(KERNEL)-$(FSNAME).bin
40 endif
41 endif
42
43 ifeq ($(KERNEL),2.4)
44 FSNAME:=$(patsubst jffs2-%,jffs2,$(FS))
45
46 ifeq ($(FS),squashfs)
47 $(BIN_DIR)/openwrt-wap54g-$(FSNAME).trx: $(BIN_DIR)/openwrt-$(BOARD)-$(KERNEL)-$(FS).trx
48 cp $< $@
49 echo -ne '\x01' >> $@
50
51 install: $(BIN_DIR)/openwrt-wap54g-$(FSNAME).trx
52 endif
53
54 ifneq ($(FS),jffs2-8MB)
55 $(BIN_DIR)/openwrt-wrt54g-$(FSNAME).bin: $(BIN_DIR)/openwrt-$(BOARD)-$(KERNEL)-$(FS).trx
56 $(STAGING_DIR)/bin/addpattern -4 -p W54G -v v4.20.6 -i $< -o $@ -g
57
58 $(BIN_DIR)/openwrt-wrt54gs_v4-$(FSNAME).bin: $(BIN_DIR)/openwrt-$(BOARD)-$(KERNEL)-$(FS).trx
59 $(STAGING_DIR)/bin/addpattern -4 -p W54s -v v1.05.0 -i $< -o $@ -g
60
61 install: $(BIN_DIR)/openwrt-wrt54g-$(FSNAME).bin $(BIN_DIR)/openwrt-wrt54gs_v4-$(FSNAME).bin
62 endif
63
64 ifneq ($(FS),jffs2-4MB)
65 $(BIN_DIR)/openwrt-wrt54gs-$(FSNAME).bin: $(BIN_DIR)/openwrt-$(BOARD)-$(KERNEL)-$(FS).trx
66 $(STAGING_DIR)/bin/addpattern -4 -p W54S -v v4.70.6 -i $< -o $@ -g
67
68 install: $(BIN_DIR)/openwrt-wrt54gs-$(FSNAME).bin
69 endif
70
71 $(BIN_DIR)/openwrt-motorola-$(FS).bin: $(BIN_DIR)/openwrt-$(BOARD)-$(KERNEL)-$(FS).trx
72 $(STAGING_DIR)/bin/motorola-bin $< $@
73 install: $(BIN_DIR)/openwrt-motorola-$(FS).bin
74 endif
75
76 ifeq ($(IB),)
77 clean: lzma-loader-clean
78 prepare: lzma-loader-prepare
79 compile: lzma-loader-compile
80 else
81 clean:
82 prepare:
83 compile:
84 endif
85 install: $(BIN_DIR)/openwrt-$(BOARD)-$(KERNEL)-$(FS).trx
86 install-ib:
87 mkdir -p $(IB_DIR)/staging_dir_$(ARCH)/bin
88 cp -fpR $(STAGING_DIR)/bin/addpattern $(STAGING_DIR)/bin/trx $(STAGING_DIR)/bin/motorola-bin $(IB_DIR)/staging_dir_$(ARCH)/bin
89 mkdir -p $(IB_DIR)/build_$(ARCH)/linux-$(KERNEL)-$(BOARD)
90 cp -fpR $(BUILD_DIR)/loader.gz $(IB_DIR)/build_$(ARCH)/
91 cp -fpR $(KDIR)/vmlinux.lzma $(IB_DIR)/build_$(ARCH)/linux-$(KERNEL)-$(BOARD)/
This page took 0.056036 seconds and 5 git commands to generate.