From 4e885757e8934ceb715c6092e9efd3a6ff395086 Mon Sep 17 00:00:00 2001 From: Bernhard Reutner-Fischer Date: Wed, 8 Oct 2008 14:05:03 +0000 Subject: - add/use variables to make build-tools configurable --- Makefile.in | 20 ++++++++++---------- Rules.mak | 12 ++++++++---- extra/locale/Makefile.in | 6 +++--- libc/Makefile.in | 2 +- 4 files changed, 22 insertions(+), 18 deletions(-) diff --git a/Makefile.in b/Makefile.in index 05a7d7cb8..b4e9e0d9e 100644 --- a/Makefile.in +++ b/Makefile.in @@ -360,13 +360,13 @@ install_dev: install_headers all -$(INSTALL) -m 644 lib/*.[ao] $(PREFIX)$(DEVEL_PREFIX)lib/ ifeq ($(HAVE_SHARED),y) for i in `find lib/ -type l -name 'lib[a-zA-Z]*.so' | \ - sed -e 's/lib\///'` ; do \ + $(SED) -e 's/lib\///'` ; do \ $(LN) -sf $(RUNTIME_PREFIX_LIB_FROM_DEVEL_PREFIX_LIB)$$i.$(MAJOR_VERSION) \ $(PREFIX)$(DEVEL_PREFIX)lib/$$i; \ done if [ -f $(top_builddir)lib/libc.so -a -f $(PREFIX)$(RUNTIME_PREFIX)lib/$(SHARED_MAJORNAME) ] ; then \ $(RM) $(PREFIX)$(DEVEL_PREFIX)lib/libc.so; \ - sed -e 's:$(NONSHARED_LIBNAME):$(DEVEL_PREFIX)lib/$(NONSHARED_LIBNAME):' \ + $(SED) -e 's:$(NONSHARED_LIBNAME):$(DEVEL_PREFIX)lib/$(NONSHARED_LIBNAME):' \ -e 's:$(SHARED_MAJORNAME):$(RUNTIME_PREFIX)lib/$(SHARED_MAJORNAME):' \ -e 's:$(UCLIBC_LDSO):$(RUNTIME_PREFIX)lib/$(UCLIBC_LDSO):' \ $(top_builddir)lib/libc.so > $(PREFIX)$(DEVEL_PREFIX)lib/libc.so; \ @@ -389,9 +389,9 @@ ifeq ($(DOPIC),y) # # If we build shared libraries then the static libs are PIC... # # Make _pic.a symlinks to make mklibs.py and similar tools happy. if [ -d lib ] ; then \ - for i in `find lib/ -type f -name 'lib*.a' | sed -e 's/lib\///'` ; do \ + for i in `find lib/ -type f -name 'lib*.a' | $(SED) -e 's/lib\///'` ; do \ $(LN) -sf $$i $(PREFIX)$(DEVEL_PREFIX)lib/`echo $$i \ - | sed -e 's/\.a$$/_pic.a/'`; \ + | $(SED) -e 's/\.a$$/_pic.a/'`; \ done ; \ fi endif @@ -400,7 +400,7 @@ ifeq ($(UCLIBC_FORMAT_SHARED_FLAT),y) for file in lib/lib*.gdb; do \ if test -f $$file; then \ $(INSTALL) -m 755 $$file $(PREFIX)$(DEVEL_PREFIX)lib; \ - $(INSTALL) -m 755 `echo $$file | sed 's/\.gdb$$//'` \ + $(INSTALL) -m 755 `echo $$file | $(SED) 's/\.gdb$$//'` \ $(PREFIX)$(DEVEL_PREFIX)lib; \ fi; \ done @@ -456,11 +456,11 @@ randconfig: extra/config/conf $(suspicious_dependency) allyesconfig: extra/config/conf $(suspicious_dependency) $(Q)./extra/config/conf -y extra/Configs/Config.in - sed -i -e "s/^DODEBUG=.*/# DODEBUG is not set/" .config - sed -i -e "s/^DOASSERTS=.*/# DOASSERTS is not set/" .config - sed -i -e "s/^SUPPORT_LD_DEBUG_EARLY=.*/# SUPPORT_LD_DEBUG_EARLY is not set/" .config - sed -i -e "s/^SUPPORT_LD_DEBUG=.*/# SUPPORT_LD_DEBUG is not set/" .config - sed -i -e "s/^UCLIBC_MJN3_ONLY=.*/# UCLIBC_MJN3_ONLY is not set/" .config + $(SED) -i -e "s/^DODEBUG=.*/# DODEBUG is not set/" .config + $(SED) -i -e "s/^DOASSERTS=.*/# DOASSERTS is not set/" .config + $(SED) -i -e "s/^SUPPORT_LD_DEBUG_EARLY=.*/# SUPPORT_LD_DEBUG_EARLY is not set/" .config + $(SED) -i -e "s/^SUPPORT_LD_DEBUG=.*/# SUPPORT_LD_DEBUG is not set/" .config + $(SED) -i -e "s/^UCLIBC_MJN3_ONLY=.*/# UCLIBC_MJN3_ONLY is not set/" .config $(Q)./extra/config/conf -o extra/Configs/Config.in allnoconfig: extra/config/conf $(suspicious_dependency) diff --git a/Rules.mak b/Rules.mak index 44be75c39..030959593 100644 --- a/Rules.mak +++ b/Rules.mak @@ -41,6 +41,8 @@ INSTALL = install LN = ln RM = rm -f TAR = tar +SED = sed +AWK = awk STRIP_FLAGS ?= -x -R .note -R .comment @@ -49,8 +51,10 @@ UNIFDEF := $(top_builddir)extra/scripts/unifdef -UUCLIBC_INTERNAL # Select the compiler needed to build binaries for your development system HOSTCC = gcc BUILD_CFLAGS = -O2 -Wall -export ARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun.*/sparc/ -e s/sparc.*/sparc/ \ - -e s/arm.*/arm/ -e s/sa110/arm/ -e s/sh.*/sh/ \ +export ARCH := $(shell uname -m | $(SED) -e s/i.86/i386/ \ + -e s/sun.*/sparc/ -e s/sparc.*/sparc/ \ + -e s/arm.*/arm/ -e s/sa110/arm/ \ + -e s/sh.*/sh/ \ -e s/s390x/s390/ -e s/parisc.*/hppa/ \ -e s/ppc.*/powerpc/ -e s/mips.*/mips/ \ -e s/xtensa.*/xtensa/ ) @@ -67,9 +71,9 @@ ifeq ($(filter $(noconfig_targets),$(MAKECMDGOALS)),) endif # Make certain these contain a final "/", but no "//"s. -TARGET_ARCH:=$(shell grep -s '^TARGET_ARCH' $(top_builddir)/.config | sed -e 's/^TARGET_ARCH=//' -e 's/"//g') +TARGET_ARCH:=$(shell grep -s '^TARGET_ARCH' $(top_builddir)/.config | $(SED) -e 's/^TARGET_ARCH=//' -e 's/"//g') TARGET_ARCH:=$(strip $(subst ",, $(strip $(TARGET_ARCH)))) -TARGET_SUBARCH:=$(shell grep -s '^TARGET_SUBARCH' $(top_builddir)/.config | sed -e 's/^TARGET_SUBARCH=//' -e 's/"//g') +TARGET_SUBARCH:=$(shell grep -s '^TARGET_SUBARCH' $(top_builddir)/.config | $(SED) -e 's/^TARGET_SUBARCH=//' -e 's/"//g') TARGET_SUBARCH:=$(strip $(subst ",, $(strip $(TARGET_SUBARCH)))) RUNTIME_PREFIX:=$(strip $(subst //,/, $(subst ,/, $(subst ",, $(strip $(RUNTIME_PREFIX)))))) DEVEL_PREFIX:=$(strip $(subst //,/, $(subst ,/, $(subst ",, $(strip $(DEVEL_PREFIX)))))) diff --git a/extra/locale/Makefile.in b/extra/locale/Makefile.in index faea8c0d5..b83a0a290 100644 --- a/extra/locale/Makefile.in +++ b/extra/locale/Makefile.in @@ -138,7 +138,7 @@ $(locale_OUT)/lt_defines.h: $(locale_OUT)/locale_tables.h $(locale_OUT)/locale_c grep "^#define __lc" $(word 2,$^) >> $@ $(locale_OUT)/locale_collate.h: $(locale_OUT)/gen_collate $(locale_OUT)/locale_tables.h - grep COL_IDX_ $(word 2,$^) | sed -e "s/^.*COL_IDX_\([^, ]*\).*$$/\1/" | \ + grep COL_IDX_ $(word 2,$^) | $(SED) -e "s/^.*COL_IDX_\([^, ]*\).*$$/\1/" | \ sort | uniq | xargs $< $(locale_OUT)/$(LOCALE_DATA_FILENAME): @@ -149,7 +149,7 @@ endif ifeq ($(UCLIBC_PREGENERATED_LOCALE_DATA),y) $(locale_SRC): $(locale_OUT)/$(LOCALE_DATA_FILENAME) - zcat $< | tar -xv -C $(dir $@) -f - + zcat $< | $(TAR) -xv -C $(dir $@) -f - touch $@ # we use the one in locale_DIR #$(RM) $(locale_OUT)/locale_mmap.h @@ -170,7 +170,7 @@ $(locale_OUT)/uClibc_locale_data.h: $(locale_OUT)/lt_defines.h $(locale_OUT)/c8t endif $(top_builddir)include/bits/uClibc_locale_data.h: $(locale_OUT)/uClibc_locale_data.h | $(top_builddir)include/bits/uClibc_config.h - cat $< | awk 'BEGIN{i=1}{ if ( /WANT_/ ) i = /endif/ ; else if (i) print $0 }' > $@ + cat $< | $(AWK) 'BEGIN{i=1}{ if ( /WANT_/ ) i = /endif/ ; else if (i) print $0 }' > $@ objclean-y += locale_clean diff --git a/libc/Makefile.in b/libc/Makefile.in index be5046da8..8928ba381 100644 --- a/libc/Makefile.in +++ b/libc/Makefile.in @@ -54,7 +54,7 @@ lib-gdb-y += $(top_builddir)lib/libc.gdb lib-so-y += $(libc.depend) objclean-y += libc_clean -OUTPUT_FORMAT = $(CC) $(CFLAGS) -Wl,--verbose 2>&1 | sed -n 's/^OUTPUT_FORMAT("\([^"]*\)",.*/OUTPUT_FORMAT ( \1 )/p' +OUTPUT_FORMAT = $(CC) $(CFLAGS) -Wl,--verbose 2>&1 | $(SED) -n 's/^OUTPUT_FORMAT("\([^"]*\)",.*/OUTPUT_FORMAT ( \1 )/p' ifeq ($(DOMULTI),n) $(libc.depend): $(libc_OUT)/libc_so.a $(LIBS-libc.so) -- cgit v1.2.3