MAKERULES_DIR := $(abspath $(dir $(filter %Makefile.rules,$(MAKEFILE_LIST))))
endif
+# The $(SED4OMK) command for BSD based systems requires -E option to allow
+# extended regular expressions
+
+SED4OMK ?= sed
+ifneq ($(shell ( echo A | $(SED4OMK) -n -e 's/A\|B/y/p' )),y)
+ SED4OMK := $(SED4OMK) -E
+ ifneq ($(shell ( echo A | $(SED4OMK) -n -e 's/A\|B/y/p' )),y)
+ SED4OMK := gsed
+ endif
+ ifneq ($(shell ( echo A | $(SED4OMK) -n -e 's/A\|B/y/p' )),y)
+ SED4OMK := gsed -E
+ endif
+ ifneq ($(shell ( echo A | $(SED4OMK) -n -e 's/A\|B/y/p' )),y)
+ $(error No SED program suitable for OMK found)
+ endif
+endif
+
# OUTPUT_DIR is the place where _compiled, _build and possible other
# files/directories are created. By default is the same as
# $(MAKERULES_DIR).
CONFIG_FILES ?= $(wildcard $(CONFIG_FILE)-default) $(wildcard $(OUTPUT_DIR)/config.target) $(wildcard $(CONFIG_FILE))
-export SOURCES_DIR MAKERULES_DIR RELATIVE_DIR INVOCATION_DIR
+export SED4OMK SOURCES_DIR MAKERULES_DIR RELATIVE_DIR INVOCATION_DIR
export CONFIG_FILE CONFIG_FILES OMK_SERIALIZE_INCLUDED OMK_VERBOSE OMK_SILENT
# OMK_SERIALIZE_INCLUDED has to be exported to submakes because passes
# must to be serialized only in the toplevel make.
override RELATIVE_DIR := $(RELATIVE_DIR:/%=%)
override RELATIVE_DIR := $(RELATIVE_DIR:\\%=%)
#$(warning RELATIVE_DIR = "$(RELATIVE_DIR)")
-#override BACK2TOP_DIR := $(shell echo $(RELATIVE_DIR)/ | sed -e 's_//_/_g' -e 's_/\./_/_g' -e 's_^\./__g' -e 's_\([^/][^/]*\)_.._g' -e 's_/$$__')
+#override BACK2TOP_DIR := $(shell echo $(RELATIVE_DIR)/ | $(SED4OMK) -e 's_//_/_g' -e 's_/\./_/_g' -e 's_^\./__g' -e 's_\([^/][^/]*\)_.._g' -e 's_/$$__')
#$(warning BACK2TOP_DIR = "$(BACK2TOP_DIR)")
#$(warning SOURCES_DIR = "$(SOURCES_DIR)")
@echo 'Use "make V=1" to see the verbose compile lines.'
check-make-ver:
- @GOOD_MAKE_VERSION=`echo $(MAKE_VERSION) | sed -n -e 's/^[4-9]\..*\|^3\.9[0-9].*\|^3\.8[1-9].*/y/p'` ; \
+ @GOOD_MAKE_VERSION=`echo $(MAKE_VERSION) | $(SED4OMK) -n -e 's/^[4-9]\..*\|^3\.9[0-9].*\|^3\.8[1-9].*/y/p'` ; \
if [ x$$GOOD_MAKE_VERSION != xy ] ; then \
echo "Your make program version is too old and does not support OMK system." ; \
echo "Please update to make program 3.81beta1 or newer." ; exit 1 ; \
# @echo Default config for $(RELATIVE_DIR)
@echo "# Config for $(RELATIVE_DIR)" >> "$(CONFIG_FILE)-default"
@$(foreach x, $(default_CONFIG), echo '$(x)' | \
- sed -e 's/^[^=]*=x$$/#\0/' >> "$(CONFIG_FILE)-default" ; )
+ $(SED4OMK) -e 's/^[^=]*=x$$/#\0/' >> "$(CONFIG_FILE)-default" ; )
omkize:
$(if $(DOXYGEN),@echo "/** @file */" >> "$(2).tmp")
@echo "#ifndef $(4)" >> "$(2).tmp"
@echo "#define $(4)" >> "$(2).tmp"
- @( $(foreach x, $(shell echo '$($(3))' | tr 'x\t ' 'x\n\n' | sed -e 's/^\([^ =]*\)\(=[^ ]\+\|\)$$/\1/' ), \
+ @( $(foreach x, $(shell echo '$($(3))' | tr 'x\t ' 'x\n\n' | $(SED4OMK) -e 's/^\([^ =]*\)\(=[^ ]\+\|\)$$/\1/' ), \
echo '$(x).$($(x))' ; ) echo ; ) | \
- sed -e '/^[^.]*\.n$$$$/d' -e '/^[^.]*\.$$$$/d' -e 's/^\([^.]*\)\.[ym]$$$$/\1.1/' | \
- sed -n -e 's/^\([^.]*\)\.\(.*\)$$$$/#define \1 \2/p' \
+ $(SED4OMK) -e '/^[^.]*\.n$$$$/d' -e '/^[^.]*\.$$$$/d' -e 's/^\([^.]*\)\.[ym]$$$$/\1.1/' | \
+ $(SED4OMK) -n -e 's/^\([^.]*\)\.\(.*\)$$$$/#define \1 \2/p' \
>> "$(2).tmp"
@echo "#endif /*$(4)*/" >> "$(2).tmp"
@touch "$$@"
# Check GCC version for user build
ifndef CC_MAJOR_VERSION
-CC_MAJOR_VERSION = $$(shell $$(CC) -dumpversion | sed -e 's/\([^.]\)\..*/\1/')
+CC_MAJOR_VERSION = $$(shell $$(CC) -dumpversion | $(SED4OMK) -e 's/\([^.]\)\..*/\1/')
endif
# Prepare suitable define for dependency building
ifeq ($$(CC_MAJOR_VERSION),2)
# Bellow, the tricks with redirection are for shells without set -o pipefail
# (see http://www.mail-archive.com/dash@vger.kernel.org/msg00149.html)
$(Q)exec 3>&1; status=`exec 4>&1 >&3; { $(NM) $$<; echo $$$$? >&4; }\
- | sed -n 's/^ *0*\(0[0-9A-Fa-f]*\) *A *_cmetric2cond_\([A-Za-z_0-9]*\) */#define \2 0x\1/p' \
+ | $(SED4OMK) -n 's/^ *0*\(0[0-9A-Fa-f]*\) *A *_cmetric2cond_\([A-Za-z_0-9]*\) */#define \2 0x\1/p' \
| sort >>$$@.tmp` && exit $$$$status
$(Q)echo >>$$@.tmp '/* Defines from the values defined to symbols in hexadecimal format */'
$(Q)exec 3>&1; status=`exec 4>&1 >&3; { $(NM) $$<; echo $$$$? >&4; }\
- | sed -n 's/^ *0*\(0[0-9A-Fa-f]*\) *A *_cmetric2def_\([A-Za-z_0-9]*\) */#define \2 0x\1/p' \
+ | $(SED4OMK) -n 's/^ *0*\(0[0-9A-Fa-f]*\) *A *_cmetric2def_\([A-Za-z_0-9]*\) */#define \2 0x\1/p' \
| sort >>$$@.tmp` && exit $$$$status
$(Q)echo >>$$@.tmp '/* Defines from the values defined to symbols in decimal format */'
$(Q)exec 3>&1; status=`exec 4>&1 >&3; { $(NM) -td $$<; echo $$$$? >&4; }\
- | sed -n 's/^ *0*\(0\|[1-9][0-9]*\) *A *_cmetric2defdec_\([A-Za-z_0-9]*\) */#define \2 \1/p' \
+ | $(SED4OMK) -n 's/^ *0*\(0\|[1-9][0-9]*\) *A *_cmetric2defdec_\([A-Za-z_0-9]*\) */#define \2 \1/p' \
| sort >>$$@.tmp` && exit $$$$status
$(Q)mv $$@.tmp $$@
endef
@echo "$(2)/$(1)$(3:%=-%): \\" >$(OBJS_DIR)/$(1)$(3:%=-%).exe.d
@if [ -n "$(LD_SCRIPT)" ]; then \
echo " $(LIB_DIR)/$(LD_SCRIPT).ld$(3:%=-%) \\" >>$(OBJS_DIR)/$(1)$(3:%=-%).exe.d; fi
- @sed -n -e 's|^LOAD \(.*\)$$$$| \1 \&|p' $(OBJS_DIR)/$(1)$(3:%=-%).map|tr '&' '\134' >>$(OBJS_DIR)/$(1)$(3:%=-%).exe.d
+ @$(SED4OMK) -n -e 's|^LOAD \(.*\)$$$$| \1 \&|p' $(OBJS_DIR)/$(1)$(3:%=-%).map|tr '&' '\134' >>$(OBJS_DIR)/$(1)$(3:%=-%).exe.d
@echo >>$(OBJS_DIR)/$(1).exe.d
endef
$(Q)rm -f $(USER_OBJS_DIR)/*.obj $(USER_OBJS_DIR)/*.lst
-FILTER_KEIL_OUTPUT = | sed -e '/COPYRIGHT KEIL/d' -e '/^[ \r\t]*$$$$/d'
+FILTER_KEIL_OUTPUT = | $(SED4OMK) -e '/COPYRIGHT KEIL/d' -e '/^[ \r\t]*$$$$/d'
FILTER_KEIL_CC_OUTPUT = $(FILTER_KEIL_OUTPUT) -e '/C166 COMPIL/d'
FILTER_KEIL_LINKER_OUTPUT = $(FILTER_KEIL_OUTPUT) -e '/L166 LINKER/d' -e '/^".*",\?\r$$$$/,/\(L166 RUN COMPLETE\|ERROR\)/d'
FILTER_KEIL_LIB_OUTPUT = $(FILTER_KEIL_OUTPUT) -e '/LIB166 LIBRARY/d'
ifndef DEFAULT_INCLUDES
override DEFAULT_INCLUDES = $$(INCLUDES) -I $$(INCLUDE_DIR) -I $$(SOURCES_DIR) \
- $$(shell echo $$$${C166INC} | sed -e 's/;/ -I /g' -e 's/^\(.\)/-I \1/')
+ $$(shell echo $$$${C166INC} | $(SED4OMK) -e 's/;/ -I /g' -e 's/^\(.\)/-I \1/')
endif
#$$(warning DEFAULT_INCLUDES = $$(DEFAULT_INCLUDES))
$(2): $(1) $$(GEN_HEADERS)
@$(QUIET_CMD_ECHO) " CC $$@"
# Export include paths in an environment variable
- $(Q)export C166INC=`echo '$$(shell cygpath -w $$(subst -I,,$$(DEFAULT_INCLUDES)))'|sed -e "s/ \+/;/g"`; \
+ $(Q)export C166INC=`echo '$$(shell cygpath -w $$(subst -I,,$$(DEFAULT_INCLUDES)))'|$(SED4OMK) -e "s/ \+/;/g"`; \
$$(c_o_COMPILE) $(3) '$$(shell cygpath -w $$<)' 'OBJECT($$@)' 'PRINT($$(@:%$$(OBJ_EXT)=%.lst))' '$$(CCDIRECTIVES)' $(FILTER_KEIL_CC_OUTPUT); \
EL=$$$$?; if [ $$$$EL -le 1 ] ; then touch "$$@.d" ; \
else echo ERRORLEVEL $$$$EL ; exit 1; \
$$(lib_LOADLIBES:%=$$(USER_LIB_DIR)/%$$(LIB_EXT)) \
$$($(1)_LIBS:%=$$(USER_LIB_DIR)/%$$(LIB_EXT)) \
$$(STARTUP_CODE:%=$$(USER_LIB_DIR)/%)\
- | sed -e 's/\(.*\)/"\1"/' -e '$$$$! s/$$$$/,/' > $(1).lnp; \
+ | $(SED4OMK) -e 's/\(.*\)/"\1"/' -e '$$$$! s/$$$$/,/' > $(1).lnp; \
echo TO '$$(shell cygpath -w $$@)' >> $(1).lnp; \
echo '$$(LIDIRECTIVES)' >> $(1).lnp; \
if [[ "$$(LIN_FILE)" ]]; then cat $$(USER_LIB_DIR)/$$(LIN_FILE) >> $(1).lnp; fi; \
$(2): $(1) $$(GEN_HEADERS)
@$(QUIET_CMD_ECHO) " CC $$@"
$(Q) cp $$< .;\
- export C51INC=`echo "$$(DEFAULT_INCLUDES)" | sed -e 's/-I//' -e 's/-I/;/g' -e 's/ //g'`;\
+ export C51INC=`echo "$$(DEFAULT_INCLUDES)" | $(SED4OMK) -e 's/-I//' -e 's/-I/;/g' -e 's/ //g'`;\
$$(c_o_COMPILE) $(3) `basename $$< ` SRC ; \
if [ $$$$? -le 1 ] ; \
then if a51 `basename $$< .c`.src ; \
$(2): $(1) $$(GEN_HEADERS)
@$(QUIET_CMD_ECHO) " CC $$@"
$(Q) cp $$< .;\
- export C51INC=`echo "$$(DEFAULT_INCLUDES)" | sed -e 's/-I//' -e 's/-I/;/g' -e 's/ //g'`;\
+ export C51INC=`echo "$$(DEFAULT_INCLUDES)" | $(SED4OMK) -e 's/-I//' -e 's/-I/;/g' -e 's/ //g'`;\
$$(c_o_COMPILE) $(3) `basename $$< ` SRC ; \
if [ $$$$? -le 1 ] ; \
then if a51 `basename $$< .c`.src ; \
$(Q) \
export C51LIB="$${C51LIB};$(USER_LIB_DIR)"; \
export LI_FILES="$$($(1)_OBJS) $$(lib_LOADLIBES:%=%$$(LIB_EXT))"; \
- export LI_FILES="`echo "$$$${LI_FILES}" | sed -e 's/\(.\) \(.\)/\1,\2/g'`";\
+ export LI_FILES="`echo "$$$${LI_FILES}" | $(SED4OMK) -e 's/\(.\) \(.\)/\1,\2/g'`";\
$$(LI) $$$${LI_FILES}
endef
# Check GCC version for user build
ifndef CC_MAJOR_VERSION
-CC_MAJOR_VERSION := $(shell $(CC) -dumpversion | sed -e 's/\([^.]\)\..*/\1/')
+CC_MAJOR_VERSION := $(shell $(CC) -dumpversion | $(SED4OMK) -e 's/\([^.]\)\..*/\1/')
endif
# Prepare suitable define for dependency building
ifeq ($(CC_MAJOR_VERSION),2)
# Bellow, the tricks with redirection are for shells without set -o pipefail
# (see http://www.mail-archive.com/dash@vger.kernel.org/msg00149.html)
$(Q)exec 3>&1; status=`exec 4>&1 >&3; { $(NM) $$<; echo $$$$? >&4; }\
- | sed -n 's/^ *0*\(0[0-9A-Fa-f]*\) *A *_cmetric2cond_\([A-Za-z_0-9]*\) */#define \2 0x\1/p' \
+ | $(SED4OMK) -n 's/^ *0*\(0[0-9A-Fa-f]*\) *A *_cmetric2cond_\([A-Za-z_0-9]*\) */#define \2 0x\1/p' \
| sort >>$$@.tmp` && exit $$$$status
$(Q)echo >>$$@.tmp '/* Defines from the values defined to symbols in hexadecimal format */'
$(Q)exec 3>&1; status=`exec 4>&1 >&3; { $(NM) $$<; echo $$$$? >&4; }\
- | sed -n 's/^ *0*\(0[0-9A-Fa-f]*\) *A *_cmetric2def_\([A-Za-z_0-9]*\) */#define \2 0x\1/p' \
+ | $(SED4OMK) -n 's/^ *0*\(0[0-9A-Fa-f]*\) *A *_cmetric2def_\([A-Za-z_0-9]*\) */#define \2 0x\1/p' \
| sort >>$$@.tmp` && exit $$$$status
$(Q)echo >>$$@.tmp '/* Defines from the values defined to symbols in decimal format */'
$(Q)exec 3>&1; status=`exec 4>&1 >&3; { $(NM) -td $$<; echo $$$$? >&4; }\
- | sed -n 's/^ *0*\(0\|[1-9][0-9]*\) *A *_cmetric2defdec_\([A-Za-z_0-9]*\) */#define \2 \1/p' \
+ | $(SED4OMK) -n 's/^ *0*\(0\|[1-9][0-9]*\) *A *_cmetric2defdec_\([A-Za-z_0-9]*\) */#define \2 \1/p' \
| sort >>$$@.tmp` && exit $$$$status
$(Q)mv $$@.tmp $$@
endef
$(Q) $$(if $$(filter %.cc,$$($(1)_SOURCES:%.cxx=%.cc)),$$(CXX),$$(CC)) \
$$($(1)_OBJS) $$($(1)_LIBS:%=-l%) $$(LOADLIBES) $$(LDFLAGS) $$($(1)_LDFLAGS) -Wl,-rpath-link,$(USER_LIB_DIR) -Wl,-Map,$(USER_OBJS_DIR)/$(1).exe.map -o $$@
@echo "$(2)/$(1)$(3): \\" >$(USER_OBJS_DIR)/$(1).exe.d
- @sed -n -e 's|^LOAD \(.*\)$$$$| \1 \&|p' $(USER_OBJS_DIR)/$(1).exe.map|tr '&' '\134' >>$(USER_OBJS_DIR)/$(1).exe.d
+ @$(SED4OMK) -n -e 's|^LOAD \(.*\)$$$$| \1 \&|p' $(USER_OBJS_DIR)/$(1).exe.map|tr '&' '\134' >>$(USER_OBJS_DIR)/$(1).exe.d
@echo >>$(USER_OBJS_DIR)/$(1).exe.d
endef
include $(RTL_DIR)/rtl.mk
KERN_CC = $(CC)
-kern_GCCLIB_DIR=$(shell LANG=C LC_ALL=C LC_MESSAGES=C $(CC) -print-search-dirs | sed -n -e 's/^install: \(.*\)$$/\1/p' )
+kern_GCCLIB_DIR=$(shell LANG=C LC_ALL=C LC_MESSAGES=C $(CC) -print-search-dirs | $(SED4OMK) -n -e 's/^install: \(.*\)$$/\1/p' )
INCLUDES := -I $(KERN_INCLUDE_DIR) $(INCLUDE) $(rtlinux_INCLUDES) $(kernel_INCLUDES)
#-DEXPORT_NO_SYMBOLS
c_o_kern_COMPILE = $(KERN_CC) -idirafter $(kern_GCCLIB_DIR)/include $(INCLUDES) $(CFLAGS) -DOMK_FOR_KERNEL -DEXPORT_SYMTAB -nostdinc
ifdef LINUX_CC
KERN_CC = $(LINUX_CC)
-kern_GCCLIB_DIR=$(shell LANG=C LC_ALL=C LC_MESSAGES=C $(LINUX_CC) -print-search-dirs | sed -n -e 's/^install: \(.*\)$$/\1/p' )
+kern_GCCLIB_DIR=$(shell LANG=C LC_ALL=C LC_MESSAGES=C $(LINUX_CC) -print-search-dirs | $(SED4OMK) -n -e 's/^install: \(.*\)$$/\1/p' )
else
KERN_CC = echo KERN_CC not defined - compilation skipped
endif
# Check GCC version for kernel part of build
ifndef kern_CC_MAJOR_VERSION
-kern_CC_MAJOR_VERSION := $(shell $(KERN_CC) -dumpversion | sed -e 's/\([^.]\)\..*/\1/')
+kern_CC_MAJOR_VERSION := $(shell $(KERN_CC) -dumpversion | $(SED4OMK) -e 's/\([^.]\)\..*/\1/')
endif
# Prepare suitable define for dependency building
ifeq ($(kern_CC_MAJOR_VERSION),2)
@$(QUIET_CMD_ECHO) " LD [K] $$@"
$(Q) $$(KERN_LD) $$(KERN_LDFLAGS) -r $$($(1)_OBJS) -L$$(kern_GCCLIB_DIR) $$($(1)_LIBS:%=-l%) $$(KERN_LOADLIBES) -Map $(KERN_OBJS_DIR)/$(1).mod.map -o $$@
@echo "$(2)/$(1)$(KERN_LINK_SUFFIX): \\" >$(KERN_OBJS_DIR)/$(1).mod.d
- @sed -n -e 's/^LOAD \(.*\)$$$$/ \1 \\/p' $(KERN_OBJS_DIR)/$(1).mod.map >>$(KERN_OBJS_DIR)/$(1).mod.d
+ @$(SED4OMK) -n -e 's/^LOAD \(.*\)$$$$/ \1 \\/p' $(KERN_OBJS_DIR)/$(1).mod.map >>$(KERN_OBJS_DIR)/$(1).mod.d
@echo >>$(KERN_OBJS_DIR)/$(1).mod.d
@if [ "$(KERN_EXE_SUFFIX)" = ".ko" ] ; then \
echo $(1) >>$(KERN_MODPOST_DIR)/module-changes ; \
# Check GCC version for user build
ifndef CC_MAJOR_VERSION
-CC_MAJOR_VERSION := $(shell $(CC) -dumpversion | sed -e 's/\([^.]\)\..*/\1/')
+CC_MAJOR_VERSION := $(shell $(CC) -dumpversion | $(SED4OMK) -e 's/\([^.]\)\..*/\1/')
endif
# Prepare suitable define for dependency building
ifeq ($(CC_MAJOR_VERSION),2)
# Bellow, the tricks with redirection are for shells without set -o pipefail
# (see http://www.mail-archive.com/dash@vger.kernel.org/msg00149.html)
$(Q)exec 3>&1; status=`exec 4>&1 >&3; { $(NM) $$<; echo $$$$? >&4; }\
- | sed -n 's/^ *0*\(0[0-9A-Fa-f]*\) *A *_cmetric2cond_\([A-Za-z_0-9]*\) */#define \2 0x\1/p' \
+ | $(SED4OMK) -n 's/^ *0*\(0[0-9A-Fa-f]*\) *A *_cmetric2cond_\([A-Za-z_0-9]*\) */#define \2 0x\1/p' \
| sort >>$$@.tmp` && exit $$$$status
$(Q)echo >>$$@.tmp '/* Defines from the values defined to symbols in hexadecimal format */'
$(Q)exec 3>&1; status=`exec 4>&1 >&3; { $(NM) $$<; echo $$$$? >&4; }\
- | sed -n 's/^ *0*\(0[0-9A-Fa-f]*\) *A *_cmetric2def_\([A-Za-z_0-9]*\) */#define \2 0x\1/p' \
+ | $(SED4OMK) -n 's/^ *0*\(0[0-9A-Fa-f]*\) *A *_cmetric2def_\([A-Za-z_0-9]*\) */#define \2 0x\1/p' \
| sort >>$$@.tmp` && exit $$$$status
$(Q)echo >>$$@.tmp '/* Defines from the values defined to symbols in decimal format */'
$(Q)exec 3>&1; status=`exec 4>&1 >&3; { $(NM) -td $$<; echo $$$$? >&4; }\
- | sed -n 's/^ *0*\(0\|[1-9][0-9]*\) *A *_cmetric2defdec_\([A-Za-z_0-9]*\) */#define \2 \1/p' \
+ | $(SED4OMK) -n 's/^ *0*\(0\|[1-9][0-9]*\) *A *_cmetric2defdec_\([A-Za-z_0-9]*\) */#define \2 \1/p' \
| sort >>$$@.tmp` && exit $$$$status
$(Q)mv $$@.tmp $$@
endef
$$(AM_LDFLAGS) $$(LDFLAGS) $$($(1)_OBJS) $$(LOADLIBES) $$($(1)_LIBS:%=-l%) \
-o $(2)/$(1)
#@echo "$(2)/$(1): \\" >$(USER_OBJS_DIR)/$(1).exe.d
-#@sed -n -e 's/^LOAD \(.*\)$$$$/ \1 \\/p' $(USER_OBJS_DIR)/$(1).exe.map >>$(USER_OBJS_DIR)/$(1).exe.d
+#@$(SED4OMK) -n -e 's/^LOAD \(.*\)$$$$/ \1 \\/p' $(USER_OBJS_DIR)/$(1).exe.map >>$(USER_OBJS_DIR)/$(1).exe.d
#@echo >>$(USER_OBJS_DIR)/$(1).exe.d
#-Wl,-Map,$(USER_OBJS_DIR)/$(1).exe.map
# FIXME: Why the map file was commented out?
@$(foreach f, $(lib_LDSCRIPTS), cmp --quiet $(SOURCES_DIR)/$(f) $(USER_LIB_DIR)/$(notdir $(f)) \
|| $(call cp_cmd,$(SOURCES_DIR)/$(f),$(USER_LIB_DIR)/$(notdir $(f))) || exit 1 ; )
@$(foreach f, $(asm_build_HEADERS), \
- srcfname=`echo '$(f)' | sed -e 's/^\(.*\)->.*$$/\1/'` ; destfname=`echo '$(f)' | sed -e 's/^.*->\(.*\)$$/\1/'` ; \
+ srcfname=`echo '$(f)' | $(SED4OMK) -e 's/^\(.*\)->.*$$/\1/'` ; destfname=`echo '$(f)' | $(SED4OMK) -e 's/^.*->\(.*\)$$/\1/'` ; \
cmp --quiet $(SOURCES_DIR)/$${srcfname} $(USER_OBJS_DIR)/$${destfname} \
|| ( mkdir -p `dirname $(USER_OBJS_DIR)/$${destfname}` && \
$(A51TOASX) $(SOURCES_DIR)/$${srcfname} $(USER_OBJS_DIR)/$${destfname} ) || exit 1 ; )
@mv "$(SOURCES_LIST).tmp2" "$(SOURCES_LIST)"
@echo "$(SOURCES_LIST): \\" > "$(SOURCES_LIST_D).tmp2"
@cat "$(SOURCES_LIST_D).tmp"|grep -v "$(SOURCES_LIST_D).tmp"|sort|uniq|\
- sed -e 's/$$/\\/' >> "$(SOURCES_LIST_D).tmp2"
+ $(SED4OMK) -e 's/$$/\\/' >> "$(SOURCES_LIST_D).tmp2"
@rm "$(SOURCES_LIST_D).tmp"
@mv "$(SOURCES_LIST_D).tmp2" "$(SOURCES_LIST_D)"
endif
echo "$(addsuffix /,$(RELATIVE_DIR:$(SOURCES_LIST_DIR)/%=%))$(h)" >> "$(SOURCES_LIST).tmp";)
@$(foreach ch,$(config_include_HEADERS), \
echo "$(USER_INCLUDE_DIR:$(OUTPUT_DIR)/$(addsuffix /,$(SOURCES_LIST_DIR))%=%)/$(ch)" >> "$(SOURCES_LIST).tmp";)
- @$(foreach h,$(renamed_include_HEADERS),echo '$(h)'|sed -e 's|\(.*\)->.*|$(addsuffix /,$(RELATIVE_DIR:$(SOURCES_LIST_DIR)/%=%))\1|' >> "$(SOURCES_LIST).tmp";)
+ @$(foreach h,$(renamed_include_HEADERS),echo '$(h)'|$(SED4OMK) -e 's|\(.*\)->.*|$(addsuffix /,$(RELATIVE_DIR:$(SOURCES_LIST_DIR)/%=%))\1|' >> "$(SOURCES_LIST).tmp";)
@$(foreach bin,$(lib_LIBRARIES) $(shared_LIBRARIES) $(bin_PROGRAMS) $(test_PROGRAMS) $(utils_PROGRAMS) \
$(kernel_LIBRARIES) $(rtlinux_LIBRARIES) $(kernel_MODULES),\
$(foreach src,$(filter-out %.o,$($(bin)_SOURCES)),echo "$(addsuffix /,$(RELATIVE_DIR:$(SOURCES_LIST_DIR)/%=%))$(src)" >> "$(SOURCES_LIST).tmp";))
ifeq ($(MAKECMDGOALS),do-tags)
.PHONY: do-tags
-do-tags: $(shell sed -e '/^\#/d' $(SOURCES_LIST))
+do-tags: $(shell $(SED4OMK) -e '/^\#/d' $(SOURCES_LIST))
@$(QUIET_CMD_ECHO) " TAGS $(SOURCES_LIST_FN)"
$(Q)$(TAGS_CMD) $^
endif
cscope: $(SOURCES_LIST)
@$(QUIET_CMD_ECHO) " CSCOPE < $(SOURCES_LIST_FN)"
- $(Q)sed -e '/^#/d' $(SOURCES_LIST) > cscope.files
+ $(Q)$(SED4OMK) -e '/^#/d' $(SOURCES_LIST) > cscope.files
$(Q)cscope -b -icscope.files
#FIXME: see doc to -i in cscope(1)
# $(Q) $$(shell if [ -z "$$(filter %.cc,$$($(1)_SOURCES:%.cxx=%.cc))" ] ; then echo $$(CC) ; else echo $$(CXX) ; fi) \
# $$($(1)_OBJS) $$($(1)_LIBS:%=-l%) $$(LOADLIBES) $$(LDFLAGS) -Wl,-Map,$(USER_OBJS_DIR)/$(1).exe.map -o $(2)/$(1)
# @echo "$(2)/$(1): \\" >$(USER_OBJS_DIR)/$(1).exe.d
-# @sed -n -e 's/^LOAD \(.*\)$$$$/ \1 \\/p' $(USER_OBJS_DIR)/$(1).exe.map >>$(USER_OBJS_DIR)/$(1).exe.d
+# @$(SED4OMK) -n -e 's/^LOAD \(.*\)$$$$/ \1 \\/p' $(USER_OBJS_DIR)/$(1).exe.map >>$(USER_OBJS_DIR)/$(1).exe.d
# @echo >>$(USER_OBJS_DIR)/$(1).exe.d
endef