###############################################################################
# $Id:$
###############################################################################

##xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
@stdvars@
##xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

## do not change this value

subdir=examples/cpp/inherit.tinyc

srcdir=@abs_top_srcdir@/examples/cpp/inherit.tinyc
objdir=@abs_this_builddir@/examples/cpp/inherit.tinyc

this : test
test : test1

all: inherit_tinyc test

tinyc_g_FILES = \
	$(srcdir)/tinyc.g \
	$(eol)

tinyc_g_cxx_FILES = \
	$(objdir)/TinyCParser.cpp \
	$(eol)

tinyc_g_hpp_FILES = \
	$(objdir)/TinyCParser.hpp \
	$(objdir)/TinyCParserTokenTypes.hpp \
	$(eol)

tinyc_g_txt_FILES = \
	$(objdir)/TinyCParserTokenTypes.txt \
	$(eol)

tinyc_g_gen_FILES = \
	$(tinyc_g_cxx_FILES) \
	$(tinyc_g_hpp_FILES) \
	$(tinyc_g_txt_FILES) \
	$(eol)

tinyc_g_obj_FILES = \
	$(objdir)/TinyCParser@OBJEXT@ \
	$(eol)

subc_g_FILES = \
	$(srcdir)/subc.g \
	$(eol)

subc_g_cxx_FILES = \
	$(objdir)/MyCParser.cpp \
	$(eol)

subc_g_hpp_FILES = \
	$(objdir)/MyCParser.hpp \
	$(objdir)/MyCParserTokenTypes.hpp \
	$(eol)

subc_g_txt_FILES = \
	$(objdir)/MyCParserTokenTypes.txt \
	$(eol)

subc_g_gen_FILES = \
	$(subc_g_cxx_FILES) \
	$(subc_g_hpp_FILES) \
	$(subc_g_txt_FILES) \
	$(eol)

subc_g_obj_FILES = \
	$(objdir)/MyCParser@OBJEXT@ \
	$(eol)

lexer_g_FILES = \
	$(srcdir)/lexer.g \
	$(eol)

lexer_g_cxx_FILES = \
	$(objdir)/TinyCLexer.cpp \
	$(eol)

lexer_g_hpp_FILES = \
	$(objdir)/TinyCLexer.hpp \
	$(objdir)/TinyCTokenTypes.hpp \
	$(eol)

lexer_g_txt_FILES = \
	$(objdir)/TinyCTokenTypes.txt \
	$(eol)

lexer_g_gen_FILES = \
	$(lexer_g_cxx_FILES) \
	$(lexer_g_hpp_FILES) \
	$(lexer_g_txt_FILES) \
	$(eol)

lexer_g_obj_FILES = \
	$(objdir)/TinyCLexer@OBJEXT@ \
	$(eol)

## Source files
inherit_tinyc_cxx_FILES = \
	$(subc_g_cxx_FILES) \
	$(lexer_g_cxx_FILES) \
	$(srcdir)/Main.cpp \
	$(eol)

## Object files
inherit_tinyc_obj_FILES = \
	$(subc_g_obj_FILES) \
	$(lexer_g_obj_FILES) \
	$(objdir)/Main@OBJEXT@ \
	$(eol)

## Test commands
test1_cmd = $(objdir)/inherit_tinyc < $(srcdir)/input.c

## Tests to be executed
test1: inherit_tinyc
	@ v="$(verbose)"; if test $$v -gt 0 ; then  @ECHO@ "$(test1_cmd)" ; else  @ECHO@ "exec test1 .."; fi
	@ $(test1_cmd)

## How to make binaries
inherit_tinyc : $(inherit_tinyc_obj_FILES) @ANTLR_LIB@
	@CXX_LINK_CMD@ $@ $(inherit_tinyc_obj_FILES)

# This stuff depends on the tinyc example
$(objdir)/TinyCParserTokenTypes.txt : @abs_this_builddir@/examples/cpp/tinyc/TinyCParserTokenTypes.txt
	@ @CP@ $< $@

$(objdir)/TinyCTokenTypes.hpp : @abs_this_builddir@/examples/cpp/tinyc/TinyCTokenTypes.hpp
	@ @CP@ $< $@

$(objdir)/TinyCLexer.hpp : @abs_this_builddir@/examples/cpp/tinyc/TinyCLexer.hpp
	@ @CP@ $< $@

$(objdir)/TinyCLexer.cpp : @abs_this_builddir@/examples/cpp/tinyc/TinyCLexer.cpp
	@ @CP@ $< $@

@abs_this_builddir@/examples/cpp/tinyc/TinyCParserTokenTypes.txt \
@abs_this_builddir@/examples/cpp/tinyc/TinyCTokenTypes.hpp \
@abs_this_builddir@/examples/cpp/tinyc/TinyCLexer.cpp \
@abs_this_builddir@/examples/cpp/tinyc/TinyCLexer.hpp \
	:
	@ @MAKE@ -C @abs_this_builddir@/examples/cpp/tinyc

$(objdir)/.subc.g : $(srcdir)/subc.g $(objdir)/TinyCParserTokenTypes.txt @ANTLR_JAR@
	@ANTLRFLAGS="-glib `@CYGPATH_W@ $(_srcdir)/../tinyc/tinyc.g` -o `@CYGPATH_W@ $(thisdir)`" @ANTLR_COMPILE_CMD@ $(srcdir)/subc.g
	$(TOUCH) `@CYGPATH_W@ $(objdir)/.subc.g`

$(subc_g_gen_FILES): $(objdir)/.subc.g

## FIXME: Need .g deps
#$(objdir)/.subc.g: $(objdir)/.lexer.g

## GNU make - how to make object file
$(objdir)/%@OBJEXT@ : $(srcdir)/%.cpp
	@ @CXX_COMPILE_CMD@ $<

## GNU make - how to make object file
$(objdir)/%@OBJEXT@ : $(objdir)/%.cpp
	@ @CXX_COMPILE_CMD@ $<

## GNU make - how to make object file
%@OBJEXT@ : $(srcdir)/%.cpp
	@ @CXX_COMPILE_CMD@ $<

## GNU make - how to make object file
%@OBJEXT@ : $(objdir)/%.cpp
	@ @CXX_COMPILE_CMD@ $<

#####
## GNU make - how to make object file
$(objdir)/%@OBJEXT@ : $(srcdir)/%.c
	@ @C_COMPILE_CMD@ $<

## GNU make - how to make object file
$(objdir)/%@OBJEXT@ : $(objdir)/%.c
	@ @C_COMPILE_CMD@ $<

## GNU make - how to make object file
%@OBJEXT@ : $(srcdir)/%.c
	@ @C_COMPILE_CMD@ $<

## Housecleaning
clean:
	- @RMF@ *.o *.obj *.exe \
	$(tinyc_g_gen_FILES) \
	$(objdir)/.tinyc.g \
	$(subc_g_gen_FILES) \
	$(objdir)/.subc.g \
	$(lexer_g_gen_FILES) \
	$(objdir)/.lexer.g \
	$(objdir)/expandedsubc.g \
	inherit_tinyc

distclean: clean
	@RMF@ Makefile

## If cxx.sh script changed ..
$(tinyc_g_obj_FILES) : @abs_this_builddir@/scripts/cxx.sh
$(subc_g_obj_FILES) : @abs_this_builddir@/scripts/cxx.sh
$(lexer_g_obj_FILES) : @abs_this_builddir@/scripts/cxx.sh
## If link.sh script changed ..
$(tinyc_g_obj_FILES) : @abs_this_builddir@/scripts/link.sh
$(subc_g_obj_FILES) : @abs_this_builddir@/scripts/link.sh
$(lexer_g_obj_FILES) : @abs_this_builddir@/scripts/link.sh

$(objdir)/Main@OBJEXT@: \
	$(srcdir)/Main.cpp \
	$(objdir)/TinyCLexer.hpp \
	$(sourcetree)/lib/cpp/antlr/config.hpp \
	$(sourcetree)/lib/cpp/antlr/CommonToken.hpp \
	$(sourcetree)/lib/cpp/antlr/Token.hpp \
	$(sourcetree)/lib/cpp/antlr/TokenRefCount.hpp \
	$(sourcetree)/lib/cpp/antlr/InputBuffer.hpp \
	$(sourcetree)/lib/cpp/antlr/CircularQueue.hpp \
	$(sourcetree)/lib/cpp/antlr/BitSet.hpp \
	$(objdir)/TinyCTokenTypes.hpp \
	$(sourcetree)/lib/cpp/antlr/CharScanner.hpp \
	$(sourcetree)/lib/cpp/antlr/TokenStream.hpp \
	$(sourcetree)/lib/cpp/antlr/RecognitionException.hpp \
	$(sourcetree)/lib/cpp/antlr/ANTLRException.hpp \
	$(sourcetree)/lib/cpp/antlr/SemanticException.hpp \
	$(sourcetree)/lib/cpp/antlr/MismatchedCharException.hpp \
	$(sourcetree)/lib/cpp/antlr/LexerSharedInputState.hpp \
	$(sourcetree)/lib/cpp/antlr/RefCount.hpp \
	$(sourcetree)/lib/cpp/antlr/CharBuffer.hpp \
	$(objdir)/MyCParser.hpp \
	$(sourcetree)/lib/cpp/antlr/TokenBuffer.hpp \
	$(objdir)/MyCParserTokenTypes.hpp \
	$(sourcetree)/lib/cpp/antlr/LLkParser.hpp \
	$(sourcetree)/lib/cpp/antlr/Parser.hpp \
	$(sourcetree)/lib/cpp/antlr/MismatchedTokenException.hpp \
	$(sourcetree)/lib/cpp/antlr/AST.hpp \
	$(sourcetree)/lib/cpp/antlr/ASTRefCount.hpp \
	$(sourcetree)/lib/cpp/antlr/ASTFactory.hpp \
	$(sourcetree)/lib/cpp/antlr/ASTArray.hpp \
	$(sourcetree)/lib/cpp/antlr/ASTPair.hpp \
	$(sourcetree)/lib/cpp/antlr/ParserSharedInputState.hpp

$(objdir)/TinyCLexer@OBJEXT@: \
	$(objdir)/TinyCLexer.cpp \
	$(objdir)/TinyCLexer.hpp \
	$(sourcetree)/lib/cpp/antlr/config.hpp \
	$(sourcetree)/lib/cpp/antlr/CommonToken.hpp \
	$(sourcetree)/lib/cpp/antlr/Token.hpp \
	$(sourcetree)/lib/cpp/antlr/TokenRefCount.hpp \
	$(sourcetree)/lib/cpp/antlr/InputBuffer.hpp \
	$(sourcetree)/lib/cpp/antlr/CircularQueue.hpp \
	$(sourcetree)/lib/cpp/antlr/BitSet.hpp \
	$(objdir)/TinyCTokenTypes.hpp \
	$(sourcetree)/lib/cpp/antlr/CharScanner.hpp \
	$(sourcetree)/lib/cpp/antlr/TokenStream.hpp \
	$(sourcetree)/lib/cpp/antlr/RecognitionException.hpp \
	$(sourcetree)/lib/cpp/antlr/ANTLRException.hpp \
	$(sourcetree)/lib/cpp/antlr/SemanticException.hpp \
	$(sourcetree)/lib/cpp/antlr/MismatchedCharException.hpp \
	$(sourcetree)/lib/cpp/antlr/LexerSharedInputState.hpp \
	$(sourcetree)/lib/cpp/antlr/RefCount.hpp \
	$(sourcetree)/lib/cpp/antlr/CharBuffer.hpp \
	$(sourcetree)/lib/cpp/antlr/TokenStreamException.hpp \
	$(sourcetree)/lib/cpp/antlr/TokenStreamIOException.hpp \
	$(sourcetree)/lib/cpp/antlr/TokenStreamRecognitionException.hpp \
	$(sourcetree)/lib/cpp/antlr/CharStreamException.hpp \
	$(sourcetree)/lib/cpp/antlr/CharStreamIOException.hpp \
	$(sourcetree)/lib/cpp/antlr/NoViableAltForCharException.hpp

$(objdir)/TinyCParser@OBJEXT@: \
	$(objdir)/TinyCParser.cpp \
	$(objdir)/TinyCParser.hpp \
	$(sourcetree)/lib/cpp/antlr/config.hpp \
	$(sourcetree)/lib/cpp/antlr/TokenStream.hpp \
	$(sourcetree)/lib/cpp/antlr/Token.hpp \
	$(sourcetree)/lib/cpp/antlr/TokenRefCount.hpp \
	$(sourcetree)/lib/cpp/antlr/TokenBuffer.hpp \
	$(sourcetree)/lib/cpp/antlr/CircularQueue.hpp \
	$(objdir)/TinyCParserTokenTypes.hpp \
	$(sourcetree)/lib/cpp/antlr/LLkParser.hpp \
	$(sourcetree)/lib/cpp/antlr/Parser.hpp \
	$(sourcetree)/lib/cpp/antlr/BitSet.hpp \
	$(sourcetree)/lib/cpp/antlr/RecognitionException.hpp \
	$(sourcetree)/lib/cpp/antlr/ANTLRException.hpp \
	$(sourcetree)/lib/cpp/antlr/MismatchedTokenException.hpp \
	$(sourcetree)/lib/cpp/antlr/AST.hpp \
	$(sourcetree)/lib/cpp/antlr/ASTRefCount.hpp \
	$(sourcetree)/lib/cpp/antlr/ASTFactory.hpp \
	$(sourcetree)/lib/cpp/antlr/ASTArray.hpp \
	$(sourcetree)/lib/cpp/antlr/ASTPair.hpp \
	$(sourcetree)/lib/cpp/antlr/ParserSharedInputState.hpp \
	$(sourcetree)/lib/cpp/antlr/RefCount.hpp \
	$(sourcetree)/lib/cpp/antlr/NoViableAltException.hpp \
	$(sourcetree)/lib/cpp/antlr/SemanticException.hpp

$(objdir)/MyCParser@OBJEXT@: \
	$(objdir)/MyCParser.cpp \
	$(objdir)/MyCParser.hpp \
	$(sourcetree)/lib/cpp/antlr/config.hpp \
	$(sourcetree)/lib/cpp/antlr/TokenStream.hpp \
	$(sourcetree)/lib/cpp/antlr/Token.hpp \
	$(sourcetree)/lib/cpp/antlr/TokenRefCount.hpp \
	$(sourcetree)/lib/cpp/antlr/TokenBuffer.hpp \
	$(sourcetree)/lib/cpp/antlr/CircularQueue.hpp \
	$(objdir)/MyCParserTokenTypes.hpp \
	$(sourcetree)/lib/cpp/antlr/LLkParser.hpp \
	$(sourcetree)/lib/cpp/antlr/Parser.hpp \
	$(sourcetree)/lib/cpp/antlr/BitSet.hpp \
	$(sourcetree)/lib/cpp/antlr/RecognitionException.hpp \
	$(sourcetree)/lib/cpp/antlr/ANTLRException.hpp \
	$(sourcetree)/lib/cpp/antlr/MismatchedTokenException.hpp \
	$(sourcetree)/lib/cpp/antlr/AST.hpp \
	$(sourcetree)/lib/cpp/antlr/ASTRefCount.hpp \
	$(sourcetree)/lib/cpp/antlr/ASTFactory.hpp \
	$(sourcetree)/lib/cpp/antlr/ASTArray.hpp \
	$(sourcetree)/lib/cpp/antlr/ASTPair.hpp \
	$(sourcetree)/lib/cpp/antlr/ParserSharedInputState.hpp \
	$(sourcetree)/lib/cpp/antlr/RefCount.hpp \
	$(sourcetree)/lib/cpp/antlr/NoViableAltException.hpp \
	$(sourcetree)/lib/cpp/antlr/SemanticException.hpp

##xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
@stddeps@
##xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

