#
# |-----------------------------------------------------------|
# | Copyright (c) 1990 MIPS Computer Systems, Inc.            |
# | All Rights Reserved                                       |
# |-----------------------------------------------------------|
# |          Restricted Rights Legend                         |
# | Use, duplication, or disclosure by the Government is      |
# | subject to restrictions as set forth in                   |
# | subparagraph (c)(1)(ii) of the Rights in Technical        |
# | Data and Computer Software Clause of DFARS 52.227-7013.   |
# |         MIPS Computer Systems, Inc.                       |
# |         928 Arques Avenue                                 |
# |         Sunnyvale, CA 94086                               |
# |-----------------------------------------------------------|
#
# $Header: Makefile,v 1.2.2.2 92/11/19 16:24:54 marker Exp $
#
SHELL	=/bin/sh
ETCDIR	=/etc

DESTROOT=

MAXOPT	=-O1
INCLUDE	=
CFLAGS	=$(MAXOPT) -DRISCOS -D_KMEMUSER -D_RISCOS $(INCLUDE) $(ECFLAGS)
ASFLAGS =$(EASFLAGS)
LFLAGS	=$(ELFLAGS)
YFLAGS	=$(EYFLAGS)

LIBRARIES=-lmld
LOCAL_LIBS=

WHEREIGO=$(DESTROOT)/usr/sbin

OBJS	=main.o symtab.o util.o vtop.o init.o stat.o proc.o u.o

SRCS	=main.c symtab.c util.c vtop.c init.c stat.c proc.c u.c

OBSOLETESRCS =

HDRS	=crash.h

WHOAMI	=sysdef

INSTALL	=$(ETCDIR)/mipsinstall
MODE	=4555
OWNER	=root
GROUP	=bin
ISTRIP	=-s
ICOPY	=-c
INSTOPTS=$(ICOPY) $(ISTRIP) -m $(MODE) -o $(OWNER) -g $(GROUP)

all: $(WHOAMI)

install: $(WHOAMI)
	$(INSTALL) $(INSTOPTS) -l $(DESTROOT)/etc/$(WHOAMI) $(WHOAMI) $(WHEREIGO)

$(WHOAMI): $(OBJS) $(LOCAL_LIBS)
	$(CC) $(CFLAGS) -o $(WHOAMI) $(OBJS) $(LOCAL_LIBS) $(LIBRARIES)

clean:
	-rm -f $(OBJS)
	-rm -f symtab.c util.c vtop.c init.c stat.c proc.c u.c crash.h

clobber: clean
	-rm -f $(WHOAMI)

generic:
	$(GENERIC) -s $(SRCS) -h $(HDRS) -o $(OBJS) -p $(WHOAMI) \
		$(INCLUDE) -R$(DESTROOT) -D$(WHEREIGO)

$(OBJS):	$(HDRS)

symtab.o: symtab.c crash.h

symtab.c: ../crash/symtab.c
	[ ! -r symtab.c ] || rm -f login.c
	ln -s ../crash/symtab.c symtab.c

util.o: util.c crash.h

util.c: ../crash/util.c
	[ ! -r util.c ] || rm -f util.c
	ln -s ../crash/util.c util.c

vtop.o: vtop.c crash.h

vtop.c: ../crash/vtop.c
	[ ! -r vtop.c ] || rm -f vtop.c
	ln -s ../crash/vtop.c vtop.c

init.o: init.c crash.h

init.c: ../crash/init.c
	[ ! -r init.c ] || rm -f init.c
	ln -s ../crash/init.c init.c

stat.c: ../crash/stat.c
	[ ! -r stat.c ] || rm -f stat.c
	ln -s ../crash/stat.c stat.c

proc.o: proc.c crash.h

proc.c: ../crash/proc.c
	[ ! -r proc.c ] || rm -f proc.c
	ln -s ../crash/proc.c proc.c

u.o: u.c crash.h

u.c: ../crash/u.c
	[ ! -r u.c ] || rm -f u.c
	ln -s ../crash/u.c u.c

crash.h: ../crash/crash.h
	[ ! -r crash.h ] || rm -f crash.h
	ln -s ../crash/crash.h crash.h
