# Generated automatically from Makefile.in by configure.
#
# Makefile for TINTIN++ 
# 

# It's a bad idea to edit Makefile if you don't know what you're doing.
# Makefile is automatically generated by ./configure from Makefile.in.
# If you want to change something, most likely you'll want to edit
# Makefile.in and change it there, then run ./configure.

DEFINES = -DHAVE_CONFIG_H
DEFINES += -DCHINESE
#DEFINES += -DGNU_SOURCE

CC = gcc
MAKE = gmake

CFLAGS = -O2 $(DEFINES)
#CFLAGS = -g -pedantic -Wall -Wshadow -Wpointer-arith $(DEFINES)
#CFLAGS = -O2 -ansi -pedantic -Wall -Wshadow -Wpointer-arith $(DEFINES)
LDFLAGS = 
INCS = -I. -Iprotos 

# Use the second line below if you do not have the readline library installed
# You also need to configure and make the readline library before you
# make the tintin++ program.
#Since readline and history are required, I'll hard code it in here.
LIBS =  -lreadline -lhistory -lnsl -ltermcap 
#LIBS = readline/libreadline.a -lnsl -ltermcap 

# If you prefer to be able to enter ISO latin-1 characters instead
# of being able to use the meta key for special emacs-like commands
# uncomment the following line.
#F1 = -DUSE_ISO_LATIN_ONE

# If you need to make connections through a SOCKS server, uncomment
# these 2 lines.  You also need to modify LIBSOCKS to point to the location
# of your SOCKS library.
#F6 = -DSOCKS
#LIBSOCKS = -lsocks5

# BINDIR is the directory you wish tt++ to be placed if you wish to use
# make install.  
BINDIR = .

# DEFAULT_FILE_DIR is the path to tintin files. 
# DEFAULT_FILE_DIR = @HOME@
DEFAULT_FILE_DIR = $(HOME)

#########################################
# You shouldn't need to change anything #
# below this line.                      #
#########################################
# GREP-FOR-ME (this is for gripe)       #
#########################################

FFLAGS= $(F1) $(F6)

OFILES = action.o alias.o ansi.o antisub.o files.o glob.o help.o \
	highlight.o ivars.o llist.o log.o main.o misc.o net.o parse.o \
	path.o pause.o queue.o rl.o rlhist.o rltab.o rltick.o rlvt100.o scrsize.o \
	session.o substitute.o text.o ticks.o utils.o variables.o \
	function.o macro.o stream.o uuencode.o

default: all

all:	tt++

tt++:	Makefile $(OFILES) tintin.h
	@echo "---- Linking..."
	$(CC) $(INCS) $(CFLAGS) $(FFLAGS) $(LDFLAGS) -o $@ $(OFILES) $(LIBS) ${LIBSOCKS}

Makefile: Makefile.in
	@echo "You need to run ./configure first; then try make."
	@exit 1

install: tt++
	@./install-sh $(BINDIR) $(DEFAULT_FILE_DIR) $(COMPRESSED_HELP)

# Autocompile all .cpp files into .o files using this rule:
.SUFFIXES: .cpp .o
.cpp.o:
	$(CC) $(PIPE) $(CFLAGS) $(FFLAGS) $(INCS) -c $<

clean:
	rm -f *.o ../tt++ tt++ core config.h config.cache config.status config.log

distclean: clean
	rm -f Makefile protos/Makefile \
	config.h config.status config.log config.cache
	@(cd readline; make distclean)

EmptyRule:

protos: EmptyRule
	cd protos; \
	$(MAKE) protos

