brcm47xx: Add new image generation and fix leds/reset button on WNR834B V2
[openwrt.git] / target / imagebuilder / Makefile
1 #
2 # Copyright (C) 2006-2010 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7
8 include $(TOPDIR)/rules.mk
9 include $(INCLUDE_DIR)/kernel.mk
10 include $(INCLUDE_DIR)/host.mk
11
12 override MAKEFLAGS=
13
14 PKG_OS:=$(shell uname -s)
15 PKG_CPU:=$(shell uname -m | sed "s/ //g")
16
17 IB_NAME:=OpenWrt-ImageBuilder-$(BOARD)-for-$(PKG_OS)-$(PKG_CPU)
18 PKG_BUILD_DIR:=$(BUILD_DIR)/$(IB_NAME)
19 IB_KDIR:=$(patsubst $(TOPDIR)/%,$(PKG_BUILD_DIR)/%,$(KERNEL_BUILD_DIR))
20
21 all: compile
22
23 $(BIN_DIR)/$(IB_NAME).tar.bz2: clean
24 rm -rf $(PKG_BUILD_DIR)
25 mkdir -p $(IB_KDIR) $(PKG_BUILD_DIR)/staging_dir/host $(PKG_BUILD_DIR)/target
26 -cp $(TOPDIR)/.config $(PKG_BUILD_DIR)/.config
27 $(CP) \
28 $(INCLUDE_DIR) $(SCRIPT_DIR) \
29 $(TOPDIR)/rules.mk \
30 ./files/Makefile \
31 $(TMP_DIR)/.targetinfo \
32 $(TMP_DIR)/.packageinfo \
33 $(PKG_BUILD_DIR)/
34 $(CP) $(PACKAGE_DIR) $(PKG_BUILD_DIR)/packages
35 $(CP) $(STAGING_DIR_HOST)/bin $(PKG_BUILD_DIR)/staging_dir/host/
36 $(CP) $(TOPDIR)/target/linux $(PKG_BUILD_DIR)/target/
37 rm -rf \
38 $(PKG_BUILD_DIR)/target/linux/*/files{,-*} \
39 $(PKG_BUILD_DIR)/target/linux/*/patches{,-*}
40 -cp $(KERNEL_BUILD_DIR)/* $(IB_KDIR)/ # don't copy subdirectories here
41 echo REVISION:="$(REVISION)" > $(PKG_BUILD_DIR)/include/version.mk
42 find $(PKG_BUILD_DIR) -name CVS -o -name .git -o -name .svn \
43 | $(XARGS) rm -rf
44 $(TAR) c -C $(BUILD_DIR) $(IB_NAME) | bzip2 -c > $@
45
46 download:
47 prepare:
48 compile: $(BIN_DIR)/$(IB_NAME).tar.bz2
49 install: compile
50
51 clean: FORCE
52 rm -rf $(PKG_BUILD_DIR) $(BIN_DIR)/$(IB_NAME).tar.bz2
This page took 0.040289 seconds and 5 git commands to generate.