GOAL   = separateobjects 

OBJS   = separateobjects.o
SRCS   = separateobjects.cc
HFILES = 

OTHERS = 

REQUIRES = rpsl Core util

LIBS 	 = $(REQUIRES:%=-L../%) $(REQUIRES:%=-l%) -lmysqlclient -lsocket -lnsl -lglib

# directories
srcdir		= .
top_srcdir	= ../..
#INCDIRS	       	= -I$(srcdir) -I. -I$(top_srcdir)/src -I.. -I/usr/local/mysql/include -I/space/dbdev/marek/lib/glib/include -I/space/dbdev/marek/include
INCDIRS         = -I$(srcdir) -I. -I$(top_srcdir)/src -I.. -I$(top_srcdir)/src/Core -I$(top_srcdir)/src/rpsl -I/usr/local/mysql/include -I/space/dbdev/marek/lib/glib/include -I/space/dbdev/marek/include
#INCDIRS         = -I$(srcdir) -I. -I$(top_srcdir)/src -I.. -I$(top_srcdir)/src/Core -I$(top_srcdir)/src/rpsl
# programs

SHELL           = /bin/sh
RANLIB          = :
CC              = gcc
CXX             = c++
BISON           = bison -y
FLEX            = flex
LD              = c++
PERL            = @PERL_PATH@
INSTALL         = ../.././install-sh -c
INSTALL_PROGRAM = ${INSTALL}
INSTALL_DATA    = ${INSTALL} -m 644

# The default location for installation.
prefix      = /usr/local
exec_prefix = ${prefix}
bindir      = ${exec_prefix}/bin
mandir      = ${prefix}/man
man1dir     = $(mandir)/man1
man8dir     = $(mandir)/man8

DEFINES  = -DHAVE_CONFIG_H
CFLAGS   = -gstabs+
CPPFLAGS = 
LDFLAGS  = 
CXXFLAGS = -gstabs+ -frtti

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
separateobjects.o: separateobjects.cc ../../src/rpsl/rpsl/object.hh \
 ../../src/Core/util/List.hh ../../src/Core/util/Buffer.hh \
 ../../src/util/debug.hh ../../src/rpsl/rpsl/rpsl_attr.hh \
 ../../src/rpsl/rpsl/rptype.hh ../../src/rpsl/rpsl/regexp.hh \
 ../../src/rpsl/gnu/SetOfSymID.hh ../../src/rpsl/gnu/SymID.VHSet.h \
 ../../src/rpsl/gnu/SymID.Set.h ../../src/rpsl/gnu/Pix.h \
 ../../src/rpsl/gnu/SymID.defs.h ../../src/rpsl/gnu/std.h \
 ../../src/rpsl/rpsl/rangelist.hh ../../src/rpsl/rpsl/symbols.hh \
 ../../src/Core/util/Allocator.hh ../../src/Core/util/xstring.h \
 ../../src/rpsl/rpsl/prefix.hh ../../src/rpsl/rpsl/rpsl_item.hh \
 ../../src/rpsl/rpsl/rpsl_policy.hh ../../src/rpsl/rpsl/rpsl_filter.hh \
 ../../src/rpsl/gnu/prefixranges.hh ../../src/rpsl/gnu/PrefixRange.XPlex.h \
 ../../src/rpsl/gnu/PrefixRange.Plex.h \
 ../../src/rpsl/gnu/PrefixRange.defs.h ../../src/Core/util/rusage.hh \
 ../../src/util/trace.hh ../../src/util/Argv.hh \
 ../../src/util/version.hh ../../src/rpsl/rpsl/schema.hh
# DEPENDENCIES MUST END AT END OF FILE
# IF YOU PUT STUFF HERE IT WILL GO AWAY
# see make depend above
