1 #############################################################
5 #############################################################
6 SED_SOURCE
:=sed-4.0
.8.
tar.gz
7 SED_SITE
:=ftp
://ftp.gnu.org
/gnu
/sed
9 SED_DIR1
:=$(TOOL_BUILD_DIR
)/sed-4.0
.8
10 SED_DIR2
:=$(BUILD_DIR
)/sed-4.0
.8
12 SED_TARGET_BINARY
:=bin
/sed
13 ifeq ($(strip $(BUILD_WITH_LARGEFILE
)),true
)
14 SED_CPPFLAGS
=-D_FILE_OFFSET_BITS
=64
16 SED
:=$(STAGING_DIR
)/bin
/sed
-i
-e
18 HOST_SED_TARGET
=$(shell .
/sources
/sedcheck.sh
)
20 $(DL_DIR
)/$(SED_SOURCE
):
21 $(WGET
) -P
$(DL_DIR
) $(SED_SITE
)/$(SED_SOURCE
)
23 sed-source
: $(DL_DIR
)/$(SED_SOURCE
)
26 #############################################################
28 # build sed for use on the host system
30 #############################################################
31 $(SED_DIR1
)/.unpacked
: $(DL_DIR
)/$(SED_SOURCE
)
32 mkdir
-p
$(TOOL_BUILD_DIR
)
34 mkdir
-p
$(STAGING_DIR
)/bin
;
35 $(SED_CAT
) $(DL_DIR
)/$(SED_SOURCE
) |
tar -C
$(TOOL_BUILD_DIR
) -xvf
-
36 touch
$(SED_DIR1
)/.unpacked
38 $(SED_DIR1
)/.configured
: $(SED_DIR1
)/.unpacked
39 (cd
$(SED_DIR1
); rm -rf config.cache
; \
41 --prefix=$(STAGING_DIR
) \
44 touch
$(SED_DIR1
)/.configured
46 $(SED_DIR1
)/$(SED_BINARY
): $(SED_DIR1
)/.configured
47 $(MAKE
) -C
$(SED_DIR1
)
49 # This stuff is needed to work around GNU make deficiencies
50 build-sed-host-binary
: $(SED_DIR1
)/$(SED_BINARY
)
51 @if
[ -L
$(STAGING_DIR
)/$(SED_TARGET_BINARY
) ] ; then \
52 rm -f
$(STAGING_DIR
)/$(SED_TARGET_BINARY
); fi
;
53 @if
[ ! -f
$(STAGING_DIR
)/$(SED_TARGET_BINARY
) -o
$(STAGING_DIR
)/$(SED_TARGET_BINARY
) \
54 -ot
$(SED_DIR1
)/$(SED_BINARY
) ] ; then \
56 mkdir
-p
$(STAGING_DIR
)/bin
; \
57 $(MAKE
) DESTDIR
=$(STAGING_DIR
) -C
$(SED_DIR1
) install; \
58 mv
$(STAGING_DIR
)/usr
/bin
/sed
$(STAGING_DIR
)/bin
/; \
59 rm -rf
$(STAGING_DIR
)/share
/locale
$(STAGING_DIR
)/usr
/info \
60 $(STAGING_DIR
)/usr
/man
$(STAGING_DIR
)/usr
/share
/doc
; fi
63 @if
[ -x
/usr
/bin
/sed
]; then SED
="/usr/bin/sed"; else \
64 if
[ -x
/bin
/sed
]; then SED
="/bin/sed"; fi
; fi
; \
65 mkdir
-p
$(STAGING_DIR
)/bin
; \
66 rm -f
$(STAGING_DIR
)/$(SED_TARGET_BINARY
); \
67 ln
-s
$$SED $(STAGING_DIR
)/$(SED_TARGET_BINARY
)
69 host-sed
: $(HOST_SED_TARGET
)
72 $(MAKE
) DESTDIR
=$(STAGING_DIR
) -C
$(SED_DIR1
) uninstall
73 -$(MAKE
) -C
$(SED_DIR1
) clean
79 #############################################################
81 # build sed for use on the target system
83 #############################################################
84 $(SED_DIR2
)/.unpacked
: $(DL_DIR
)/$(SED_SOURCE
)
85 $(SED_CAT
) $(DL_DIR
)/$(SED_SOURCE
) |
tar -C
$(BUILD_DIR
) -xvf
-
86 touch
$(SED_DIR2
)/.unpacked
88 $(SED_DIR2
)/.configured
: $(SED_DIR2
)/.unpacked
89 (cd
$(SED_DIR2
); rm -rf config.cache
; \
90 $(TARGET_CONFIGURE_OPTS
) \
91 CFLAGS
="$(TARGET_CFLAGS)" \
92 CPPFLAGS
="$(SED_CFLAGS)" \
94 --target
=$(GNU_TARGET_NAME
) \
95 --host
=$(GNU_TARGET_NAME
) \
96 --build
=$(GNU_HOST_NAME
) \
100 --sbindir
=/usr
/sbin \
101 --libexecdir
=/usr
/lib \
103 --datadir=/usr
/share \
104 --localstatedir
=/var \
106 --infodir=/usr
/info \
109 touch
$(SED_DIR2
)/.configured
111 $(SED_DIR2
)/$(SED_BINARY
): $(SED_DIR2
)/.configured
112 $(MAKE
) CC
=$(TARGET_CC
) -C
$(SED_DIR2
)
114 # This stuff is needed to work around GNU make deficiencies
115 sed-target_binary
: $(SED_DIR2
)/$(SED_BINARY
)
116 @if
[ -L
$(TARGET_DIR
)/$(SED_TARGET_BINARY
) ] ; then \
117 rm -f
$(TARGET_DIR
)/$(SED_TARGET_BINARY
); fi
;
119 @if
[ ! -f
$(SED_DIR2
)/$(SED_BINARY
) -o
$(TARGET_DIR
)/$(SED_TARGET_BINARY
) \
120 -ot
$(SED_DIR2
)/$(SED_BINARY
) ] ; then \
122 $(MAKE
) DESTDIR
=$(TARGET_DIR
) CC
=$(TARGET_CC
) -C
$(SED_DIR2
) install; \
123 mv
$(TARGET_DIR
)/usr
/bin
/sed
$(TARGET_DIR
)/bin
/; \
124 rm -rf
$(TARGET_DIR
)/share
/locale
$(TARGET_DIR
)/usr
/info \
125 $(TARGET_DIR
)/usr
/man
$(TARGET_DIR
)/usr
/share
/doc
; fi
127 sed
: uclibc sed-target_binary
130 $(MAKE
) DESTDIR
=$(TARGET_DIR
) CC
=$(TARGET_CC
) -C
$(SED_DIR2
) uninstall
131 -$(MAKE
) -C
$(SED_DIR2
) clean
This page took 0.048172 seconds and 5 git commands to generate.