#    Makefile for the Termite program
#    Copyright (C) 1996-1997  Nadav Cohen
#
#    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 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., 675 Mass Ave, Cambridge, MA 02139, USA.

#######################################################################
#  Installer configuration section
BINDIR=/usr/local/bin
MANDIR=/usr/local/man
CURSDIR=/usr/include/ncurses
MANSECTION=1

#######################################################################
#  Compiler configuration section
#
CFLAGS=-O -I$(CURSDIR)
CC=g++
#  System V may require 'LIBS=-lbsd' here.
LIBS=-lncurses
TARGET=termite
OBJECTS=screen.o window.o modem.o menu.o list.o ansi.o avatar.o vt100.o \
	error.o log.o utils.o phone.o config.o setup.o terminal.o filemgr.o \
	main.o

##########################
$(TARGET): $(OBJECTS)
	$(CC) $(CFLAGS) $(OBJECTS) -o $(TARGET) $(LIBS)

ansi.o: ansi.c

avatar.o: avatar.c

config.o: config.c

error.o: error.c

filemgr.o: filemgr.c

list.o: list.c

log.o: log.c

menu.o: menu.c

modem.o: modem.c

phone.o: phone.c

screen.o: screen.c

setup.o: setup.c

terminal.o: terminal.c

main.o: main.c

utils.o: utils.c

vt100.o: vt100.c

window.o: window.c

install:
	install -c -m 0755 termite $(BINDIR)
	@if ! test -e $(HOME)/.termite ; then \
	install -c -m 0600 termiterc $(HOME)/.termite ; \
	echo Installed $(HOME)./termite ... ;\
	fi

install.man:
	install -c -m 0644 termite.$(MANSECTION) $(MANDIR)/man$(MANSECTION)

clean:
	rm -f $(OBJECTS)
	rm -f $(TARGET)
