1 include $(TOPDIR
)/rules.mk
3 #############################################################
7 #############################################################
9 SED_SOURCE
:=sed-
$(SED_VER
).
tar.gz
10 SED_SITE
:=ftp
://ftp.gnu.org
/gnu
/sed
12 SED_DIR1
:=$(TOOL_BUILD_DIR
)/sed-
$(SED_VER
)
13 SED_DIR2
:=$(BUILD_DIR
)/sed-
$(SED_VER
)
15 SED_TARGET_BINARY
:=bin
/sed
16 SED_MD5SUM
:=928f0e06422f414091917401f1a834d0
17 ifeq ($(strip $(BUILD_WITH_LARGEFILE
)),true
)
18 SED_CPPFLAGS
=-D_FILE_OFFSET_BITS
=64
20 HOST_SED_TARGET
=$(shell .
/sedcheck.sh
)
21 DOWNLOAD_TARGET
=$(shell .
/sedcheck.sh
)
23 $(DL_DIR
)/$(SED_SOURCE
):
25 $(SCRIPT_DIR
)/download.pl
$(DL_DIR
) $(SED_SOURCE
) $(SED_MD5SUM
) $(SED_SITE
)
27 #############################################################
29 # build sed for use on the host system
31 #############################################################
33 $(SED_DIR1
)/.unpacked
: $(DL_DIR
)/$(SED_SOURCE
)
34 mkdir
-p
$(TOOL_BUILD_DIR
)
35 mkdir
-p
$(STAGING_DIR
)/bin
;
36 $(SED_CAT
) $(DL_DIR
)/$(SED_SOURCE
) |
tar -C
$(TOOL_BUILD_DIR
) $(TAR_OPTIONS
) -
37 touch
$(SED_DIR1
)/.unpacked
39 $(SED_DIR1
)/.configured
: $(SED_DIR1
)/.unpacked
40 (cd
$(SED_DIR1
); rm -rf config.cache
; \
42 --prefix=$(STAGING_DIR
) \
45 touch
$(SED_DIR1
)/.configured
47 $(SED_DIR1
)/$(SED_BINARY
): $(SED_DIR1
)/.configured
48 $(MAKE
) -C
$(SED_DIR1
)
50 # This stuff is needed to work around GNU make deficiencies
51 build-sed-host-binary
: $(SED_DIR1
)/$(SED_BINARY
) FORCE
52 @if
[ -L
$(STAGING_DIR
)/$(SED_TARGET_BINARY
) ] ; then \
53 rm -f
$(STAGING_DIR
)/$(SED_TARGET_BINARY
); fi
;
54 @if
[ ! -f
$(STAGING_DIR
)/$(SED_TARGET_BINARY
) -o
$(STAGING_DIR
)/$(SED_TARGET_BINARY
) \
55 -ot
$(SED_DIR1
)/$(SED_BINARY
) ] ; then \
57 mkdir
-p
$(STAGING_DIR
)/bin
; \
58 $(MAKE
) DESTDIR
=$(STAGING_DIR
) -C
$(SED_DIR1
) install; \
59 mv
$(STAGING_DIR
)/usr
/bin
/sed
$(STAGING_DIR
)/bin
/; \
60 rm -rf
$(STAGING_DIR
)/share
/locale
$(STAGING_DIR
)/usr
/info \
61 $(STAGING_DIR
)/usr
/man
$(STAGING_DIR
)/usr
/share
/doc
; fi
63 use-sed-host-binary
: FORCE
64 @if
[ -x
/usr
/bin
/sed
]; then SED
="/usr/bin/sed"; else \
65 if
[ -x
/bin
/sed
]; then SED
="/bin/sed"; fi
; fi
; \
66 mkdir
-p
$(STAGING_DIR
)/bin
; \
67 rm -f
$(STAGING_DIR
)/$(SED_TARGET_BINARY
); \
68 ln
-s
$$SED $(STAGING_DIR
)/$(SED_TARGET_BINARY
)
70 download-sed-binary
: sed-
$(SED_VER
).
tar.gz
72 source
: $(DOWNLOAD_TARGET
)
75 install: $(HOST_SED_TARGET
)
78 rm -f
$(STAGING_DIR
)/$(SED_TARGET_BINARY
)