#
# Mach Operating System
# Copyright (c) 1991,1990 Carnegie Mellon University
# All Rights Reserved.
# 
# Permission to use, copy, modify and distribute this software and its
# documentation is hereby granted, provided that both the copyright
# notice and this permission notice appear in all copies of the
# software, derivative works or modified versions, and any portions
# thereof, and that both notices appear in supporting documentation.
# 
# CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS 
# CONDITION.  CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
# ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
# 
# Carnegie Mellon requests users of this software to return to
# 
#  Software Distribution Coordinator  or  Software.Distribution@CS.CMU.EDU
#  School of Computer Science
#  Carnegie Mellon University
#  Pittsburgh PA 15213-3890
# 
# any improvements or extensions that they make and grant Carnegie the
# rights to redistribute these changes.
#
#
# HISTORY
# $Log:	Makefile,v $
# Revision 2.8  91/12/13  14:42:05  jsb
# 	Changed to reflect new directory structure.
# 	[91/12/12            mrt]
# 
# Revision 2.7  91/09/12  16:54:12  bohman
# 	Added mac2.
# 	[91/09/11  17:22:34  bohman]
# 
# Revision 2.6  91/08/24  12:29:43  af
# 	Fine tuning: ... -if vs if
# 	[91/08/14            rvb]
# 	Fixed release to actually link each time.
# 	[91/07/23            danner]
# 
# Revision 2.5.3.1  91/08/19  13:49:07  danner
# 	Fine tuning: ... -if vs if
# 	[91/08/14            rvb]
# 	Fixed release to actually link each time.
# 	[91/07/23            danner]
# 
# Revision 2.5  91/02/05  17:54:02  mrt
# 	Changed to new Mach copyright
# 	[91/02/01  17:53:29  mrt]
# 
# Revision 2.4  90/12/14  11:02:05  jsb
# 	Use $(atsys) (as defined in Makeconf) instead of @sys.
# 	[90/12/13  21:42:30  jsb]
# 
# Revision 2.3  90/11/05  14:32:28  rpd
# 	SUN->SUN3.
# 	[90/10/31            rwd]
# 	Change MACHINE to TARGET_MACHINE.
# 	[90/10/29            rwd]
# 
# Revision 2.2  90/06/02  15:04:16  rpd
# 	Don't use /usr/cs/etc/install; 386 doesn't have it.
# 	[90/06/01            rpd]
# 
# 	Created for new IPC.
# 	[90/03/26  21:09:47  rpd]
# 
#

all:		mig.sh migcom

KSRC=/usr1/gnu/mach
DDIR=/usr1/gnu/DIST/bin
DLIB=/usr1/gnu/DIST/lib

OBJS	 =	mig.o parser.o lexxer.o error.o string.o type.o routine.o \
		statement.o global.o header.o user.o server.o utils.o

CFLAGS= -g -O -I$(KSRC)

migcom:	$(OBJS)
	$(CC) -o migcom $(CFLAGS) $(OBJS) -ll

parser.c parser.h:	parser.y
	yacc -d parser.y &&		\
	mv y.tab.c parser.c &&		\
	mv y.tab.h parser.h

lexxer.c:	lexxer.l
	lex lexxer.l &&			\
	mv lex.yy.c lexxer.c

install:
	cp mig.sh $(DDIR)/mig
	chmod ugo+x $(DDIR)/mig
	cp migcom $(DLIB)/migcom

clean:
	rm -f *.o migcom lexxer.c parser.c parser.h