0832ede2804d9bb6e65b244a7e627ff82bda9034
[openwrt.git] / toolchain / sed / Makefile
1 include $(TOPDIR)/rules.mk
2
3 PKG_NAME := sed
4 PKG_VERSION := 4.1.2
5 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
6 PKG_SOURCE_URL:=ftp://ftp.gnu.org/gnu/$(PKG_NAME)
7 PKG_MD5SUM:=928f0e06422f414091917401f1a834d0
8 PKG_CAT:=zcat
9
10 PKG_BUILD_DIR:=$(TOOL_BUILD_DIR)/sed-$(PKG_VERSION)
11
12 HOST_SED_TARGET=$(strip $(shell ./sedcheck.sh))
13
14 ifneq ($(HOST_SED_TARGET),build-sed-host-binary)
15 PKG_SOURCE:=
16 PKG_CAT:=
17 endif
18
19 include $(INCLUDE_DIR)/host-build.mk
20
21 ifeq ($(HOST_SED_TARGET),build-sed-host-binary)
22 define Build/Configure
23 (cd $(PKG_BUILD_DIR); rm -rf config.cache; \
24 ./configure \
25 --prefix=$(STAGING_DIR) \
26 --prefix=/usr \
27 );
28 endef
29
30 define Build/Compile
31 $(MAKE) -C $(PKG_BUILD_DIR)
32 endef
33
34 define Build/Install
35 @if [ -L $(STAGING_DIR)/bin/sed ] ; then \
36 rm -f $(STAGING_DIR)/bin/sed; fi;
37 @if [ ! -f $(STAGING_DIR)/bin/sed -o $(STAGING_DIR)/bin/sed -ot $(PKG_BUILD_DIR)/sed/sed ]; then \
38 set -x; \
39 mkdir -p $(STAGING_DIR)/bin; \
40 $(MAKE) DESTDIR=$(STAGING_DIR) -C $(PKG_BUILD_DIR) install; \
41 mv $(STAGING_DIR)/usr/bin/sed $(STAGING_DIR)/bin/; \
42 rm -rf $(STAGING_DIR)/share/locale $(STAGING_DIR)/usr/info \
43 $(STAGING_DIR)/usr/man $(STAGING_DIR)/usr/share/doc; \
44 fi
45 endef
46 else
47 define Build/Compile
48 endef
49 define Build/Install
50 rm -rf $(STAGING_DIR)/bin/sed
51 mkdir -p $(STAGING_DIR)/bin
52 ln -s `which sed` $(STAGING_DIR)/bin/sed
53 endef
54 endif
55
56 $(eval $(call HostBuild))
This page took 0.053434 seconds and 3 git commands to generate.