From: "William Hubbs" <williamh@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/openrc:master commit in: src/librc/, init.d/, /
Date: Sat, 5 Feb 2011 04:39:40 +0000 (UTC) [thread overview]
Message-ID: <19037cbd83ee46f2c3510925c83cc89d27d16ac6.williamH@gentoo> (raw)
commit: 19037cbd83ee46f2c3510925c83cc89d27d16ac6
Author: William Hubbs <williamh <AT> gentoo <DOT> org>
AuthorDate: Wed Feb 2 18:10:58 2011 +0000
Commit: William Hubbs <williamh <AT> gentoo <DOT> org>
CommitDate: Fri Feb 4 23:46:57 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/openrc.git;a=commit;h=19037cbd
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.
---
Makefile | 19 +++++++------------
init.d/Makefile | 8 +++-----
src/librc/Makefile | 29 +++++++++++++++++------------
3 files changed, 27 insertions(+), 29 deletions(-)
diff --git a/Makefile b/Makefile
index d2e1593..dd427d0 100644
--- a/Makefile
+++ b/Makefile
@@ -7,20 +7,15 @@ include Makefile.inc
SUBDIR= conf.d etc init.d local.d man scripts sh src
# Build our old net foo or not
-_OLDNET_SH= case "${MKOLDNET}" in \
- [Yy][Ee][Ss]) echo "net doc";; \
- *) echo "";; \
- esac
-_OLDNET:= $(shell ${_OLDNET_SH})
-SUBDIR+= ${_OLDNET}
+ifeq (${MKOLDNET},yes)
+SUBDIR+= net doc
+endif
# Build pkgconfig or not
-_PKGCONFIG_SH= case "${MKPKGCONFIG}" in \
- [Yy][Ee][Ss]|"") echo "pkgconfig";; \
- *) echo "";; \
- esac
-_PKGCONFIG:= $(shell ${_PKGCONFIG_SH})
-SUBDIR+= ${_PKGCONFIG}
+MKPKGCONFIG?= yes
+ifeq (${MKPKGCONFIG},yes)
+SUBDIR+= pkgconfig
+endif
# We need to ensure that runlevels is done last
SUBDIR+= runlevels
diff --git a/init.d/Makefile b/init.d/Makefile
index 29ebe59..b7490d3 100644
--- a/init.d/Makefile
+++ b/init.d/Makefile
@@ -5,11 +5,9 @@ SRCS= bootmisc.in fsck.in hostname.in local.in localmount.in netmount.in \
BIN= ${OBJS}
# Build our old net foo or not
-_OLDNET_SH= case "${MKOLDNET}" in \
- [Yy][Ee][Ss]) echo "net.lo";; \
- *) echo "";; \
- esac
-_OLDNET:= $(shell ${_OLDNET_SH})
+ifeq (${MKOLDNET},yes)
+_OLDNET= net.lo
+endif
_NET_LO= ${_OLDNET}
INSTALLAFTER= _installafter_${_NET_LO}
diff --git a/src/librc/Makefile b/src/librc/Makefile
index eb6f6fd..574aa2a 100644
--- a/src/librc/Makefile
+++ b/src/librc/Makefile
@@ -19,20 +19,25 @@ SED_CMD= -e 's:@PREFIX@:${PREFIX}:g'
SED_CMD+= -e 's:@LIB@:${LIBNAME}:g'
SED_CMD+= -e 's:@SYSCONFDIR@:${SYSCONFDIR}: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'"; \
- else \
- echo "-e 's:.*@PKG_PREFIX@.*:\#undef RC_PKG_PREFIX:g'"; \
- fi
-_PKG_PREFIX:= $(shell ${_PKG_PREFIX_SH})
+
+_PKG_PREFIX= -e 's:.*@PKG_PREFIX@.*:\#undef RC_PKG_PREFIX:g'
+ifneq (${PKG_PREFIX},)
+ifneq (${PKG_PREFIX},/)
+ifneq (${PKG_PREFIX},${PREFIX})
+_PKG_PREFIX= -e 's:@PKG_PREFIX@:${PKG_PREFIX}:g'
+endif
+endif
+endif
SED_CMD+= ${_PKG_PREFIX}
-_LCL_PREFIX_SH= if test -n "${LOCAL_PREFIX}" && test "${LOCAL_PREFIX}" != "/" && test "${LOCAL_PREFIX}" != "${PREFIX}"; then \
- echo "-e 's:@LOCAL_PREFIX@:${LOCAL_PREFIX}:g'"; \
- else \
- echo "-e 's:@LOCAL_PREFIX@::g'"; \
- fi
-_LCL_PREFIX:= $(shell ${_LCL_PREFIX_SH})
+_LCL_PREFIX= -e 's:@LOCAL_PREFIX@::g'
+ifneq (${LOCAL_PREFIX},)
+ifneq (${LOCAL_PREFIX},/)
+ifneq (${LOCAL_PREFIX},${PREFIX})
+_LCL_PREFIX= -e 's:@LOCAL_PREFIX@:${LOCAL_PREFIX}:g'
+endif
+endif
+endif
SED_CMD+= ${_LCL_PREFIX}
.SUFFIXES: .h.in .h
reply other threads:[~2011-02-05 4:39 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=19037cbd83ee46f2c3510925c83cc89d27d16ac6.williamH@gentoo \
--to=williamh@gentoo.org \
--cc=gentoo-commits@lists.gentoo.org \
--cc=gentoo-dev@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox