remove unnecessary shell calls
The main makefile, init.d/Makefile and src/librc/Makefile all contain several shell calls which can be handled as make conditionals. This switches them to conditionals.
This commit is contained in:
parent
21c5a022af
commit
19037cbd83
19
Makefile
19
Makefile
@ -7,20 +7,15 @@ include Makefile.inc
|
|||||||
SUBDIR= conf.d etc init.d local.d man scripts sh src
|
SUBDIR= conf.d etc init.d local.d man scripts sh src
|
||||||
|
|
||||||
# Build our old net foo or not
|
# Build our old net foo or not
|
||||||
_OLDNET_SH= case "${MKOLDNET}" in \
|
ifeq (${MKOLDNET},yes)
|
||||||
[Yy][Ee][Ss]) echo "net doc";; \
|
SUBDIR+= net doc
|
||||||
*) echo "";; \
|
endif
|
||||||
esac
|
|
||||||
_OLDNET:= $(shell ${_OLDNET_SH})
|
|
||||||
SUBDIR+= ${_OLDNET}
|
|
||||||
|
|
||||||
# Build pkgconfig or not
|
# Build pkgconfig or not
|
||||||
_PKGCONFIG_SH= case "${MKPKGCONFIG}" in \
|
MKPKGCONFIG?= yes
|
||||||
[Yy][Ee][Ss]|"") echo "pkgconfig";; \
|
ifeq (${MKPKGCONFIG},yes)
|
||||||
*) echo "";; \
|
SUBDIR+= pkgconfig
|
||||||
esac
|
endif
|
||||||
_PKGCONFIG:= $(shell ${_PKGCONFIG_SH})
|
|
||||||
SUBDIR+= ${_PKGCONFIG}
|
|
||||||
|
|
||||||
# We need to ensure that runlevels is done last
|
# We need to ensure that runlevels is done last
|
||||||
SUBDIR+= runlevels
|
SUBDIR+= runlevels
|
||||||
|
@ -5,11 +5,9 @@ SRCS= bootmisc.in fsck.in hostname.in local.in localmount.in netmount.in \
|
|||||||
BIN= ${OBJS}
|
BIN= ${OBJS}
|
||||||
|
|
||||||
# Build our old net foo or not
|
# Build our old net foo or not
|
||||||
_OLDNET_SH= case "${MKOLDNET}" in \
|
ifeq (${MKOLDNET},yes)
|
||||||
[Yy][Ee][Ss]) echo "net.lo";; \
|
_OLDNET= net.lo
|
||||||
*) echo "";; \
|
endif
|
||||||
esac
|
|
||||||
_OLDNET:= $(shell ${_OLDNET_SH})
|
|
||||||
_NET_LO= ${_OLDNET}
|
_NET_LO= ${_OLDNET}
|
||||||
|
|
||||||
INSTALLAFTER= _installafter_${_NET_LO}
|
INSTALLAFTER= _installafter_${_NET_LO}
|
||||||
|
@ -19,20 +19,25 @@ SED_CMD= -e 's:@PREFIX@:${PREFIX}:g'
|
|||||||
SED_CMD+= -e 's:@LIB@:${LIBNAME}:g'
|
SED_CMD+= -e 's:@LIB@:${LIBNAME}:g'
|
||||||
SED_CMD+= -e 's:@SYSCONFDIR@:${SYSCONFDIR}:g'
|
SED_CMD+= -e 's:@SYSCONFDIR@:${SYSCONFDIR}:g'
|
||||||
SED_CMD+= -e 's:@LIBEXECDIR@:${LIBEXECDIR}:g'
|
SED_CMD+= -e 's:@LIBEXECDIR@:${LIBEXECDIR}:g'
|
||||||
_PKG_PREFIX_SH= if test -n "${PKG_PREFIX}" && test "${PKG_PREFIX}" != "/" && test "${PKG_PREFIX}" != "${PREFIX}"; then \
|
|
||||||
echo "-e 's:@PKG_PREFIX@:${PKG_PREFIX}:g'"; \
|
_PKG_PREFIX= -e 's:.*@PKG_PREFIX@.*:\#undef RC_PKG_PREFIX:g'
|
||||||
else \
|
ifneq (${PKG_PREFIX},)
|
||||||
echo "-e 's:.*@PKG_PREFIX@.*:\#undef RC_PKG_PREFIX:g'"; \
|
ifneq (${PKG_PREFIX},/)
|
||||||
fi
|
ifneq (${PKG_PREFIX},${PREFIX})
|
||||||
_PKG_PREFIX:= $(shell ${_PKG_PREFIX_SH})
|
_PKG_PREFIX= -e 's:@PKG_PREFIX@:${PKG_PREFIX}:g'
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
endif
|
||||||
SED_CMD+= ${_PKG_PREFIX}
|
SED_CMD+= ${_PKG_PREFIX}
|
||||||
|
|
||||||
_LCL_PREFIX_SH= if test -n "${LOCAL_PREFIX}" && test "${LOCAL_PREFIX}" != "/" && test "${LOCAL_PREFIX}" != "${PREFIX}"; then \
|
_LCL_PREFIX= -e 's:@LOCAL_PREFIX@::g'
|
||||||
echo "-e 's:@LOCAL_PREFIX@:${LOCAL_PREFIX}:g'"; \
|
ifneq (${LOCAL_PREFIX},)
|
||||||
else \
|
ifneq (${LOCAL_PREFIX},/)
|
||||||
echo "-e 's:@LOCAL_PREFIX@::g'"; \
|
ifneq (${LOCAL_PREFIX},${PREFIX})
|
||||||
fi
|
_LCL_PREFIX= -e 's:@LOCAL_PREFIX@:${LOCAL_PREFIX}:g'
|
||||||
_LCL_PREFIX:= $(shell ${_LCL_PREFIX_SH})
|
endif
|
||||||
|
endif
|
||||||
|
endif
|
||||||
SED_CMD+= ${_LCL_PREFIX}
|
SED_CMD+= ${_LCL_PREFIX}
|
||||||
|
|
||||||
.SUFFIXES: .h.in .h
|
.SUFFIXES: .h.in .h
|
||||||
|
Loading…
Reference in New Issue
Block a user