#
#
# HISTORY
#
# 12-Dec-88 Mary Thompson
#	Added subdir gdb
#
#  8-Dec-88 Mary Thompson
#	Changed to install vmpinfo,vmoprint,vmmprint and zprint
#	with group kmem and set gid.
#
# 14-Dec-87 Mary Thompson
#	Added mpr
#
# 11-may-87 Mary Thompson
#	Added start_rem_server
#
# 25-Mar-87  Mary Thompson
#	Added macherr
#
# 19-Mar-87  Mary Thompson
#	Removed timemode.
#
# 10-Feb-87  Mary Thompson
#	put zprint and vmoprint and timemode last because they
#	don't compile on RT
#
#  2-Feb-87  Mary Thompson
#	Removed flamingo from SUBDIRS
#

DSTDIR=/usr/nmach
INSTALL_DIR=$(DSTDIR)/bin
TARGET_DIRS=${INSTALL_DIR}
SRCDIR=${DSTDIR}/src
LIBS = $(LIBMACH)

# C programs that live in the current directory, have one source file
# and do not need any libraries

PRGM1=	format toc


# C programs that live in the current directory, have one source
# file and  need the mach libraries

PRGM1L=	hostinfo macherr vm_stat mpr

#
# Programs that live in subdirectories, and have makefiles of their own.

SUBS=	 start_rem_server qvss mig gdb

# Programs that live in the current directory, but need to be
# installed with group = kmem and setgid

KMEM_SRCS = vmpinfo.c vmmprint.c zprint.c vmoprint.c
KMEM_OBJS = $(KMEM_SRCS:.c=o)
KMEM_PRGMS = $(KMEM_SRCS:.c=)
INSTALL_KMEM = $(KMEM_SRCS:.c=.install)

include $(SRCDIR)/Make.inc

#??? do we have to be sure md is made before subs?
all:	md $(KMEM_PRGMS)

install:  md.install ${INSTALL_KMEM}


$(INSTALL_KMEM): $$(@:.install=)
	-@mach_install $I -g kmem -m 2755 $(@:.install=) ${INSTALL_DIR}
	-@touch $*.install

$(KMEM_PRGMS): $$(@:=.o)
	$(CC) $(@:=.o) -o $@

# needs special rule to not use md since it may not exist yet
md.install: md
	-@mach_install $I md ${INSTALL_DIR}
	-@touch md.install

md: md.o
	$(CC) -o md md.o
md.o: md.c
	${CC} -c $(CFLAGS) md.c
	-@rm md.d



	
