#
# This is unneeded -- UKERNEL doesn't make it in from the kernel
# makefile, bsd42 is cpp-defined, as is s32.
#
# COPTS	=${IDENT} -UKERNEL -DBSD42 -Ds32

CC	= /bin/cc
# Load pstat as a demand-paged executable.
CFLAGS	= -O ${COPTS} -I../..

CFILES	= pstat.c

PSTAT_OBJS	= pstat.o

LIBS		=/lib/libm.a

#
#	Mathlib and stdio lib
#
LDLIBS	=-lm

INCLUDES=/usr/include/*.h /usr/include/*/*.h

pstat:	${PSTAT_OBJS} ${LIBS}
	${CC} $(CFLAGS) -o pstat pstat.o ${LDLIBS}
	-chmod 775 pstat

pstat.o:	pstat.c

clean:	
	rm -f pstat pstat.o

depend:
	rm -f makedep eddep		junk.fileList
	grep '^#include' ${CFILES} >	junk.fileList
	grep '^#include' ${INCLUDES} >>	junk.fileList
	grep -v '<'		  <	junk.fileList | \
	sed -e 's/:[^"]*"\([^"]*\)".*/: \1/' \
	    -e 's/\.c/.o/' \
	    -e 's,^../[a-zA-Z0-9]*/[a-zA-Z0-9]*\.h,./&,' \
	    -e 's,^../[a-zA-Z0-9]*/,,' \
	    -e 's,\./\.\./,../,' | \
	awk ' { if ($$1 != prev) { print rec; rec = $$0; prev = $$1; } \
		else { if (length(rec $$2) > 78) { print rec; rec = $$0; } \
		       else rec = rec " " $$2 } } \
	      END { print rec } ' > makedep
	echo '/^# DO NOT DELETE THIS LINE/+1,$$d' >eddep
	echo '$$r makedep' >>eddep
	echo 'w' >>eddep
	rm -f makefile.bak
	mv makefile makefile.bak
	cp makefile.bak makefile
	chmod u+w makefile
	ex - makefile < eddep
	rm eddep makedep junk.fileList


# DO NOT DELETE THIS LINE -- make depend uses it

/usr/include/dfs/dfs.h: ../DOT/rpc.h ../DOT/dfs.h ../h/errno.h
/usr/include/efs/efs.h: ../DOT/rpc.h ../DOT/efs.h
/usr/include/machine/necuart.h: ../s32/nec7201.h
/usr/include/rpc/rpc.h: ../DOT/rpc.h
/usr/include/s32/necuart.h: ../s32/nec7201.h
/usr/include/s32dev/vpreg.h: ../h/ioctl.h
/usr/include/sys/inode.h: ../h/socket.h
/usr/include/sys/ioctl.h: ../h/tty.h ../white/mouse.h
/usr/include/sys/kernel.h: ../h/time.h
/usr/include/sys/map.h: ../machine/cpu.h
/usr/include/sys/mbuf.h: ../machine/pte.h
/usr/include/sys/mtio.h: ../h/ioctl.h
/usr/include/sys/param.h: ../machine/param.h ../machine/pte.h ../h/signal.h
/usr/include/sys/param.h: ../h/types.h
/usr/include/sys/proc.h: ../h/time.h
/usr/include/sys/sgtty.h: ../h/ioctl.h
/usr/include/sys/socket.h: ../h/uio.h
/usr/include/sys/tty.h: ../h/ttychars.h ../h/ttydev.h
/usr/include/sys/user.h: ../machine/pcb.h ../h/dmap.h ../h/time.h
/usr/include/sys/user.h: ../h/resource.h ../h/quota.h ../h/inode.h ../h/file.h
/usr/include/sys/user.h: ../h/fs.h ../h/tty.h ../h/dir.h ../h/errno.h
/usr/include/sys/vm.h: ../h/vmparam.h ../h/vmmac.h ../h/vmmeter.h
/usr/include/sys/vm.h: ../h/vmsystm.h
/usr/include/sys/vmmac.h: ../machine/pte.h
/usr/include/sys/vmparam.h: ../machine/vmparam.h
