Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1264853

[PATCH 5/7] Conditionals for CONFIG_RANDOM_INIT and CONFIG_RANDOM_GCM

From Sandy Harris <sandyinchina@gmail.com>
Newsgroups linux.kernel
Subject [PATCH 5/7] Conditionals for CONFIG_RANDOM_INIT and CONFIG_RANDOM_GCM
Date 2015-11-07 15:40 +0100
Message-ID <qscOS-3uH-19@gated-at.bofh.it> (permalink)
References <qscOR-3uH-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 1/7] A couple of generated files Sandy Harris <sandyinchina@gmail.com> - 2015-11-07 15:40 +0100
  [PATCH 3/7] Initialise pools randomly if CONFIG_RANDOM_INIT=y Sandy Harris <sandyinchina@gmail.com> - 2015-11-07 15:40 +0100
    Re: [PATCH 3/7] Initialise pools randomly if CONFIG_RANDOM_INIT=y Jason Cooper <jason@lakedaemon.net> - 2015-11-07 18:20 +0100
  [PATCH 7/7] Create generated/random_init.h, used by random driver Sandy Harris <sandyinchina@gmail.com> - 2015-11-07 15:40 +0100
  [PATCH 2/7] Two new CONFIG options for the random(4) driver Sandy Harris <sandyinchina@gmail.com> - 2015-11-07 15:40 +0100
  [PATCH 6/7] Produces generated/random_init.h for random driver Sandy Harris <sandyinchina@gmail.com> - 2015-11-07 15:40 +0100
  [PATCH 5/7] Conditionals for CONFIG_RANDOM_INIT and CONFIG_RANDOM_GCM Sandy Harris <sandyinchina@gmail.com> - 2015-11-07 15:40 +0100
  Re: [PATCH 1/7] A couple of generated files Jason Cooper <jason@lakedaemon.net> - 2015-11-07 18:00 +0100
    Re: [PATCH 1/7] A couple of generated files Sandy Harris <sandyinchina@gmail.com> - 2015-11-07 20:00 +0100
  Re: [PATCH 1/7] A couple of generated files Jason Cooper <jason@lakedaemon.net> - 2015-11-07 18:10 +0100
    Re: [PATCH 1/7] A couple of generated files Sandy Harris <sandyinchina@gmail.com> - 2015-11-07 19:00 +0100

csiph-web