# $Id: Makefile.in,v 1.1.1.1 2000/03/10 16:32:24 engin Exp $

GOAL   = $(OBJECTS)

# Objects and sources files, objects must be on single line
SOURCES		= rpsl_attr.cc rpsl_filter.cc rpsl_item.cc rpsl_policy.cc \
		  object.cc schema.cc symbols.cc prefix.cc \
		  rpsl.y.cc rpsl.l.cc schema_rpsl.cc \
		  rptype.cc regexp.cc rangelist.cc object_log.l.cc

OBJECTS		= rpsl_attr.o  rpsl_filter.o  rpsl_item.o  rpsl_policy.o  \
		  object.o  schema.o  symbols.o  prefix.o \
		  rpsl.y.o  rpsl.l.o  schema_rpsl.o  \
		  rptype.o  regexp.o  rangelist.o  object_log.l.o

HEADERS		= rpsl_attr.hh rpsl_filter.hh rpsl_item.hh rpsl_policy.hh \
		  object.hh schema.hh symbols.hh prefix.hh \
		  rpsl.y.hh \
		  rptype.hh regexp.hh rangelist.hh config.h

OTHERS		= rpsl.l rpsl.y object_log.l

# Paths
srcdir		= @srcdir@
top_srcdir	= @top_srcdir@
VPATH		= @srcdir@
prefix      	= @prefix@
exec_prefix 	= @exec_prefix@
bindir      	= @bindir@
mandir      	= @mandir@
man1dir     	= $(mandir)/man1
man8dir     	= $(mandir)/man8

# programs
@SET_MAKE@
SHELL           = /bin/sh
RANLIB          = @RANLIB@
CC              = @CC@
CXX             = @CXX@
BISON           = @YACC@
FLEX            = @LEX@
LD              = @LD@
PERL            = @PERL_PATH@
INSTALL         = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA    = @INSTALL_DATA@

# Other variables
DEFINES  	= @DEFS@
CFLAGS   	= @CFLAGS@
CPPFLAGS 	= @CPPFLAGS@
LDFLAGS  	= @LDFLAGS@
CXXFLAGS 	= @CXXFLAGS@
INCDIRS 	= -I. -I$(srcdir) -I.. -I$(top_srcdir)/src @all_INCDIRS@ @EXTRA_INCLUDE_DIRS@
DISTFILES	= Makefile.in $(SOURCES) $(HEADERS) $(OTHERS)

default: all

# Implicit rules
%.y.cc %.y.hh: %.y
	@echo Compiling: `basename $<`
	$(BISON) -d -p `basename $< .y` $<
	mv y.tab.c `basename $<`.cc
	mv y.tab.h `basename $<`.hh

%.l.cc: %.l
	@echo Compiling: `basename $<`
	$(FLEX) -P`basename $< .l` $<
	mv lex.`basename $< .l`.c `basename $<`.cc

.c.o:
	@echo Compiling: `basename $<`
	$(CC)  -c $(CPPFLAGS) $(CFLAGS) $(DEFINES) $(INCDIRS) $<

.cc.o:
	@echo Compiling: `basename $<`
	$(CXX) -c $(CPPFLAGS) $(CXXFLAGS) $(DEFINES) $(INCDIRS) $<

.SUFFIXES: .cc

# Making the distribution
distdir: 
	@for file in `cd $(srcdir) && echo $(DISTFILES)`; do \
	  test -f $(distdir)/$$file \
	  || ln $(srcdir)/$$file $(distdir)/$$file 2> /dev/null \
	  || cp -p $(srcdir)/$$file $(distdir)/$$file; \
	done

# Explicit rules
all: $(OBJECTS)

clean:
	rm -f core *.o *~ *.y.cc *.y.hh *.l.cc *.l.hh *.tk.cc $(GOAL)

mostlyclean:
	rm -f core *.o *~ *.y.cc *.y.hh *.l.cc *.l.hh *.tk.cc

depend: $(SOURCES)
	@echo Making dependencies for $(SOURCES)
	@$(CXX) -MM $(CPPFLAGS) $(CXXFLAGS) $(DEFINES) $(INCDIRS) ${SOURCES} >makedep
	@echo '/^# DO NOT DELETE THIS LINE/+1,$$d' >eddep
	@echo '$$r makedep' >>eddep
	@echo 'w' >>eddep
	@cp Makefile Makefile.bak
	@ed - Makefile < eddep
	@rm eddep makedep
	@echo '# DEPENDENCIES MUST END AT END OF FILE' >> Makefile
	@echo '# IF YOU PUT STUFF HERE IT WILL GO AWAY' >> Makefile
	@echo '# see make depend above' >> Makefile

# DO NOT DELETE THIS LINE
# DEPENDENCIES MUST END AT END OF FILE
# IF YOU PUT STUFF HERE IT WILL GO AWAY
# see make depend above
