mirror of
https://github.com/python/cpython.git
synced 2025-09-13 20:27:05 +00:00
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.
This commit is contained in:
parent
6cf0702a79
commit
d32a337cf3
1 changed files with 16 additions and 12 deletions
|
@ -6,8 +6,9 @@
|
||||||
# Usage: makesetup [-s dir] [-c file] [-m file] [Setup] ... [-n [Setup] ...]
|
# Usage: makesetup [-s dir] [-c file] [-m file] [Setup] ... [-n [Setup] ...]
|
||||||
#
|
#
|
||||||
# Options:
|
# Options:
|
||||||
# -s directory: alternative source directory (default derived from $0)
|
# -s directory: alternative source directory (default .)
|
||||||
# -c file: alternative config.c template (default $srcdir/config.c.in)
|
# -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
|
# -c -: don't write config.c
|
||||||
# -m file: alternative Makefile template (default ./Makefile.pre)
|
# -m file: alternative Makefile template (default ./Makefile.pre)
|
||||||
# -m -: don't write Makefile
|
# -m -: don't write Makefile
|
||||||
|
@ -40,9 +41,10 @@
|
||||||
|
|
||||||
# Loop over command line options
|
# Loop over command line options
|
||||||
usage='
|
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] ...]'
|
[Setup] ... [-n [Setup] ...]'
|
||||||
srcdir=''
|
srcdir='.'
|
||||||
|
libdir=''
|
||||||
config=''
|
config=''
|
||||||
makepre=''
|
makepre=''
|
||||||
noobjects=''
|
noobjects=''
|
||||||
|
@ -51,6 +53,7 @@ while :
|
||||||
do
|
do
|
||||||
case $1 in
|
case $1 in
|
||||||
-s) shift; srcdir=$1; shift;;
|
-s) shift; srcdir=$1; shift;;
|
||||||
|
-l) shift; libdir=$1; shift;;
|
||||||
-c) shift; config=$1; shift;;
|
-c) shift; config=$1; shift;;
|
||||||
-m) shift; makepre=$1; shift;;
|
-m) shift; makepre=$1; shift;;
|
||||||
--) shift; break;;
|
--) shift; break;;
|
||||||
|
@ -60,16 +63,16 @@ do
|
||||||
esac
|
esac
|
||||||
done
|
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)
|
# (Not all systems have dirname)
|
||||||
case $srcdir in
|
case $srcdir in
|
||||||
'') case $0 in
|
'') case $0 in
|
||||||
*/*) srcdir=`echo $0 | sed 's,/[^/]*$,,'`;;
|
*/*) libdir=`echo $0 | sed 's,/[^/]*$,,'`;;
|
||||||
*) srcdir=.;;
|
*) libdir=.;;
|
||||||
esac;;
|
esac;;
|
||||||
esac
|
esac
|
||||||
case $config in
|
case $config in
|
||||||
'') config=$srcdir/config.c.in;;
|
'') config=$libdir/config.c.in;;
|
||||||
esac
|
esac
|
||||||
case $makepre in
|
case $makepre in
|
||||||
'') makepre=Makefile.pre;;
|
'') makepre=Makefile.pre;;
|
||||||
|
@ -82,9 +85,9 @@ NL='\
|
||||||
# Setup to link with extra libraries when makeing shared extensions.
|
# Setup to link with extra libraries when makeing shared extensions.
|
||||||
# Currently, only Cygwin needs this baggage.
|
# Currently, only Cygwin needs this baggage.
|
||||||
case `uname -s` in
|
case `uname -s` in
|
||||||
CYGWIN*) if test $srcdir = .
|
CYGWIN*) if test $libdir = .
|
||||||
then
|
then
|
||||||
ExtraLibDir=..
|
ExtraLibDir=.
|
||||||
else
|
else
|
||||||
ExtraLibDir='$(LIBPL)'
|
ExtraLibDir='$(LIBPL)'
|
||||||
fi
|
fi
|
||||||
|
@ -204,17 +207,18 @@ sed -e 's/[ ]*#.*//' -e '/^[ ]*$/d' |
|
||||||
*.m) obj=`basename $src .m`.o; cc='$(CXX)';; # Obj-C
|
*.m) obj=`basename $src .m`.o; cc='$(CXX)';; # Obj-C
|
||||||
*) continue;;
|
*) continue;;
|
||||||
esac
|
esac
|
||||||
|
obj="$srcdir/$obj"
|
||||||
objs="$objs $obj"
|
objs="$objs $obj"
|
||||||
case $src in
|
case $src in
|
||||||
glmodule.c) ;;
|
glmodule.c) ;;
|
||||||
/*) ;;
|
/*) ;;
|
||||||
\$*) ;;
|
\$*) ;;
|
||||||
*) src='$(srcdir)/'$src;;
|
*) src='$(srcdir)/'"$srcdir/$src";;
|
||||||
esac
|
esac
|
||||||
case $doconfig in
|
case $doconfig in
|
||||||
no) cc="$cc \$(CCSHARED)";;
|
no) cc="$cc \$(CCSHARED)";;
|
||||||
esac
|
esac
|
||||||
rule="$obj: $src; $cc $cpps \$(CFLAGS) -c $src"
|
rule="$obj: $src; $cc $cpps \$(CFLAGS) -c $src -o $obj"
|
||||||
echo "$rule" >>$rulesf
|
echo "$rule" >>$rulesf
|
||||||
done
|
done
|
||||||
case $doconfig in
|
case $doconfig in
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue