1 #############################################################
5 #############################################################
7 SED_SOURCE
:=sed-
$(SED_VER
).
tar.gz
8 SED_SITE
:=ftp
://ftp.gnu.org
/gnu
/sed
10 SED_DIR1
:=$(TOOL_BUILD_DIR
)/sed-
$(SED_VER
)
11 SED_DIR2
:=$(BUILD_DIR
)/sed-
$(SED_VER
)
13 SED_TARGET_BINARY
:=bin
/sed
14 ifeq ($(strip $(BUILD_WITH_LARGEFILE
)),true
)
15 SED_CPPFLAGS
=-D_FILE_OFFSET_BITS
=64
17 SED
:=$(STAGING_DIR
)/bin
/sed
-i
-e
18 HOST_SED_TARGET
=$(shell package
/sed
/sedcheck.sh
)
20 $(DL_DIR
)/$(SED_SOURCE
):
22 $(WGET
) -P
$(DL_DIR
) $(SED_SITE
)/$(SED_SOURCE
)
24 sed-source
: $(DL_DIR
)/$(SED_SOURCE
)
27 #############################################################
29 # build sed for use on the host system
31 #############################################################
32 $(SED_DIR1
)/.unpacked
: $(DL_DIR
)/$(SED_SOURCE
)
33 mkdir
-p
$(TOOL_BUILD_DIR
)
34 mkdir
-p
$(STAGING_DIR
)/bin
;
35 $(SED_CAT
) $(DL_DIR
)/$(SED_SOURCE
) |
tar -C
$(TOOL_BUILD_DIR
) $(TAR_OPTIONS
) -
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
) $(TAR_OPTIONS
) -
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.048533 seconds and 5 git commands to generate.