CXXFLAGS=-O2 # flags for compiler
LDFLAGS=-Xlinker -R/usr/ucblib:/usr/local/lib # linker flags
LDLIBS=-L/usr/local/lib -Itbcc # linker libraries
CXX=gcc # C compiler
CC=gcc # linker
INSTALLDIR=/usr/bin# installation dir of Elizatalk (be sure there is no space between the dir and the #)
INSTALLDIRDICT=/usr/share/elizatalk# installation dir of the dictionaries (be sure there is no space between the dir and the #)

SOURCES=elizatalk.c \
        splotch.c
OBJECTS=$(SOURCES:%.c=%.o)

all:elizatalk

elizatalk:$(OBJECTS)

include make.depend

make.depend:$(SOURCES)
	$(CC) -M $^ >$@

install:all
	install -m 775 -s elizatalk $(INSTALLDIR)
	install -d $(INSTALLDIRDICT)/words
	install -m 666 main.dict syn.dict $(INSTALLDIRDICT)
	install -m 666 words/* $(INSTALLDIRDICT)/words

uninstall: clean
	rm -f $(INSTALLDIR)/elizatalk
	rm -f $(INSTALLDIRDICT)/main.dict $(INSTALLDIRDICT)/syn.dict
	rm -f $(INSTALLDIRDICT)/words/*
	rmdir $(INSTALLDIRDICT)/words
	rmdir $(INSTALLDIRDICT)

clean:
	rm -f $(OBJECTS) elizatalk

