V10/libc/mkfile

#
#	to add a file, do two things:
#	add a line saying the name of the archive element
#	and add a line at end of file saying where the source is.
#
NPROC=2
L=libc.a
OBJ=$L(_assert.o) $L(_cleanup.o) $L(_exit.o) $L(_printnum.o) $L(abort.o)\
	$L(LL.o) $L(abs.o) $L(access.o) $L(acct.o) $L(alarm.o)\
	$L(asin.o) $L(atan.o) $L(atexit.o) $L(atof.o) $L(atoi.o) $L(atol.o)\
	$L(biasclock.o) $L(calloc.o) $L(cerror.o)\
	$L(chdir.o) $L(chmod.o) $L(chown.o) $L(chroot.o) $L(chrtab.o)\
	$L(close.o) $L(closedir.o) $L(clrerr.o) $L(creat.o) $L(crypt.o) $L(ctime.o)\
	$L(cttyname.o) $L(ctype.o) $L(data.o) $L(dialout.o) $L(dirread.o)\
	$L(doprint.o) $L(_dtoa.o) $L(_fconv.o) $L(snprintf.o) $L(strtod.o)\
	$L(fscanf.o) $L(vfprintf.o) $L(vfscanf.o) $L(vprintf.o) $L(sscanf.o)\
	$L(dup.o) $L(ecvt.o) $L(erf.o) $L(errlst.o) $L(execl.o) $L(execle.o)\
	$L(execv.o) $L(execve.o) $L(execvp.o) $L(exit.o) $L(exp.o) $L(fabs.o) $L(fchmod.o)\
	$L(fchown.o) $L(fdopen.o) $L(fgetc.o) $L(fgets.o) $L(filbuf.o)\
	$L(fioclose.o) $L(fioflush.o) $L(fiogetc.o) $L(fioinit.o)\
	$L(fiofillbuf.o) $L(fioputc.o)\
	$L(fiordline.o) $L(fioread.o) $L(fioseek.o) $L(fioundo.o) $L(fioprint.o)\
	$L(fiowrite.o) $L(fiotie.o) $L(floor.o)\
	$L(fmount.o) $L(funmount.o)\
	$L(flsbuf.o) $L(fmod.o) $L(fopen.o) $L(fork.o) $L(fprintf.o) $L(fputc.o)\
	$L(fputs.o) $L(freopen.o) $L(frexp.o) $L(fseek.o) $L(fstab.o) $L(fstat.o)\
	$L(ftell.o) $L(ftw.o) $L(galloc.o) $L(gamma.o) $L(gcd.o)\
	$L(gcvt.o) $L(getchar.o)\
	$L(getenv.o) $L(getgid.o) $L(getgrent.o) $L(getgrgid.o)\
	$L(getfields.o) $L(getflags.o) $L(getgroups.o)\
	$L(getgrnam.o) $L(getlog.o) $L(getlogin.o) $L(getopt.o) $L(getpass.o)\
	$L(getpid.o) $L(getpwent.o) $L(getpwnam.o) $L(getpwuid.o)\
	$L(getshares.o) $L(getshput.o) $L(getuid.o)\
	$L(getw.o) $L(getwd.o) $L(huff.o) $L(hypot.o)\
	$L(ioctl.o) $L(iread.o) $L(isatty.o)\
	$L(jterm.o) $L(besj0.o) $L(besj1.o)\
	$L(besjn.o) $L(kill.o) $L(l3tol.o) $L(lcm.o) $L(ldexp.o)\
	$L(linedis.o) $L(link.o)\
	$L(label.o) $L(limits.o)\
	$L(log.o) $L(lseek.o) $L(llseek.o) $L(lstat.o) $L(ltol3.o)\
	$L(malloc.o) $L(max.o) $L(mcount.o) $L(memccpy.o) $L(memchr.o) $L(memcmp.o)\
	$L(memcpy.o) $L(memmove.o) $L(memset.o) $L(min.o) $L(mkdir.o) $L(mknod.o) $L(mktemp.o)\
	$L(modf.o) $L(mon.o) $L(nametty.o) $L(nap.o) $L(nice.o) $L(nlist.o)\
	$L(onexit.o) $L(open.o) $L(opendir.o) $L(openshares.o) $L(pdirread.o)\
	$L(perror.o) $L(pipe.o) $L(popen.o) $L(pow.o) $L(pow10.o)\
	$L(print.o) $L(printf.o)\
	$L(prof.o) $L(putchar.o) $L(puts.o)\
	$L(putshares.o) $L(putw.o) $L(qsort.o)\
	$L(rand.o) $L(rdwr.o) $L(read.o) $L(readdir.o) $L(readlink.o) $L(reboot.o)\
	$L(regcomp.o) $L(regerror.o) $L(regexec.o) $L(regsub.o) $L(rew.o)\
	$L(rmdir.o) $L(sbrk.o) $L(scanf.o) $L(seekdir.o)\
	$L(select.o) $L(setbuf.o) $L(setgid.o) $L(setgroups.o)\
	$L(setjmp.o) $L(setlimits.o) $L(setpgrp.o)\
	$L(setruid.o) $L(setuid.o) $L(setupgroups.o) $L(setupshares.o)\
	$L(sgn.o) $L(signal.o) $L(sin.o)\
	$L(sinh.o) $L(sleep.o) $L(sprintf.o) $L(sqrt.o) $L(stat.o) $L(stime.o)\
	$L(strcat.o) $L(strchr.o) $L(strcmp.o) $L(strcpy.o)\
	$L(strcspn.o) $L(strdup.o) $L(strlen.o) $L(strncat.o)\
	$L(strncmp.o) $L(strncpy.o) $L(strout.o) $L(strpbrk.o) $L(strrchr.o)\
	$L(strspn.o) $L(strtok.o) $L(strtol.o) $L(strtoul.o) \
	$L(stuff.o) $L(swab.o) $L(swapon.o)\
	$L(symlink.o) $L(sync.o) $L(syscall.o) $L(system.o) $L(tan.o) $L(tanh.o)\
	$L(telldir.o) $L(time.o) $L(timec.o) $L(times.o) $L(timezone.o) $L(tmpnam.o)\
	$L(tolower.o) $L(toupper.o) $L(ttyname.o) $L(udiv.o) $L(umask.o)\
	$L(uname.o) $L(ungetc.o) $L(unlink.o) $L(urem.o) $L(utime.o)\
	$L(vadvise.o) $L(vlimit.o) $L(vtimes.o) $L(wait.o)\
	$L(wait3.o) $L(write.o)

LCCARGS = -c -N -Istdio -I/usr/include/lcc -I/usr/include/libc -I/usr/include -DV10

DESTDIR=
BUILTINS=

all:V:	libc.a libdmalloc.a

#	goo for no onexit
#	rm -f libc.a
#	cd o; ar qc ../libc.a `lorder *.o | tsort`
#	ar ma flsbuf.o libc.a exit.o
#	ar m libc.a cleanup.o

libc.a:Q:	$OBJ
	unset prereq
	names=`membername $newprereq`
	ar rv libc.a $names && rm $names
	ranlib libc.a

libdmalloc.a:	gen/malloc.c
	cp $prereq goo.c
	lcc $CFLAGS -Ddebug -c goo.c
	ar rv libdmalloc.a goo.o && rm goo.[co]

clean:
	rm -f libc.a libdmalloc.a

install:V: $DESTDIR/lib/libc.a $DESTDIR/lib/crt0.o $DESTDIR/lib/mcrt0.o\
		$DESTDIR/usr/lib/libdmalloc.a

$DESTDIR/lib/libc.a: libc.a
	cp $target liboc.a
	cp libc.a $target
	ranlib $target

$DESTDIR/lib/crt0.o: crt0.o
	cp crt0.o $DESTDIR/lib

$DESTDIR/lib/mcrt0.o: mcrt0.o
	cp mcrt0.o $DESTDIR/lib

$DESTDIR/usr/lib/libdmalloc.a:	libdmalloc.a
	cp libdmalloc.a $target
	ranlib $target

crt0.o:	csu/crt0.s
	cc -S csu/crt0.s

mcrt0.o:	csu/mcrt0.s
	cc -S csu/mcrt0.s

$L(%.o):N:	%.o

%.o:
	cc -O -c $prereq
	ld -o $nproc.o -x -r $target && mv $nproc.o $target

errlst.o: gen/errlst.c
	cc -S gen/errlst.c
	ed - <gen/:errfix errlst.s
	as -o errlst.o errlst.s
	ld -o $nproc.o -x -r errlst.o && mv $nproc.o errlst.o
	rm errlst.s

fioclose.o:	fio/fioclose.c /usr/include/fio.h
fiofillbuf.o:	fio/fiofillbuf.c /usr/include/fio.h
fioflush.o:	fio/fioflush.c /usr/include/fio.h
fiogetc.o:	fio/fiogetc.c /usr/include/fio.h
fioinit.o:	fio/fioinit.c /usr/include/fio.h
fiotie.o:	fio/fiotie.c /usr/include/fio.h
fioputc.o:	fio/fioputc.c /usr/include/fio.h
fioprint.o:	fio/fioprint.c /usr/include/fio.h
fiordline.o:	fio/fiordline.c /usr/include/fio.h
fioread.o:	fio/fioread.c /usr/include/fio.h
fioseek.o:	fio/fioseek.c /usr/include/fio.h
fioundo.o:	fio/fioundo.c /usr/include/fio.h
fiowrite.o:	fio/fiowrite.c /usr/include/fio.h
mcount.o:	gen/mcount.s
udiv.o:	gen/udiv.s
urem.o:	gen/urem.s
_assert.o:	gen/_assert.c
_cleanup.o:	gen/_cleanup.c /usr/include/libc.h
_printnum.o:	gen/_printnum.c
LL.o:		gen/LL.c
abort.o:	gen/abort.c
abs.o:	gen/abs.s
atexit.o:	gen/atexit.c /usr/include/libc.h
atof.o:	gen/atof.c
atoi.o:	gen/atoi.c
atol.o:	gen/atol.c
calloc.o:	gen/calloc.c
chrtab.o:	gen/chrtab.c
closedir.o:	gen/closedir.c
crypt.o:	gen/crypt.c
ctime.o:	gen/ctime.c
cttyname.o:	gen/cttyname.c
ctype.o:	gen/ctype.c
dialout.o:	gen/dialout.c
dirread.o:	sys/dirread.s
doprint.o:	gen/doprint.c
ecvt.o:	gen/ecvt.c
execvp.o:	gen/execvp.c
exit.o:	gen/exit.c
frexp.o:	gen/frexp.s
ftw.o:	gen/ftw.c
galloc.o:	gen/galloc.c
gcd.o:	gen/gcd.c
getenv.o:	gen/getenv.c
getfields.o:	gen/getfields.c
getflags.o:	gen/getflags.c
getlogin.o:	gen/getlogin.c
getopt.o:	gen/getopt.c
getshares.o:	gen/getshares.c
getshput.o:	gen/getshput.c
getwd.o:	gen/getwd.c
iread.o:	gen/iread.c
isatty.o:	gen/isatty.c
l3tol.o:	gen/l3tol.c
lcm.o:	gen/lcm.c
ldexp.o:	gen/ldexp.s
linedis.o:	gen/linedis.c
ltol3.o:	gen/ltol3.c
malloc.o:	gen/malloc.c
	lcc $CFLAGS -c $prereq
max.o:	gen/max.c
memccpy.o:	gen/memccpy.s
memchr.o:	gen/memchr.s
memcmp.o:	gen/memcmp.s
memcpy.o:	gen/memcpy.s
memmove.o:	gen/memmove.c
	lcc $LCCARGS $prereq
memset.o:	gen/memset.s
min.o:	gen/min.c
mktemp.o:	gen/mktemp.c
modf.o:	gen/modf.s
mon.o:	gen/mon.c
nlist.o:	gen/nlist.c
nametty.o:	gen/nametty.c
onexit.o:	gen/onexit.c /usr/include/libc.h
opendir.o:	gen/opendir.c
openshares.o:	gen/openshares.c
pdirread.o:	gen/pdirread.c
perror.o:	gen/perror.c
print.o:	gen/print.c
putshares.o:	gen/putshares.c
qsort.o:	gen/qsort.c
	lcc -c $prereq
	ld -o $nproc.o -x -r $target && mv $nproc.o $target
rand.o:	gen/rand.c
readdir.o:	gen/readdir.c
regcomp.o:	gen/regcomp.c
regerror.o:	gen/regerror.c
regexec.o:	gen/regexec.c
regprog.o:	gen/regprog.h
regsub.o:	gen/regsub.c
seekdir.o:	gen/seekdir.c
setlimits.o:	gen/setlimits.c
setupgroups.o:	gen/setupgroups.c
setupshares.o:	gen/setupshares.c
sgn.o:	gen/sgn.c
sleep.o:	gen/sleep.c
strcat.o:	gen/strcat.s
strchr.o:	gen/strchr.s
strcmp.o:	gen/strcmp.s
strcpy.o:	gen/strcpy.s
strcspn.o:	gen/strcspn.s
strdup.o:	gen/strdup.c
strlen.o:	gen/strlen.s
strncat.o:	gen/strncat.s
strncmp.o:	gen/strncmp.s
strncpy.o:	gen/strncpy.s
strpbrk.o:	gen/strpbrk.s
strrchr.o:	gen/strrchr.c
strspn.o:	gen/strspn.s
strtok.o:	gen/strtok.c
strtol.o:	gen/strtol.c
strtoul.o:	gen/strtoul.c
swab.o:	gen/swab.c
telldir.o:	gen/telldir.c
timec.o:	gen/timec.c
timezone.o:	gen/timezone.c
tolower.o:	gen/tolower.c
toupper.o:	gen/toupper.c
ttyname.o:	gen/ttyname.c
uname.o:	gen/uname.c
asin.o:	math/asin.c
atan.o:	math/atan.c
erf.o:	math/erf.c
exp.o:	math/exp.c
fabs.o:	math/fabs.s
floor.o:	math/floor.c
fmod.o:	math/fmod.c
gamma.o:	math/gamma.c
huff.o:		gen/huff.c
hypot.o:	math/hypot.c
besj0.o:	math/besj0.c
besj1.o:	math/besj1.c
besjn.o:	math/besjn.c
log.o:	math/log.c
pow.o:	math/pow.c
pow10.o:	math/pow10.c
sin.o:	math/sin.c
sinh.o:	math/sinh.c
sqrt.o:	math/sqrt.c
tan.o:	math/tan.c
tanh.o:	math/tanh.c
clrerr.o:	stdio/clrerr.c
data.o:	stdio/data.c
fdopen.o:	stdio/fdopen.c
fgetc.o:	stdio/fgetc.c
fgets.o:	stdio/fgets.c
	lcc $LCCARGS stdio/fgets.c
filbuf.o:	stdio/filbuf.c
flsbuf.o:	stdio/flsbuf.c
fopen.o:	stdio/fopen.c
_dtoa.o:	stdio/_dtoa.c stdio/fconv.h
_fconv.o:	stdio/_fconv.c stdio/fconv.h
sscanf.o:	stdio/sscanf.c stdio/iolib.h
snprintf.o:	stdio/snprintf.c stdio/iolib.h
strtod.o:	stdio/strtod.c stdio/fconv.h
vfprintf.o:	stdio/vfprintf.c stdio/iolib.h
fscanf.o:	stdio/fscanf.c stdio/iolib.h
vfscanf.o:	stdio/vfscanf.c stdio/iolib.h
vprintf.o:	stdio/vprintf.c stdio/iolib.h
fprintf.o:	stdio/fprintf.c stdio/iolib.h
fputc.o:	stdio/fputc.c
fputs.o:	stdio/fputs.c
	lcc $LCCARGS stdio/fputs.c
freopen.o:	stdio/freopen.c
fseek.o:	stdio/fseek.c
fstab.o:	gen/fstab.c
ftell.o:	stdio/ftell.c
gcvt.o:	stdio/gcvt.c
getchar.o:	stdio/getchar.c
getgrent.o:	stdio/getgrent.c
getgrgid.o:	stdio/getgrgid.c
getgrnam.o:	stdio/getgrnam.c
getpass.o:	stdio/getpass.c
getpwent.o:	stdio/getpwent.c
getpwnam.o:	stdio/getpwnam.c
getpwuid.o:	stdio/getpwuid.c
getw.o:	stdio/getw.c
popen.o:	stdio/popen.c
printf.o:	stdio/printf.c stdio/iolib.h
putchar.o:	stdio/putchar.c
puts.o:	stdio/puts.c
putw.o:	stdio/putw.c
rdwr.o:	stdio/rdwr.c
	lcc $LCCARGS stdio/rdwr.c
rew.o:	stdio/rew.c
scanf.o:	stdio/scanf.c stdio/iolib.h
	lcc $LCCARGS stdio/scanf.c
	ld -o $nproc.o -x -r $target && mv $nproc.o $target
setbuf.o:	stdio/setbuf.c
sprintf.o:	stdio/sprintf.c stdio/iolib.h
	lcc $LCCARGS stdio/sprintf.c
	ld -o $nproc.o -x -r $target && mv $nproc.o $target
stdio/o.o:	stdio/stdio/o.h
strout.o:	stdio/strout.c
stuff.o:	stdio/stuff.c
system.o:	stdio/system.c
tmpnam.o:	gen/tmpnam.c
ungetc.o:	stdio/ungetc.c
_exit.o:	sys/_exit.s
access.o:	sys/access.s
acct.o:	sys/acct.s
alarm.o:	sys/alarm.s
biasclock.o:	sys/biasclock.s
cerror.o:	sys/cerror.s
chdir.o:	sys/chdir.s
chmod.o:	sys/chmod.s
chown.o:	sys/chown.s
chroot.o:	sys/chroot.s
close.o:	sys/close.s
creat.o:	sys/creat.s
dup.o:	sys/dup.s
execl.o:	sys/execl.s
execle.o:	sys/execle.s
execv.o:	sys/execv.s
execve.o:	sys/execve.s
fchmod.o:	sys/fchmod.s
fchown.o:	sys/fchown.s
fmount.o:	sys/fmount.s
fork.o:	sys/fork.s
funmount.o:	sys/funmount.s
fstat.o:	sys/fstat.s
getgid.o:	sys/getgid.s
getgroups.o:	sys/getgroups.s
getlog.o:	sys/getlog.s
getpid.o:	sys/getpid.s
getuid.o:	sys/getuid.s
ioctl.o:	sys/ioctl.s
jterm.o:	gen/jterm.c
kill.o:	sys/kill.s
label.o:	sys/label.c /usr/include/label.h
limits.o:	sys/limits.s
link.o:	sys/link.s
lseek.o:	sys/lseek.s
llseek.o:	sys/llseek.s
lstat.o:	sys/lstat.s
mkdir.o:	sys/mkdir.s
mknod.o:	sys/mknod.s
nap.o:	sys/nap.s
nice.o:	sys/nice.s
open.o:	sys/open.s
pipe.o:	sys/pipe.s
prof.o:	sys/prof.s
read.o:	sys/read.s
readlink.o:	sys/readlink.s
reboot.o:	sys/reboot.s
rmdir.o:	sys/rmdir.s
sbrk.o:	sys/sbrk.s
select.o:	sys/select.s
setgid.o:	sys/setgid.s
setgroups.o:	sys/setgroups.s
setjmp.o:	sys/setjmp.s
setpgrp.o:	sys/setpgrp.s
setruid.o:	sys/setruid.s
setuid.o:	sys/setuid.s
signal.o:	sys/signal.s
stat.o:	sys/stat.s
stime.o:	sys/stime.s
swapon.o:	sys/swapon.s
symlink.o:	sys/symlink.s
sync.o:	sys/sync.s
syscall.o:	sys/syscall.s
time.o:	sys/time.s
times.o:	sys/times.s
umask.o:	sys/umask.s
unlink.o:	sys/unlink.s
utime.o:	sys/utime.s
vadvise.o:	sys/vadvise.s
vfork.o:	sys/vfork.s
vlimit.o:	sys/vlimit.s
vtimes.o:	sys/vtimes.s
wait.o:	sys/wait.s
wait3.o:	sys/wait3.s
write.o:	sys/write.s

atof.o:	gen/atof.c
_dtoa.o:	stdio/_dtoa.c stdio/fconv.h
_fconv.o:	stdio/_fconv.c stdio/fconv.h
sscanf.o:	stdio/sscanf.c stdio/iolib.h
snprintf.o:	stdio/snprintf.c stdio/iolib.h
strtod.o:	stdio/strtod.c stdio/fconv.h
vfprintf.o:	stdio/vfprintf.c stdio/iolib.h
	lcc $LCCARGS stdio/vfprintf.c
fscanf.o:	stdio/fscanf.c stdio/iolib.h
vfscanf.o:	stdio/vfscanf.c stdio/iolib.h
	lcc $LCCARGS stdio/vfscanf.c
vprintf.o:	stdio/vprintf.c stdio/iolib.h
fprintf.o:	stdio/fprintf.c stdio/iolib.h
printf.o:	stdio/printf.c stdio/iolib.h
scanf.o:	stdio/scanf.c stdio/iolib.h
sprintf.o:	stdio/sprintf.c stdio/iolib.h
	lcc $LCCARGS stdio/sprintf.c
	ld -o $nproc.o -x -r $target && mv $nproc.o $target