final fix for the profile selection
[openwrt.git] / target / imagebuilder / Makefile
1
2 # Copyright (C) 2006 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7 # $Id: Makefile 6070 2007-01-10 21:21:59Z nbd $
8
9 include $(TOPDIR)/rules.mk
10 include $(INCLUDE_DIR)/kernel.mk
11 include $(INCLUDE_DIR)/host.mk
12
13 PKG_OS:=$(shell uname -s)
14 PKG_CPU:=$(shell uname -m)
15
16 IB_NAME:=OpenWrt-ImageBuilder-$(BOARD)-$(KERNEL)-for-$(PKG_OS)-$(PKG_CPU)
17 IB_BUILD_DIR:=$(BUILD_DIR)/$(IB_NAME)
18
19 all: compile
20
21 $(BIN_DIR)/$(IB_NAME).tar.bz2: clean
22         rm -rf $(IB_BUILD_DIR)
23         mkdir -p $(IB_BUILD_DIR)/build_$(ARCH)/linux-$(KERNEL)-$(BOARD) $(IB_BUILD_DIR)/staging_dir_$(ARCH)/bin $(IB_BUILD_DIR)/target/linux
24         $(CP) \
25                 $(INCLUDE_DIR) $(SCRIPT_DIR) $(PACKAGE_DIR) \
26                 $(TOPDIR)/rules.mk $(TOPDIR)/.config \
27                 $(TMP_DIR)/.target.mk \
28                 $(TMP_DIR)/.pkginfo \
29                 $(TMP_DIR)/.targetinfo \
30                 ./files/Makefile \
31                 $(IB_BUILD_DIR)/
32         $(CP) $(STAGING_DIR)/bin/* $(IB_BUILD_DIR)/staging_dir_$(ARCH)/bin
33         $(CP) $(TOPDIR)/target/linux/* $(IB_BUILD_DIR)/target/linux
34         rm -rf $(IB_BUILD_DIR)/target/linux/*/patches
35         -cp $(BUILD_DIR)/linux-$(KERNEL)-$(BOARD)/* $(IB_BUILD_DIR)/build_$(ARCH)/linux-$(KERNEL)-$(BOARD) # don't copy subdirectories here
36         find $(IB_BUILD_DIR) -name .svn | xargs rm -rf 
37         find $(IB_BUILD_DIR) -name CVS | xargs rm -rf 
38         (cd $(BUILD_DIR); \
39                 tar cfj $@ $(IB_NAME); \
40         )
41
42 download:
43 prepare:
44 compile: $(BIN_DIR)/$(IB_NAME).tar.bz2
45 install: compile
46
47 clean: FORCE
48         rm -rf $(IB_BUILD_DIR) $(BIN_DIR)/$(IB_NAME).tar.bz2