All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alexey Kodanev <alexey.kodanev@oracle.com>
To: ltp-list@lists.sourceforge.net
Cc: vasily.isaenko@oracle.com, Alexey Kodanev <alexey.kodanev@oracle.com>
Subject: [LTP] [PATCH v2 3/4] lib: compile *_r.c to libltp_r library, add testcases_r.mk
Date: Tue, 11 Feb 2014 13:48:09 +0400	[thread overview]
Message-ID: <1392112090-13853-2-git-send-email-alexey.kodanev@oracle.com> (raw)
In-Reply-To: <1392112090-13853-1-git-send-email-alexey.kodanev@oracle.com>

Add rules to build *_r.c files. All compiled lib/*_r.c files will be
included in libltp_r.a library.
testcases_r.mk can be used in multi-threaded tests.

Signed-off-by: Alexey Kodanev <alexey.kodanev@oracle.com>
---
 include/mk/lib.mk         |   15 ++++++++++++++-
 include/mk/testcases_r.mk |   29 +++++++++++++++++++++++++++++
 2 files changed, 43 insertions(+), 1 deletions(-)
 create mode 100644 include/mk/testcases_r.mk

diff --git a/include/mk/lib.mk b/include/mk/lib.mk
index 456db24..3bec31c 100644
--- a/include/mk/lib.mk
+++ b/include/mk/lib.mk
@@ -20,6 +20,7 @@
 # Garrett Cooper, July 2009
 #
 # Copyright (C) Cyril Hrubis <chrubis@suse.cz> 2012
+# Copyright (C) 2014 Oracle and/or its affiliates. All Rights Reserved.
 #
 
 # Makefile to include for libraries.
@@ -46,7 +47,7 @@ ifneq ($(MAKECMDGOALS),install)
 LIB ?= $(INTERNAL_LIB)
 endif
 
-MAKE_TARGETS	+= $(LIB)
+MAKE_TARGETS	+= $(LIB) $(LIB_R)
 
 LIBSRCS		?= $(wildcard $(abs_srcdir)/*.c)
 
@@ -60,7 +61,11 @@ LIBSRCS		:= $(subst $(abs_srcdir)/,,$(wildcard $(LIBSRCS)))
 
 LIBSRCS		:= $(filter-out $(FILTER_OUT_LIBSRCS),$(LIBSRCS))
 
+LIBSRCS_R	:= $(filter %_r.c,$(LIBSRCS))
+LIBSRCS		:= $(filter-out %_r.c,$(LIBSRCS))
+
 LIBOBJS		:= $(LIBSRCS:.c=.o)
+LIBOBJS_R	:= $(LIBSRCS_R:.c=.o)
 
 $(LIB): $(notdir $(LIBOBJS))
 	if [ -z "$(strip $^)" ] ; then \
@@ -70,4 +75,12 @@ $(LIB): $(notdir $(LIBOBJS))
 	$(if $(AR),$(AR),ar) -rc "$@" $^
 	$(if $(RANLIB),$(RANLIB),ranlib) "$@"
 
+$(LIB_R): $(notdir $(LIBOBJS_R))
+	if [ -z "$(strip $^)" ] ; then \
+		echo "Cowardly refusing to create empty archive"; \
+		exit 1; \
+	fi
+	$(if $(AR),$(AR),ar) -rc "$@" $^
+	$(if $(RANLIB),$(RANLIB),ranlib) "$@"
+
 include $(top_srcdir)/include/mk/generic_leaf_target.mk
diff --git a/include/mk/testcases_r.mk b/include/mk/testcases_r.mk
new file mode 100644
index 0000000..49db8a5
--- /dev/null
+++ b/include/mk/testcases_r.mk
@@ -0,0 +1,29 @@
+# Copyright (c) 2014 Oracle and/or its affiliates. All Rights Reserved.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it would be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write the Free Software Foundation,
+# Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+#
+# Author: Alexey Kodanev <alexey.kodanev@oracle.com>
+#
+# For inclusion in multi-threaded test-cases
+#
+
+include $(top_srcdir)/include/mk/env_pre.mk
+include $(top_srcdir)/include/mk/functions.mk
+
+# Link static libltp_r before libltp because it has unresolved symbols
+# defined in libltp
+LDLIBS		+= -lltp_r -pthread
+
+include $(top_srcdir)/include/mk/testcases.mk
-- 
1.7.1


------------------------------------------------------------------------------
Android apps run on BlackBerry 10
Introducing the new BlackBerry 10.2.1 Runtime for Android apps.
Now with support for Jelly Bean, Bluetooth, Mapview and more.
Get your Android app in front of a whole new audience.  Start now.
http://pubads.g.doubleclick.net/gampad/clk?id=124407151&iu=/4140/ostg.clktrk
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

  reply	other threads:[~2014-02-11  9:48 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-11  9:48 [LTP] [PATCH v2 2/4] lib/test.h: create macro to declare init/cleanup functions Alexey Kodanev
2014-02-11  9:48 ` Alexey Kodanev [this message]
2014-02-11  9:48 ` [LTP] [PATCH 4/4] lib: add tst_res_r.c Alexey Kodanev
2014-02-12 15:44   ` chrubis
     [not found]     ` <5128140.KmexAZrTeg@vapier>
2014-02-13 10:21       ` chrubis
     [not found]         ` <52FCA8DF.4030503@oracle.com>
2014-02-13 13:04           ` chrubis
2014-02-13  8:47   ` Mike Frysinger
2014-02-13 10:05     ` Alexey Kodanev
2014-02-13 23:06       ` Mike Frysinger
2014-02-14 13:59         ` Alexey Kodanev
2014-02-14 17:16           ` Mike Frysinger
2014-02-19 15:19         ` chrubis
2014-02-13 10:11     ` chrubis
2014-02-12 15:37 ` [LTP] [PATCH v2 2/4] lib/test.h: create macro to declare init/cleanup functions chrubis

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=1392112090-13853-2-git-send-email-alexey.kodanev@oracle.com \
    --to=alexey.kodanev@oracle.com \
    --cc=ltp-list@lists.sourceforge.net \
    --cc=vasily.isaenko@oracle.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.