# *************************************************************
#	om	- Lambda Beta CAST builder
# *************************************************************
#***********************************
#  (C) Copyright 1992-1993; dit/upm
#  Distributed under the conditions stated in the
#  TOPO General Public License (see file LICENSE)
#***********************************
# $Id: makefile,v 1.22 1995/01/11 12:06:06 lotos Exp $

TOOL=	om
TRGT=	om

GRAMMAR=	LBM

SRCS=	$(TRGT).c rag.c basic.c
OBJS=	$(TRGT).o rag.o basic.o
HS=	swbus.h omnodes.h omgrc.h

INCDIRS= -I$(EPSINC) -I$(TOPOINC)
LIBDIRS= -L$(EPSLIB) -L$(TOPOLIB)
CFLAGS=	$(CF_DBX) $(INCDIRS)

$(TRGT):	$(OBJS)
	$(CC) $(CFLAGS) $(LIBDIRS) -o $@ $(OBJS) -lcast -lrag

$(OBJS):	$(HS)

install::	$(TRGT)
	cp $(TRGT) $(TOPOBIN)
	chmod a+x $(TOPOBIN)/$(TRGT)

install::	omnodes.h omgrc.h
	cp omnodes.h omgrc.h $(TOPOINC)
	chmod a+r $(TOPOINC)/omnodes.h
	chmod a+r $(TOPOINC)/omgrc.h

install::	omcolours.h omcolours.c
	cp omcolours.h omcolours.c $(TOPOINC)
	chmod a+r $(TOPOINC)/omcolours.h
	chmod a+r $(TOPOINC)/omcolours.c

install::
	touch install

gram.c:	gram.y
	-chmod u+w $@
	-$(YACC) $(YFLAGS) gram.y && mv y.tab.c $@

clean::
	-rm -f $(TRGT)
	-rm -f $(OBJS)
	-rm -f core *~

#----------------------------------------------------------
