# Generated automatically from Makefile.in by configure.
#  $Id: Makefile.in 1.17 Thu, 15 Jun 2000 11:51:23 -0700 cengiz $
#
#  Copyright (c) 1994 by the University of Southern California
#  All rights reserved.
#
#  Permission to use, copy, modify, and distribute this software and its
#  documentation in source and binary forms for lawful non-commercial
#  purposes and without fee is hereby granted, provided that the above
#  copyright notice appear in all copies and that both the copyright
#  notice and this permission notice appear in supporting documentation,
#  and that any documentation, advertising materials, and other materials
#  related to such distribution and use acknowledge that the software was
#  developed by the University of Southern California, Information
#  Sciences Institute. The name of the USC may not be used to endorse or
#  promote products derived from this software without specific prior
#  written permission.
#
#  THE UNIVERSITY OF SOUTHERN CALIFORNIA DOES NOT MAKE ANY
#  REPRESENTATIONS ABOUT THE SUITABILITY OF THIS SOFTWARE FOR ANY
#  PURPOSE.  THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR
#  IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
#  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE,
#  TITLE, AND NON-INFRINGEMENT.
#
#  IN NO EVENT SHALL USC, OR ANY OTHER CONTRIBUTOR BE LIABLE FOR ANY
#  SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES, WHETHER IN CONTRACT, TORT,
#  OR OTHER FORM OF ACTION, ARISING OUT OF OR IN CONNECTION WITH, THE USE
#  OR PERFORMANCE OF THIS SOFTWARE.
#
#  Questions concerning this software should be directed to 
#  ratoolset@isi.edu.
#
#  Author(s): WeeSan Lee <wlee@ISI.EDU>

GOAL   = aoe

OBJS   = aoe.o  as_peer.o  bgp_aspath.o  bgp_dump.l.o  \
	 fileselect.tk.o layout.tk.o  utils.tk.o  aoerc.tk.o \
	 TclApp.o  TclButton.o  TclCheckButton.o  TclCmd.o  \
	 TclEntry.o  TclLabel.o  \
	 TclList.o  TclRadioButton.o  TclText.o  TclToggleButton.o  \
	 TclVar.o 
SRCS   = aoe.cc as_peer.cc bgp_aspath.cc bgp_dump.l.cc \
	 fileselect.tk.cc layout.tk.cc utils.tk.cc aoerc.tk.cc \
	 TclApp.cc TclButton.cc TclCheckButton.cc TclCmd.cc \
	 TclEntry.cc TclLabel.cc \
	 TclList.cc TclRadioButton.cc TclText.cc TclToggleButton.cc \
	 TclVar.cc
HFILES = aoe.hh as_peer.hh bgp_aspath.hh \
	 TclApp.hh TclButton.hh TclCheckButton.hh TclCmd.hh \
	 TclEntry.hh TclLabel.hh \
	 TclList.hh TclRadioButton.hh TclText.hh TclToggleButton.hh \
	 TclVar.hh TclObj.hh 

TKFILES = layout.tk fileselect.tk utils.tk aoerc.tk

REQUIRES = normalform irr re2dfa rpsl Core gnug++ util

LIBS 	 = $(REQUIRES:%=-L../%) $(REQUIRES:%=-l%) \
	   -L/usr/X11R6/lib  -ltk -ltcl -ldl -lX11 \
           -lipc

# directories
srcdir		= .
top_srcdir	= ../..
INCDIRS		= -I$(srcdir) -I. -I$(top_srcdir)/src -I.. -I$(top_srcdir)/src/Core -I$(top_srcdir)/src/rpsl  -I/usr/X11R6/include

# programs

SHELL           = /bin/sh
RANLIB          = ranlib
CC              = gcc
CXX             = g++
BISON           = bison -y
FLEX            = flex
LD              = g++
PERL            = @PERL_PATH@
INSTALL         = /usr/bin/install -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
man3dir     = $(mandir)/man3

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

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) $<

# Transformations applied to each line of the file:
#       eliminate blank lines
#       eliminate lines that are only comments
#       eliminate tab characters
#       eliminate leading white space characters
#       Convert preexisting backslash into double backslash.
#       Precede preexisting double quote (") with backslash.
#       Add backslash, n, backslash to the end of each line.

%.tk.cc: %.tk
	@echo "converting $*.tk to $*.tk.cc"
	@echo "/* this file was machine generated from $*.tk */" > $<.cc
	@echo "/* on `date` by $$USER */" >> $<.cc
	@echo "" >> $<.cc
	@echo 'static char foo[] = {' >> $<.cc
	@sed -e '/^$$/d'             \
	    -e '/^[     ]*#/d'       \
	    -e "s/\\(.\\)/'\\1',/g"  \
	    -e 's/\\/\\\\/g'         \
	    -e 's/$$/0x0a,/'         \
	    $< >> $<.cc
	@echo '0x0 };' >> $<.cc
	@echo "" >> $<.cc
	@echo "/* This indirection is needed to fool damaged linker */" >> $<.cc
	@echo "" >> $<.cc
	@echo 'char *$*_tk = foo;' >> $<.cc

.SUFFIXES: .cc .tk

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

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

dolibs:
	@ cd ..; $(MAKE) $(MFLAGS) dolibs

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
