source: freewrt/tools/sed/Makefile@ 131a9d7

freewrt_1_0 freewrt_2_0
Last change on this file since 131a9d7 was 131a9d7, checked in by Waldemar Brodkorb <wbx@…>, 19 years ago

move tools like sed, trx, lzma, which does not belong to the toolchain (gcc,binutils,gdb,libc) to a separate directory, all stuff is compiled with the host compiler

git-svn-id: svn://www.freewrt.org/trunk/freewrt@194 afb5a338-a214-0410-bd46-81f09a774fd1

  • Property mode set to 100644
File size: 2.0 KB
Line 
1# $FreeWRT$
2
3include $(TOPDIR)/rules.mk
4
5SED_VER:=4.1.2
6SED_SOURCE:=sed-$(SED_VER).tar.gz
7SED_SITE:=ftp://ftp.gnu.org/gnu/sed
8SED_MD5SUM:=928f0e06422f414091917401f1a834d0
9
10SED_CAT:=zcat
11SED_DIR:=$(TOOLCHAIN_BUILD_DIR)/sed-$(SED_VER)
12SED_BINARY:=sed/sed
13SED_TARGET_BINARY:=bin/sed
14SED_CPPFLAGS=-D_FILE_OFFSET_BITS=64
15HOST_SED_TARGET=$(shell ./sedcheck.sh)
16
17$(DL_DIR)/$(SED_SOURCE):
18 mkdir -p $(DL_DIR)
19 $(SCRIPT_DIR)/download.pl $(DL_DIR) $(SED_SOURCE) $(SED_MD5SUM) $(SED_SITE)
20
21$(SED_DIR)/.unpacked: $(DL_DIR)/$(SED_SOURCE)
22 mkdir -p $(TOOLCHAIN_BUILD_DIR)
23 mkdir -p $(STAGING_DIR)/bin;
24 $(SED_CAT) $(DL_DIR)/$(SED_SOURCE) | (cd $(TOOLCHAIN_BUILD_DIR); $(TAR_EXTRACT) )
25 touch $@
26
27$(SED_DIR)/.configured: $(SED_DIR)/.unpacked
28 (cd $(SED_DIR); rm -rf config.cache; \
29 ac_cv_header_wctype_h=no \
30 ./configure \
31 --disable-nls \
32 --prefix=$(STAGING_DIR) \
33 --prefix=/usr \
34 );
35 touch $@
36
37$(SED_DIR)/$(SED_BINARY): $(SED_DIR)/.configured
38 $(MAKE) -C $(SED_DIR)
39
40# This stuff is needed to work around GNU make deficiencies
41build-sed-host-binary: $(SED_DIR)/$(SED_BINARY)
42 @if [ -L $(STAGING_DIR)/$(SED_TARGET_BINARY) ] ; then \
43 rm -f $(STAGING_DIR)/$(SED_TARGET_BINARY); fi;
44 @if [ ! -f $(STAGING_DIR)/$(SED_TARGET_BINARY) -o $(STAGING_DIR)/$(SED_TARGET_BINARY) \
45 -ot $(SED_DIR)/$(SED_BINARY) ] ; then \
46 set -x; \
47 mkdir -p $(STAGING_DIR)/bin; \
48 $(MAKE) DESTDIR=$(STAGING_DIR) -C $(SED_DIR) install; \
49 mv $(STAGING_DIR)/usr/bin/sed $(STAGING_DIR)/bin/; \
50 rm -rf $(STAGING_DIR)/share/locale $(STAGING_DIR)/usr/info \
51 $(STAGING_DIR)/usr/man $(STAGING_DIR)/usr/share/doc; fi
52 @ln -sf $(STAGING_DIR)/$(SED_TARGET_BINARY) $(TOPDIR)/lbin/sed
53
54use-sed-host-binary:
55 @if [ -x /usr/bin/sed ]; then SED="/usr/bin/sed"; else \
56 if [ -x /bin/sed ]; then SED="/bin/sed"; fi; fi; \
57 mkdir -p $(STAGING_DIR)/bin; \
58 rm -f $(STAGING_DIR)/$(SED_TARGET_BINARY); \
59 ln -s $$SED $(STAGING_DIR)/$(SED_TARGET_BINARY)
60
61source:
62prepare:
63compile:
64install: $(HOST_SED_TARGET)
65clean:
66 rm -rf $(SED_DIR)
67 rm -f $(STAGING_DIR)/$(SED_TARGET_BINARY)
68
Note: See TracBrowser for help on using the repository browser.