2006-06-27 08:35:46 +08:00
|
|
|
#
|
2008-08-22 10:52:19 +08:00
|
|
|
# Copyright (C) 2006-2008 OpenWrt.org
|
2006-06-27 08:35:46 +08:00
|
|
|
#
|
|
|
|
# This is free software, licensed under the GNU General Public License v2.
|
|
|
|
# See /LICENSE for more information.
|
|
|
|
#
|
2005-04-11 04:28:17 +08:00
|
|
|
|
|
|
|
include $(TOPDIR)/rules.mk
|
2006-06-21 11:17:13 +08:00
|
|
|
include $(INCLUDE_DIR)/kernel.mk
|
2006-10-14 22:16:26 +08:00
|
|
|
include $(INCLUDE_DIR)/host.mk
|
2005-04-11 04:28:17 +08:00
|
|
|
|
2008-08-17 19:14:13 +08:00
|
|
|
override MAKEFLAGS=
|
|
|
|
|
2005-04-11 04:28:17 +08:00
|
|
|
PKG_OS:=$(shell uname -s)
|
|
|
|
PKG_CPU:=$(shell uname -m)
|
|
|
|
|
2009-06-18 23:34:37 +08:00
|
|
|
SDK_NAME:=OpenWrt-SDK-$(BOARD)-for-$(PKG_OS)-$(PKG_CPU)-gcc-$(GCCV)_$(LIBC)-$(LIBCV)
|
2005-04-21 01:01:30 +08:00
|
|
|
SDK_BUILD_DIR:=$(BUILD_DIR)/$(SDK_NAME)
|
2009-08-09 19:11:11 +08:00
|
|
|
EXCLUDE_DIRS:=*/ccache \
|
|
|
|
*/stamp \
|
|
|
|
*/stampfiles \
|
|
|
|
*/man \
|
|
|
|
*/info
|
2005-04-11 04:28:17 +08:00
|
|
|
|
2008-09-25 01:11:41 +08:00
|
|
|
SVN_PACKAGE_URL=$(shell svn info ../../package | awk '/^URL:/ { print $$2; }')
|
|
|
|
|
2005-04-11 04:28:17 +08:00
|
|
|
all: compile
|
|
|
|
|
2007-01-15 07:37:40 +08:00
|
|
|
$(BIN_DIR)/$(SDK_NAME).tar.bz2: clean
|
2006-06-21 11:17:13 +08:00
|
|
|
mkdir -p $(SDK_BUILD_DIR)/dl $(SDK_BUILD_DIR)/package
|
2006-10-14 22:16:26 +08:00
|
|
|
$(CP) $(INCLUDE_DIR) $(SCRIPT_DIR) $(TOPDIR)/docs $(SDK_BUILD_DIR)/
|
2010-03-18 00:03:08 +08:00
|
|
|
$(TAR) -cf - -C $(TOPDIR) $(foreach exclude,$(EXCLUDE_DIRS),--exclude="$(exclude)") --exclude="staging_dir/$(ARCH)" staging_dir/host staging_dir/target-$(ARCH)$(ARCH_SUFFIX)_$(LIBC)-$(LIBCV) staging_dir/toolchain-$(ARCH)$(ARCH_SUFFIX)_gcc-$(GCCV)_$(LIBC)-$(LIBCV) | \
|
2006-10-14 22:16:26 +08:00
|
|
|
$(TAR) -xf - -C $(SDK_BUILD_DIR)
|
2007-12-14 08:33:25 +08:00
|
|
|
mkdir -p $(SDK_BUILD_DIR)/target/linux
|
|
|
|
$(CP) $(GENERIC_PLATFORM_DIR) $(PLATFORM_DIR) $(SDK_BUILD_DIR)/target/linux/
|
|
|
|
rm -rf \
|
|
|
|
$(SDK_BUILD_DIR)/target/linux/*/files \
|
|
|
|
$(SDK_BUILD_DIR)/target/linux/*/patches
|
|
|
|
$(CP) \
|
2008-08-22 12:20:40 +08:00
|
|
|
$(TOPDIR)/LICENSE \
|
2007-12-14 08:33:25 +08:00
|
|
|
$(TOPDIR)/rules.mk \
|
|
|
|
$(TOPDIR)/.config \
|
2008-08-22 12:20:40 +08:00
|
|
|
./files/Config.in \
|
2007-12-14 08:33:25 +08:00
|
|
|
./files/Makefile \
|
|
|
|
./files/README.SDK \
|
|
|
|
$(SDK_BUILD_DIR)/
|
|
|
|
$(CP) \
|
|
|
|
./files/package/rules.mk \
|
|
|
|
$(TOPDIR)/package/Makefile \
|
|
|
|
$(SDK_BUILD_DIR)/package/
|
2008-09-25 01:11:41 +08:00
|
|
|
echo "src-svn trunk $(SVN_PACKAGE_URL)" \
|
|
|
|
> $(SDK_BUILD_DIR)/feeds.conf.default
|
|
|
|
cat $(TOPDIR)/feeds.conf.default \
|
|
|
|
>> $(SDK_BUILD_DIR)/feeds.conf.default
|
2007-12-14 08:33:25 +08:00
|
|
|
echo REVISION:="$(REVISION)" > $(SDK_BUILD_DIR)/include/version.mk
|
|
|
|
find $(SDK_BUILD_DIR) -name .git | $(XARGS) rm -rf
|
2007-04-29 09:30:48 +08:00
|
|
|
find $(SDK_BUILD_DIR) -name .svn | $(XARGS) rm -rf
|
|
|
|
find $(SDK_BUILD_DIR) -name CVS | $(XARGS) rm -rf
|
2005-04-11 04:28:17 +08:00
|
|
|
(cd $(BUILD_DIR); \
|
2005-04-21 01:01:30 +08:00
|
|
|
tar cfj $@ $(SDK_NAME); \
|
|
|
|
)
|
|
|
|
|
2006-07-22 01:00:14 +08:00
|
|
|
download:
|
2005-04-11 04:28:17 +08:00
|
|
|
prepare:
|
2005-05-28 17:17:29 +08:00
|
|
|
compile: $(BIN_DIR)/$(SDK_NAME).tar.bz2
|
2007-01-15 07:37:40 +08:00
|
|
|
install: compile
|
2005-04-11 04:28:17 +08:00
|
|
|
|
|
|
|
clean:
|
2005-10-17 22:03:46 +08:00
|
|
|
rm -rf $(SDK_BUILD_DIR) $(BIN_DIR)/$(SDK_NAME).tar.bz2
|