remove some debugging junk (#492)
[openwrt.git] / 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 $(2)-$(1) BOARD="$(2)" clean
13
14 $(1)/$(2)-prepare:
15 $(MAKE) -C $(2)-$(1) BOARD="$(2)" prepare
16
17 $(1)/$(2)-compile:
18 $(MAKE) -C $(2)-$(1) BOARD="$(2)" compile
19
20 $(1)/$(2)-rebuild:
21 $(MAKE) -C $(2)-$(1) BOARD="$(2)" rebuild
22
23 $(1)/$(2)-install:
24 $(MAKE) -C $(2)-$(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 ($(CONFIG_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) ./imagebuilder/* $(IB_DIR)/
55 $(CP) $(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) ./image $(IB_DIR)/
60 $(CP) $(TOPDIR)/.config $(IB_DIR)/
61 find $(IB_DIR) -name .svn | xargs rm -rf
62 find $(IB_DIR) -name CVS | xargs rm -rf
63 (cd $(BUILD_DIR); tar c $(IB_NAME) | bzip2 -c > $(BIN_DIR)/$(IB_NAME).tar.bz2)
64
65 ifeq ($(CONFIG_PACKAGE_IMAGEBUILDER),y)
66 install: $(BIN_DIR)/$(IB_NAME).tar.bz2
67 endif
68
69 prepare:
70 $(MAKE) -C image prepare
71 compile:
72 $(MAKE) -C image compile
73 install:
74 rebuild:
75 clean:
76
77 $(eval $(call kernel_template,2.4,brcm,2_4_BRCM))
78 $(eval $(call kernel_template,2.4,ar7,2_4_AR7))
79 $(eval $(call kernel_template,2.4,x86,2_4_X86))
80 $(eval $(call kernel_template,2.6,brcm,2_6_BRCM))
81 $(eval $(call kernel_template,2.6,x86,2_6_X86))
82 $(eval $(call kernel_template,2.4,ar531x,2_4_AR531X))
83 $(eval $(call kernel_template,2.6,aruba,2_6_ARUBA))
84 $(eval $(call kernel_template,2.6,au1000,2_6_AU1000))
85 $(eval $(call kernel_template,2.6,xscale,2_6_XSCALE))
86 $(eval $(call kernel_template,2.6,sibyte,2_6_SIBYTE))
This page took 0.057924 seconds and 5 git commands to generate.