staging: comedi: Makefile: conditionally compile multi-file core module
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Thu, 20 Dec 2012 00:49:24 +0000 (17:49 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 7 Jan 2013 22:51:11 +0000 (14:51 -0800)
Instead of using the #ifdef'ery in the comedi_compat32.c and proc.c
files to include/exclude them from the comedi core, modify the Makefile
to include those files automatically when enabled in the .config.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/comedi/Makefile
drivers/staging/comedi/comedi_compat32.c
drivers/staging/comedi/proc.c

index 8dbd306fef887235ae03a6cbb9e2deb02f74f218..f895c0ccc3c8374aec72acf48bb63171fcfd19c2 100644 (file)
@@ -1,11 +1,8 @@
-obj-$(CONFIG_COMEDI) += comedi.o
+comedi-y                       := comedi_fops.o range.o drivers.o
+comedi-$(CONFIG_PROC_FS)       += proc.o
+comedi-$(CONFIG_COMPAT)                += comedi_compat32.o
 
-obj-$(CONFIG_COMEDI)   += kcomedilib/
-obj-$(CONFIG_COMEDI)   += drivers/
+obj-$(CONFIG_COMEDI)           += comedi.o
 
-comedi-y :=            \
-       comedi_fops.o   \
-       proc.o          \
-       range.o         \
-       drivers.o       \
-       comedi_compat32.o \
+obj-$(CONFIG_COMEDI)           += kcomedilib/
+obj-$(CONFIG_COMEDI)           += drivers/
index 4b7cbfad1d74ff31914a4ea32a6047472c94fdd9..ad208cdd53d406f8ad8151038b91ae49ce700c87 100644 (file)
@@ -30,8 +30,6 @@
 #include "comedi.h"
 #include "comedi_compat32.h"
 
-#ifdef CONFIG_COMPAT
-
 #define COMEDI32_CHANINFO _IOR(CIO, 3, struct comedi32_chaninfo_struct)
 #define COMEDI32_RANGEINFO _IOR(CIO, 8, struct comedi32_rangeinfo_struct)
 /* N.B. COMEDI32_CMD and COMEDI_CMD ought to use _IOWR, not _IOR.
@@ -460,5 +458,3 @@ long comedi_compat_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
 {
        return raw_ioctl(file, cmd, arg);
 }
-
-#endif /* CONFIG_COMPAT */
index 732134f30fe35270c410ae4acb2bd6070ae42740..362c214bcc0bb05d4b7113104a37d13f02d62616 100644 (file)
@@ -33,7 +33,6 @@
 #include <linux/proc_fs.h>
 #include <linux/string.h>
 
-#ifdef CONFIG_PROC_FS
 static int comedi_read(char *buf, char **start, off_t offset, int len,
                       int *eof, void *data)
 {
@@ -92,4 +91,3 @@ void comedi_proc_cleanup(void)
 {
        remove_proc_entry("comedi", NULL);
 }
-#endif