* Modules/makesetup: support C++ files now; these should be given

as file.C or file.cc or file.c++; C files can be given as file.c
	(instead of file.o, which is still supported)
This commit is contained in:
Guido van Rossum 1994-08-23 13:49:15 +00:00
parent 794d81313b
commit 0b498beea2
1 changed files with 36 additions and 1 deletions

View File

@ -92,14 +92,23 @@ sed -e 's/[ ]*#.*//' -e '/^[ ]*$/d' |
OBJS=
LIBS=
RULES=
LOCALLIBS=
BASELIBS=
while read line
do
# Output DEFS in reverse order so first definition overrides
case $line in
*=*) DEFS="$line$NL$DEFS"; continue;;
'<noobjects>') noobjects=yes; continue;;
'<noobjects>')
case $noobjects in
yes) ;;
*) LOCALLIBS=$LIBS; LIBS=;;
esac
noobjects=yes;
continue;;
esac
objs=
srcs=
cpps=
set $line
for arg
@ -109,6 +118,9 @@ sed -e 's/[ ]*#.*//' -e '/^[ ]*$/d' |
-[A-Zl]*) LIBS="$LIBS $arg";;
*.a) LIBS="$LIBS $arg";;
*.o) objs="$objs $arg";;
*.[cC]) srcs="$srcs $arg";;
*.cc) srcs="$srcs $arg";;
*.c++) srcs="$srcs $arg";;
*.*) echo 1>&2 "bad word $arg in $line"
exit 1;;
[a-zA-Z_]*) MODS="$MODS $arg";;
@ -129,8 +141,31 @@ sed -e 's/[ ]*#.*//' -e '/^[ ]*$/d' |
RULES="$RULES$obj: $src; \$(CC) \$(CFLAGS) $cpps -c $src$NL"
done
OBJS="$OBJS $objs"
for src in $srcs
do
case $src in
*.c) obj=`basename $src .c`.o; cc='$(CC)';;
*.cc) obj=`basename $src .cc`.o; cc='$(CCC)';;
*.c++) obj=`basename $src .c++`.o; cc='$(CCC)';;
*.C) obj=`basename $src .C`.o; cc='$(CCC)';;
*) continue;;
esac
case $src in
glmodule.c) ;;
*) src='$(srcdir)/'$src;;
esac
RULES="$RULES$obj: $src; $cc \$(CFLAGS) $cpps -c $src$NL"
done
done
case $noobjects in
yes) BASELIBS=$LIBS;;
*) LOCALLIBS=$LIBS;;
esac
LIBS='$(LOCALMODLIBS) $(BASEMODLIBS)'
DEFS="BASEMODLIBS=$BASELIBS$NL$DEFS"
DEFS="LOCALMODLIBS=$LOCALLIBS$NL$DEFS"
EXTDECLS=
INITBITS=
for mod in $MODS