#===============================================================================
# Makefile
#-------------------------------------------------------------------------------
# Makefile for the GOTE converter.
# Builds eiffel source from scanner and parser definitions
# Also includes various utility targets for running the eiffel compiler etc.
#-------------------------------------------------------------------------------
# Copyright 1999 Sam O'Connor, Sam@OConnor.net, see notice at end of file
#-------------------------------------------------------------------------------
# $Id: Makefile,v 1.2 1999/11/19 21:21:30 sam Exp $
#===============================================================================

GEN_SRC = c_typedef_scanner.e     \
          c_typedef_parser.e      \
          c_typedef_tokens.e      \
          c_enum_scanner.e        \
          c_prototype_scanner.e	  \
          c_prototype_parser.e	  \
          c_prototype_tokens.e	  \
          c_struct_scanner.e	  \
          c_struct_parser.e	  \
          c_struct_tokens.e	  \
          reserved_word_checker.e
#          any_features

SRC = ${GEN_SRC}

#===============================================================================
# Targets
#===============================================================================

all: ${SRC}

freeze: ${SRC}
	es4 -freeze
	cd EIFGEN/W_code ;\
	finish_freezing

finalize: ${SRC}
	es4 -finalize -stop
	cd EIFGEN/F_code ;\
	finish_freezing

clean:
	rm -rf ${GEN_SRC}
	make -C any_project clean

clobber:
	rm -rf ${GEN_SRC} *.epr EIFGEN
	make -C any_project clobber

%_scanner.e: %_scanner.l
	gelex -o $@ $<

%_tokens.e %_parser.e: %_parser.y
	geyacc -t $(subst _parser.y,_tokens,$<) -o $(subst .y,.e,$<) $<

reserved_word_checker.e: reserved_word_checker.e.in.1 reserved_word_checker.e.in.2 reserved_words
	cat reserved_word_checker.e.in.1 \
		   > reserved_word_checker.e
	echo "			-- generated, do not edit, see Makefile" \
		   >> reserved_word_checker.e
	sed -e 's/[a-zA-Z]\+/			words.extend ("&")/g' < reserved_words \
		   >> reserved_word_checker.e
	cat reserved_word_checker.e.in.2 \
		   >> reserved_word_checker.e

#any_features:
#	make -C any_project
#	cp any_project/any_features .

#===============================================================================
# End of file
#===============================================================================

#===============================================================================
# The GOTE converter. It converts GTK+ Objects To Eiffel.
# Copyright (C) 1999 Sam O'Connor
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program 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 General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
#
# See file "licence" for more information.
#===============================================================================
