fix image builder dependency problem
[openwrt.git] / openwrt / target / linux / Makefile
1 include $(TOPDIR)/rules.mk
2
3 PKG_OS:=$(shell uname -s)
4 PKG_CPU:=$(shell uname -m)
5
6 IB_NAME:=OpenWrt-ImageBuilder-$(PKG_OS)-$(PKG_CPU)
7 IB_DIR:=$(BUILD_DIR)/$(IB_NAME)
8
9 define kernel_template
10
11 $(1)/$(2)-clean:
12 $(MAKE) -C linux-$(1) BOARD="$(2)" clean
13
14 $(1)/$(2)-prepare:
15 $(MAKE) -C linux-$(1) BOARD="$(2)" prepare
16
17 $(1)/$(2)-compile:
18 $(MAKE) -C linux-$(1) BOARD="$(2)" compile
19
20 $(1)/$(2)-rebuild:
21 $(MAKE) -C linux-$(1) BOARD="$(2)" rebuild
22
23 $(1)/$(2)-install:
24 $(MAKE) -C linux-$(1) BOARD="$(2)" install
25
26 $(1)/$(2)-image: $(1)/$(2)-install
27 $(MAKE) -C image KERNEL="$(1)" BOARD="$(2)" install
28
29 $(1)/$(2)-install-ib:
30 $(MAKE) -C image KERNEL="$(1)" BOARD="$(2)" IB_DIR="$(IB_DIR)" install-ib
31 echo '$$$$(eval $$$$(call image_template,$(2),$(1)))' >> $(IB_DIR)/kernel.mk
32
33
34 ifeq ($(BR2_LINUX_$(3)),y)
35 clean: $(1)/$(2)-clean
36 prepare: $(1)/$(2)-prepare
37 compile: $(1)/$(2)-compile
38 rebuild: $(1)/$(2)-rebuild
39 $(BIN_DIR)/$(IB_NAME).tar.bz2 install: $(1)/$(2)-image
40 install-ib: $(1)/$(2)-install-ib
41 endif
42
43 .PHONY: $(1)/$(2)-clean $(1)/$(2)-prepare $(1)/$(2)-compile $(1)/$(2)-rebuild $(1)/$(2)-install $(1)/$(2)-image $(1)/$(2)-install-ib
44 endef
45
46 .PHONY: clean prepare compile rebuild install imagebuilder install-ib
47
48 install-ib:
49
50 $(BIN_DIR)/$(IB_NAME).tar.bz2:
51 rm -rf $(IB_DIR)
52 mkdir -p $(IB_DIR)/packages
53 mkdir -p $(IB_DIR)/scripts
54 cp -dpR ./imagebuilder/* $(IB_DIR)/
55 cp -dpR $(TOPDIR)/bin/packages/*.ipk $(IB_DIR)/packages/
56 cp $(TOPDIR)/scripts/ipkg $(IB_DIR)/scripts/
57 $(MAKE) install-ib
58 cp $(TOPDIR)/rules.mk $(IB_DIR)
59 cp -dpR ./image $(IB_DIR)/
60 cp $(TOPDIR)/.config $(IB_DIR)/
61 find $(IB_DIR) -name CVS | xargs rm -rf
62 (cd $(BUILD_DIR); tar c $(IB_NAME) | bzip2 -c > $(BIN_DIR)/$(IB_NAME).tar.bz2)
63
64 ifeq ($(BR2_PACKAGE_IMAGEBUILDER),y)
65 install: $(BIN_DIR)/$(IB_NAME).tar.bz2
66 endif
67
68 prepare:
69 $(MAKE) -C image prepare
70 compile:
71 $(MAKE) -C image compile
72 install:
73 rebuild:
74 clean:
75
76 $(eval $(call kernel_template,2.4,brcm,2_4_BRCM))
77 $(eval $(call kernel_template,2.4,ar7,2_4_AR7))
78 $(eval $(call kernel_template,2.4,soekris,2_4_SOEKRIS))
This page took 0.061503 seconds and 5 git commands to generate.