# FileName	[ Makefile ]
#
# PackageName	[ NuSMV ]
#
# Synopsis	[ LTL translator Makefile ]
#
# Description	[ Makefile for the LTL translator  ]
#
# SeeAlso	[]
#
# Author	[Marco Roveri]
#
# Copyright	[Copyright (C) 1998-2001 by CMU and ITC-irst. 
#
# NuSMV version 2 is free software; you can redistribute it and/or 
# modify it under the terms of the GNU Lesser General Public 
# License as published by the Free Software Foundation; either 
# version 2 of the License, or (at your option) any later version.
#
# NuSMV version 2 is distributed in the hope that it will be useful, 
# but WITHOUT ANY WARRANTY; without even the implied warranty of 
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public 
# License along with this library; if not, write to the Free Software 
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA.
#
# For more information of NuSMV see <http://nusmv.irst.itc.it>
# or email to <nusmv-users@irst.itc.it>.
# Please report bugs to <nusmv-users@irst.itc.it>.
#
# To contact the NuSMV development board, email to <nusmv@irst.itc.it>.]
#
# Revision	[$Id: Makefile,v 1.1.1.1 2003/02/06 19:01:18 flerda Exp $]

OUTPUTFILE = ltl2smv
OFILES = parser.o lexer.o l2s.o
HFILES = l2s.h parser.h

CC = gcc
LINK = gcc
LINK_FLAGS = #-g
CCFLAGS = -c #-g
YACC = bison
YACC_FLAGS = -y -d
LEX = flex
LEX_FLAG = -l
RM = rm -f

.SILENT:

all:	$(OUTPUTFILE)

$(OUTPUTFILE): $(OFILES) $(HFILES)
	@echo Creating $(OUTPUTFILE)
	$(LINK) $(LINK_FLAGS) $(OFILES) -o $(OUTPUTFILE)

parser.h: parser.o

parser.o: yacc.y  l2s.h
	@echo Compiling parser.c into parser.o
	$(YACC) $(YACC_FLAGS) -o parser.c yacc.y
	$(CC) $(CCFLAGS)$  parser.c -o parser.o

lexer.o: lex.l $(HFILES)
	@echo Compiling lexer.c into lexer.o
	$(LEX) $(LEX_FLAG) -olexer.c lex.l
	$(CC) $(CCFLAGS)$  lexer.c -o lexer.o

l2s.o:  $(HFILES)
	@echo Compiling l2s.c into l2s.o
	$(CC) $(CCFLAGS)$  l2s.c -o l2s.o

clean: 
	$(RM) $(OFILES) parser.c lexer.c parser.h $(OUTPUTFILE)
