linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sandy Harris <sandyinchina@gmail.com>
To: "Theodore Ts\\'o" <tytso@mit.edu>,
	Jason Cooper <jason@lakedaemon.net>,
	"H. Peter Anvin" <hpa@zytor.com>, John Denker <jsd@av8n.com>
Cc: linux-kernel@vger.kernel.org, linux-crypto@vger.kernel.org
Subject: [PATCH 5/7] Conditionals for CONFIG_RANDOM_INIT and CONFIG_RANDOM_GCM
Date: Sat,  7 Nov 2015 09:30:40 -0500	[thread overview]
Message-ID: <1446906642-19372-5-git-send-email-sandyinchina@gmail.com> (raw)
In-Reply-To: <1446906642-19372-1-git-send-email-sandyinchina@gmail.com>

Signed-off-by: Sandy Harris <sandyinchina@gmail.com>
---
 drivers/char/Makefile | 25 ++++++++++++++++++++++++-
 1 file changed, 24 insertions(+), 1 deletion(-)

diff --git a/drivers/char/Makefile b/drivers/char/Makefile
index d8a7579..7d095e5 100644
--- a/drivers/char/Makefile
+++ b/drivers/char/Makefile
@@ -2,7 +2,30 @@
 # Makefile for the kernel character device drivers.
 #
 
-obj-y				+= mem.o random.o
+obj-y				+= mem.o
+
+ifeq ($(CONFIG_RANDOM_GCM),y)
+  random_c		= random_gcm.c
+  random_o		= random_gcm.o
+  random_no		= random.o
+else
+  random_c		= random.c
+  random_o		= random.o
+  random_no		= random_gcm.o
+endif
+obj-y				+= $(random_o)
+
+# remove the generated file after use so that
+# a fresh one is built (by scripts/gen_random)
+# for every compile
+# remove random_no so it will not get linked
+ifeq ($(CONFIG_RANDOM_INIT),y)
+init-file = include/generated/random_init.h
+$(random_o): $(random_c) $(init-file)
+	$(CC) $< -o $@
+	$(Q) rm --force $(init-file) $(random_no)
+endif
+
 obj-$(CONFIG_TTY_PRINTK)	+= ttyprintk.o
 obj-y				+= misc.o
 obj-$(CONFIG_ATARI_DSP56K)	+= dsp56k.o
-- 
2.5.0


  parent reply	other threads:[~2015-11-07 14:31 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-07 14:30 [PATCH 1/7] A couple of generated files Sandy Harris
2015-11-07 14:30 ` [PATCH 2/7] Two new CONFIG options for the random(4) driver Sandy Harris
2015-11-07 14:30 ` [PATCH 3/7] Initialise pools randomly if CONFIG_RANDOM_INIT=y Sandy Harris
2015-11-07 16:54   ` Jason Cooper
2015-11-07 17:08   ` kbuild test robot
2015-11-07 14:30 ` [PATCH 4/7] Different version of driver using hash from AES-GCM Compiled if CONFIG_RANDOM_GCM=y Sandy Harris
2015-11-07 14:30 ` Sandy Harris [this message]
2015-11-07 17:11   ` [PATCH 5/7] Conditionals for CONFIG_RANDOM_INIT and CONFIG_RANDOM_GCM kbuild test robot
2015-11-07 14:30 ` [PATCH 6/7] Produces generated/random_init.h for random driver Sandy Harris
2015-11-07 14:30 ` [PATCH 7/7] Create generated/random_init.h, used by " Sandy Harris
2015-11-07 16:00   ` kbuild test robot
2015-11-07 21:18   ` kbuild test robot
2015-11-08 11:14   ` kbuild test robot
2015-11-07 16:53 ` [PATCH 1/7] A couple of generated files Jason Cooper
2015-11-07 18:50   ` Sandy Harris
2016-03-02  3:15     ` Sandy Harris
2015-11-07 17:01 ` Jason Cooper
2015-11-07 17:50   ` Sandy Harris

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=1446906642-19372-5-git-send-email-sandyinchina@gmail.com \
    --to=sandyinchina@gmail.com \
    --cc=hpa@zytor.com \
    --cc=jason@lakedaemon.net \
    --cc=jsd@av8n.com \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tytso@mit.edu \
    /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;
as well as URLs for NNTP newsgroup(s).