###############################################################################
###############################################################################
##                                                                           ##
##  Antenna Visualization Toolkit                                            ##
##                                                                           ##
##  Copyright (C) 1998 Adrian Agogino, Ken Harker                            ##
##  Copyright (C) 2005 Joop Stakenborg                                       ##
##                                                                           ##
###############################################################################
###############################################################################
##
## This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 2 of the License, or
## (at your option) any later version.
##
## This program is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
## GNU Library General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with this program; if not, write to the Free Software
## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
##
## Please do not edit "makefile", as it is auto-generated
## by ./configure from makefile.in  Edit makefile.in instead.
##
CFLAGS := -O2
CPPFLAGS := -I/usr/include/tcl8.4 -I/usr/include/tcl8.4 
LIBS := -ltk8.4 -ltcl8.4 -lXmu -lGLU 
LDFLAGS :=  -L/usr/X11R6/lib

prefix = /usr
exec_prefix = ${prefix}
bindir = ${exec_prefix}/bin
datadir = ${prefix}/share
mandir = ${prefix}/share/man

CFLAGS += -c -Wall $(CPPFLAGS)

#
# Standard configuration method.
#
define CONFIGURE
	if [ -x ./config.status ] ; then \
	    ./config.status --recheck && ./config.status; \
	else \
		./configure; \
	fi
endef

subdir = 
files =

clean-files = TkAnt *.o
distclean-files = config.log config.status input.nec output.nec *~

srcfiles = configure configure.in makefile makefile.in

default: TkAnt

HEADERS = TkAntenna.h ParseArgs.h ant.h pcard.h VisField.h togl.h
OBJS    = TkAntenna.o AntennaWidget.o ParseArgs.o togl.o ant.o pcard.o \
	VisField.o VisWires.o

TkAnt: TkAntenna.o AntennaWidget.o ParseArgs.o ant.o pcard.o \
	VisField.o VisWires.o togl.o $(HEADERS)
	$(CC) $(LDFLAGS) $(OBJS) $(LIBS) -o $@

##
## .c files
##
.c.o:
	$(CC) $(CFLAGS) $*.c

##
## make sure the build system is consistant.
##
makefile: configure makefile.in
	$(CONFIGURE)
	
configure:
	aclocal
	autoconf

install: TkAnt
	install -s TkAnt $(bindir)
	install antenna.tcl $(bindir)/antennavis
	mkdir -p $(mandir)/man1
	install -m 0644 antennavis.1 $(mandir)/man1
	install -m 0644 TkAnt.1 $(mandir)/man1

uninstall:
	-rm -f $(bindir)/TkAnt
	-rm -f $(bindir)/antennavis
	-rm -f $(mandir)/man1/antennavis.1
	-rm -f $(mandir)/man1/TkAnt.1

clean:
	-rm -f $(clean-files)

distclean: clean
	-rm -f $(distclean-files)
