diff options
author | Neil Schemenauer <nascheme@enme.ucalgary.ca> | 2001-01-24 17:16:22 (GMT) |
---|---|---|
committer | Neil Schemenauer <nascheme@enme.ucalgary.ca> | 2001-01-24 17:16:22 (GMT) |
commit | d32a337cf3089e70efb06b65a242f119c9187967 (patch) | |
tree | 2765b67442fe613fe6ae5e278090c58f8242f300 /Modules | |
parent | 6cf0702a79541eedbc87e4b3727db0d73f72e68d (diff) | |
download | cpython-d32a337cf3089e70efb06b65a242f119c9187967.zip cpython-d32a337cf3089e70efb06b65a242f119c9187967.tar.gz cpython-d32a337cf3089e70efb06b65a242f119c9187967.tar.bz2 |
Changes for flat makefile. Building of modules happens from toplevel
directory. Modify meaning of -s option to specify the Modules directory.
Add -l option to specify library source directory when building extension
modules. Perhaps these names should be switched to avoid breaking old
code. Add -c compiler option to when emitting rules to build object files.
Diffstat (limited to 'Modules')
-rwxr-xr-x | Modules/makesetup | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/Modules/makesetup b/Modules/makesetup index b8b34d8..7f231a9 100755 --- a/Modules/makesetup +++ b/Modules/makesetup @@ -6,8 +6,9 @@ # Usage: makesetup [-s dir] [-c file] [-m file] [Setup] ... [-n [Setup] ...] # # Options: -# -s directory: alternative source directory (default derived from $0) -# -c file: alternative config.c template (default $srcdir/config.c.in) +# -s directory: alternative source directory (default .) +# -l directory: library source directory (default derived from $0) +# -c file: alternative config.c template (default $libdir/config.c.in) # -c -: don't write config.c # -m file: alternative Makefile template (default ./Makefile.pre) # -m -: don't write Makefile @@ -40,9 +41,10 @@ # Loop over command line options usage=' -usage: makesetup [-s srcdir] [-c config.c.in] [-m Makefile.pre] +usage: makesetup [-s srcdir] [-l libdir] [-c config.c.in] [-m Makefile.pre] [Setup] ... [-n [Setup] ...]' -srcdir='' +srcdir='.' +libdir='' config='' makepre='' noobjects='' @@ -51,6 +53,7 @@ while : do case $1 in -s) shift; srcdir=$1; shift;; + -l) shift; libdir=$1; shift;; -c) shift; config=$1; shift;; -m) shift; makepre=$1; shift;; --) shift; break;; @@ -60,16 +63,16 @@ do esac done -# Set default srcdir and config if not set by command line +# Set default libdir and config if not set by command line # (Not all systems have dirname) case $srcdir in '') case $0 in - */*) srcdir=`echo $0 | sed 's,/[^/]*$,,'`;; - *) srcdir=.;; + */*) libdir=`echo $0 | sed 's,/[^/]*$,,'`;; + *) libdir=.;; esac;; esac case $config in -'') config=$srcdir/config.c.in;; +'') config=$libdir/config.c.in;; esac case $makepre in '') makepre=Makefile.pre;; @@ -82,9 +85,9 @@ NL='\ # Setup to link with extra libraries when makeing shared extensions. # Currently, only Cygwin needs this baggage. case `uname -s` in -CYGWIN*) if test $srcdir = . +CYGWIN*) if test $libdir = . then - ExtraLibDir=.. + ExtraLibDir=. else ExtraLibDir='$(LIBPL)' fi @@ -204,17 +207,18 @@ sed -e 's/[ ]*#.*//' -e '/^[ ]*$/d' | *.m) obj=`basename $src .m`.o; cc='$(CXX)';; # Obj-C *) continue;; esac + obj="$srcdir/$obj" objs="$objs $obj" case $src in glmodule.c) ;; /*) ;; \$*) ;; - *) src='$(srcdir)/'$src;; + *) src='$(srcdir)/'"$srcdir/$src";; esac case $doconfig in no) cc="$cc \$(CCSHARED)";; esac - rule="$obj: $src; $cc $cpps \$(CFLAGS) -c $src" + rule="$obj: $src; $cc $cpps \$(CFLAGS) -c $src -o $obj" echo "$rule" >>$rulesf done case $doconfig in |