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

GOAL   = rpslcheck

OBJS   = rpslcheck.o
SRCS   = rpslcheck.cc
HFILES = 

OTHERS = 

REQUIRES = rpsl Core util

LIBS 	 = $(REQUIRES:%=-L../%) $(REQUIRES:%=-l%) @EXTRA_LIBS@

# directories
srcdir		= @srcdir@
top_srcdir	= @top_srcdir@
VPATH		= @srcdir@
INCDIRS		= -I$(srcdir) -I. -I$(top_srcdir)/src -I.. @all_INCDIRS@ @EXTRA_INCLUDE_DIRS@

# 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@

# The default location for installation.
prefix      = @prefix@
exec_prefix = @exec_prefix@
bindir      = @bindir@
mandir      = @mandir@
man1dir     = $(mandir)/man1
man8dir     = $(mandir)/man8

DEFINES  = @DEFS@
CFLAGS   = @CFLAGS@
CPPFLAGS = @CPPFLAGS@
LDFLAGS  = @LDFLAGS@
CXXFLAGS = @CXXFLAGS@

default: all

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

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

.c.o:
	$(CC)  -c $(CPPFLAGS) $(CFLAGS) $(DEFINES) $(INCDIRS) $<

.cc.o:
	$(CXX) -c $(CPPFLAGS) $(CXXFLAGS) $(DEFINES) $(INCDIRS) $<

.SUFFIXES: .cc

#
# No need to make changes below
#
all: $(GOAL)

$(GOAL): $(OBJS) dolibs
	$(LD) $(CFLAGS) -o $(GOAL) $(OBJS) $(LIBS)

dolibs:
	@ for f in $(REQUIRES); do cd ../$$f; $(MAKE) $(MFLAGS); done

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

# make dependencies
depend:	${SRCS}
	$(CXX) -MM $(CPPFLAGS) $(CXXFLAGS) $(DEFINES) $(INCDIRS) $^ >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
