Fixes to the new build system
authorDavid Schleef <ds@schleef.org>
Fri, 7 Dec 2001 01:57:55 +0000 (01:57 +0000)
committerDavid Schleef <ds@schleef.org>
Fri, 7 Dec 2001 01:57:55 +0000 (01:57 +0000)
comedi/Makefile.in
comedi/drivers/Makefile.in
configure
scripts/dep.linux
scripts/generate_makefile

index 0f6402ab07d1dbec0e30aa30138615101e5c7a45..80e172c3f098341f87ed8ff41d3118bda371a029 100644 (file)
@@ -3,8 +3,9 @@ expsyms(comedi_ksyms.o)
 
 objlink(comedi.o comedi_fops.o proc.o range.o drivers.o kvmem.o comedi_ksyms.o)
 
-#if CONFIG_COMEDI_RT  += rt_pend_tq/rt_pend_tq.o
-#if CONFIG_COMEDI_RT  += rt.o
+ifsel(CONFIG_COMEDI_RT)
+  objlink(comedi.o rt_pend_tq.o rt.o)
+endif
 
 select(CONFIG_COMEDI comedi.o)
 
index 7935d187ae92d631aa3871a58e34dbde249fbd63..e48f948e127a5da226f496726f9e282fb8c3e41f 100644 (file)
@@ -2,8 +2,8 @@
 expsyms(mite.o 8255.o)
 
 select(CONFIG_COMEDI_8255 8255.o)
-select(CONFIG_COMEDI_ADL_PCI9118 adl_pci9118.o)
-select(CONFIG_COMEDI_ADV_PCI1710 adv_pci1710.o)
+select(CONFIG_COMEDI_ADL_PCI9118 adl_pci9118.o amcc_s5933.o)
+select(CONFIG_COMEDI_ADV_PCI1710 adv_pci1710.o amcc_s5933.o)
 select(CONFIG_COMEDI_AMPLC_PCI230 amplc_pci230.o)
 select(CONFIG_COMEDI_CB_PCIDAS cb_pcidas.o)
 select(CONFIG_COMEDI_CB_PCIDAS64 cb_pcidas64.o)
index 3f996b4ad51cae9da361bd440646919daff492c6..d22b81f2b54e3604f368d02181db158901b18faf 100755 (executable)
--- a/configure
+++ b/configure
@@ -4,6 +4,7 @@
 topdir=${PWD}
 
 interactive=y
+menu=n
 
 while [ "$1" != "" ];do
        case $1 in
@@ -26,6 +27,9 @@ while [ "$1" != "" ];do
                --non-interactive)
                        interactive=n
                        ;;
+               --menu)
+                       menu=y
+                       ;;
        esac
        shift
 done
@@ -35,17 +39,29 @@ done
 . scripts/dep.rtlinux
 
 
-scripts/Configure ${old}
+if [ "$menu" = "y" ];then
+       make -C scripts/lxdialog all
+       if [ ! -f .config ];then
+               cp scripts/config.dist .config
+       fi
+       scripts/Menuconfig scripts/config.in
+else
+       scripts/Configure ${old}
+fi
 
 
-scripts/generate_makefile comedi/Makefile.in >comedi/Makefile
-scripts/generate_makefile comedi/drivers/Makefile.in >comedi/drivers/Makefile
-scripts/generate_makefile comedi/kcomedilib/Makefile.in >comedi/kcomedilib/Makefile
+for each in $(find . -name Makefile.in)
+do
+       scripts/generate_makefile ${each} >$(dirname $each)/$(basename $each .in)
+done
+#scripts/generate_makefile comedi/Makefile.in >comedi/Makefile
+#scripts/generate_makefile comedi/drivers/Makefile.in >comedi/drivers/Makefile
+#scripts/generate_makefile comedi/kcomedilib/Makefile.in >comedi/kcomedilib/Makefile
 
 
 cat <<EOF
 
-Makefiles for Comedi are now be configured.
+Makefiles for Comedi are now configured.
 Run 'make' to compile, and then 'make install' to install.
 
 If Comedi has never been installed on your system,
index 1d44b8ac1a2773d8c3411260fb4036365f95c869..2b750645623700e3e0347c2c3c7382b0620cbcaf 100755 (executable)
@@ -1,6 +1,11 @@
 #!/bin/sh
 
-default=${LINUXDIR:=/usr/src/linux}
+if [ -f /lib/modules/$(uname -r)/build/Makefile ];then
+       default="/lib/modules/$(uname -r)/build"
+else
+       default="/usr/src/linux"
+fi
+default=${LINUXDIR:=$default}
 if [ "${interactive}" = "y" ];then
        echo -n "Enter location of Linux source tree [$default]: "
        read LINUXDIR
index 09c1b6cfe863e3bab40f4c13971df55b18cd9c69..531f7a66760179507cf103ab2fcc5186c45c7bea 100755 (executable)
@@ -5,15 +5,19 @@ open(IN, "$ARGV[0]");
 
 print "# This Makefile is autogenerated.  Edit Makefile.in instead.\n";
 while($_=<IN>){
-       if(m/select\(([\w_]+) ([\w_.]+)\)/){
+       if(m/select\(([\w_]+) ([\w_. ]+)\)/){
                print "obj-\$($1) += $2\n";
        }elsif(m/expsyms\(([\w_. ]+)\)/){
                print "export-objs += $1\n";
        }elsif(m/objlink\(([\w_.]+) ([\w_. ]+)\)/){
-               push @later,"$1: $2\n";
-               push @later,"\t\$(LD) -r -o \$@ $2\n";
+               print "$1-objs += $2\n";
+               push @later,"$1";
        }elsif(m/link_subdirs\(([\w_.]+)\)/){
                print "subdir-m += $1\n";
+       }elsif(m/ifsel\(([\w_]+)\)/){
+               print "ifneq (\$($1),)\n";
+       }elsif(m/endif/){
+               print "endif\n";
        }elsif(m/^$/){
        }elsif(m/^#/){
        }else{
@@ -30,5 +34,15 @@ while($_=<IN>){
 print "\n";
 print "include \$(TOPDIR)/Rules.make\n";
 print "\n";
-print @later;
+
+@later = sort @later;
+
+$last="";
+foreach $s (@later){
+       if($s ne $last){
+               print "$s: \$($s-objs)\n";
+               print "\t\$(LD) -r -o \$@ \$($s-objs)\n";
+       }
+       $last=$s;
+}