add ar9 specific profile
[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 IB_LDIR:=$(patsubst $(TOPDIR)/%,$(PKG_BUILD_DIR)/%,$(LINUX_DIR))
21
22 all: compile
23
24 $(BIN_DIR)/$(IB_NAME).tar.bz2: clean
25 rm -rf $(PKG_BUILD_DIR)
26 mkdir -p $(IB_KDIR) $(IB_LDIR) $(PKG_BUILD_DIR)/staging_dir/host \
27 $(PKG_BUILD_DIR)/target $(PKG_BUILD_DIR)/scripts
28 -cp $(TOPDIR)/.config $(PKG_BUILD_DIR)/.config
29 $(CP) \
30 $(INCLUDE_DIR) $(SCRIPT_DIR) \
31 $(TOPDIR)/rules.mk \
32 ./files/Makefile \
33 ./files/repositories.conf \
34 $(TMP_DIR)/.targetinfo \
35 $(TMP_DIR)/.packageinfo \
36 $(PKG_BUILD_DIR)/
37 $(SED) 's/$$A/$(BOARD)/' $(PKG_BUILD_DIR)/repositories.conf
38 $(CP) $(PACKAGE_DIR) $(PKG_BUILD_DIR)/packages
39 $(CP) $(STAGING_DIR_HOST)/bin $(PKG_BUILD_DIR)/staging_dir/host/
40 $(CP) $(TOPDIR)/target/linux $(PKG_BUILD_DIR)/target/
41 rm -rf \
42 $(PKG_BUILD_DIR)/target/linux/*/files{,-*} \
43 $(PKG_BUILD_DIR)/target/linux/*/patches{,-*}
44 -cp $(KERNEL_BUILD_DIR)/* $(IB_KDIR)/ # don't copy subdirectories here
45 -cp $(LINUX_DIR)/.config $(IB_LDIR)/
46 echo REVISION:="$(REVISION)" > $(PKG_BUILD_DIR)/include/version.mk
47 find $(PKG_BUILD_DIR) -name CVS -o -name .git -o -name .svn \
48 | $(XARGS) rm -rf
49 $(TAR) c -C $(BUILD_DIR) $(IB_NAME) | bzip2 -c > $@
50
51 download:
52 prepare:
53 compile: $(BIN_DIR)/$(IB_NAME).tar.bz2
54 install: compile
55
56 clean: FORCE
57 rm -rf $(PKG_BUILD_DIR) $(BIN_DIR)/$(IB_NAME).tar.bz2
This page took 0.041068 seconds and 5 git commands to generate.