more cleanup in toolchain/
[openwrt.git] / openwrt / toolchain / sed / Makefile
1 include $(TOPDIR)/rules.mk
2
3 #############################################################
4 #
5 # sed
6 #
7 #############################################################
8 SED_VER:=4.1.2
9 SED_SOURCE:=sed-$(SED_VER).tar.gz
10 SED_SITE:=ftp://ftp.gnu.org/gnu/sed
11 SED_CAT:=zcat
12 SED_DIR1:=$(TOOL_BUILD_DIR)/sed-$(SED_VER)
13 SED_DIR2:=$(BUILD_DIR)/sed-$(SED_VER)
14 SED_BINARY:=sed/sed
15 SED_TARGET_BINARY:=bin/sed
16 ifeq ($(strip $(BUILD_WITH_LARGEFILE)),true)
17 SED_CPPFLAGS=-D_FILE_OFFSET_BITS=64
18 endif
19 HOST_SED_TARGET=$(shell ./sedcheck.sh)
20
21 $(DL_DIR)/$(SED_SOURCE):
22 mkdir -p $(DL_DIR)
23 $(SCRIPT_DIR)/download.pl $(DL_DIR) $(SED_SOURCE) x $(SED_SITE)
24
25 #############################################################
26 #
27 # build sed for use on the host system
28 #
29 #############################################################
30
31 $(SED_DIR1)/.unpacked: $(DL_DIR)/$(SED_SOURCE)
32 mkdir -p $(TOOL_BUILD_DIR)
33 mkdir -p $(STAGING_DIR)/bin;
34 $(SED_CAT) $(DL_DIR)/$(SED_SOURCE) | tar -C $(TOOL_BUILD_DIR) $(TAR_OPTIONS) -
35 touch $(SED_DIR1)/.unpacked
36
37 $(SED_DIR1)/.configured: $(SED_DIR1)/.unpacked
38 (cd $(SED_DIR1); rm -rf config.cache; \
39 ./configure \
40 --prefix=$(STAGING_DIR) \
41 --prefix=/usr \
42 );
43 touch $(SED_DIR1)/.configured
44
45 $(SED_DIR1)/$(SED_BINARY): $(SED_DIR1)/.configured
46 $(MAKE) -C $(SED_DIR1)
47
48 # This stuff is needed to work around GNU make deficiencies
49 build-sed-host-binary: $(SED_DIR1)/$(SED_BINARY)
50 @if [ -L $(STAGING_DIR)/$(SED_TARGET_BINARY) ] ; then \
51 rm -f $(STAGING_DIR)/$(SED_TARGET_BINARY); fi;
52 @if [ ! -f $(STAGING_DIR)/$(SED_TARGET_BINARY) -o $(STAGING_DIR)/$(SED_TARGET_BINARY) \
53 -ot $(SED_DIR1)/$(SED_BINARY) ] ; then \
54 set -x; \
55 mkdir -p $(STAGING_DIR)/bin; \
56 $(MAKE) DESTDIR=$(STAGING_DIR) -C $(SED_DIR1) install; \
57 mv $(STAGING_DIR)/usr/bin/sed $(STAGING_DIR)/bin/; \
58 rm -rf $(STAGING_DIR)/share/locale $(STAGING_DIR)/usr/info \
59 $(STAGING_DIR)/usr/man $(STAGING_DIR)/usr/share/doc; fi
60
61 use-sed-host-binary:
62 @if [ -x /usr/bin/sed ]; then SED="/usr/bin/sed"; else \
63 if [ -x /bin/sed ]; then SED="/bin/sed"; fi; fi; \
64 mkdir -p $(STAGING_DIR)/bin; \
65 rm -f $(STAGING_DIR)/$(SED_TARGET_BINARY); \
66 ln -s $$SED $(STAGING_DIR)/$(SED_TARGET_BINARY)
67
68 source:
69 prepare:
70 compile:
71 install: $(HOST_SED_TARGET)
72 clean:
73 rm -rf $(SED_DIR1)
74 rm -f $(STAGING_DIR)/$(SED_TARGET_BINARY)
75
This page took 0.044131 seconds and 5 git commands to generate.