# Generated automatically from Makefile.in by configure.
# Copyright 1999, 2000 by Paul Mattes.
#  Permission to use, copy, modify, and distribute this software and its
#  documentation for any purpose and without fee is hereby granted,
#  provided that the above copyright notice appear in all copies and that
#  both that copyright notice and this permission notice appear in
#  supporting documentation.

# Makefile for c3270 (console-based 3270 emulator)

RM = rm -f
CC = gcc

all:: c3270 x3270if
all::
	-cd pr3287 && $(MAKE)

SRCS = actions.c ansi.c apl.c charset.c ctlr.c ft.c ft_cut.c ft_dft.c glue.c \
	help.c host.c keymap.c kybd.c macros.c print.c printer.c resources.c \
	screen.c sf.c tables.c c3270.c telnet.c toggles.c trace_ds.c util.c \
	xio.c XtGlue.c
VOBJS = actions.o ansi.o apl.o charset.o ctlr.o ft.o ft_cut.o ft_dft.o glue.o \
	help.o host.o keymap.o kybd.o macros.o print.o printer.o resources.o \
	screen.o sf.o tables.o c3270.o telnet.o toggles.o trace_ds.o util.o \
	xio.o XtGlue.o
OBJS1 = $(VOBJS) version.o

LIBDIR = ${exec_prefix}/lib
prefix = /usr/local
exec_prefix = ${prefix}
LIBX3270DIR = $(LIBDIR)/x3270
MANDIR = ${prefix}/man
BINDIR = ${exec_prefix}/bin
INSTALL = /usr/bin/install -c

#CDEBUGFLAGS = -g -Wall

XCPPFLAGS = -I. -DLIBX3270DIR=\"$(LIBX3270DIR)\"   
CFLAGS = -g -O2 $(XCPPFLAGS) $(CDEBUGFLAGS)
LDFLAGS = 
LIBS = -lncurses -lreadline 

version.o: $(VOBJS) version.txt mkversion.sh
	@chmod +x mkversion.sh version.txt
	sh ./mkversion.sh $(CC) c3270

c3270: $(OBJS1)
	$(CC) -o $@ $(OBJS1) $(LDFLAGS) $(LIBS)
x3270if: x3270if.o
	$(CC) -o $@ x3270if.o

install:: c3270 x3270if
	$(INSTALL) c3270 $(BINDIR)/c3270
	$(INSTALL) x3270if $(BINDIR)/x3270if
install::
	[ -r $(LIBX3270DIR)/ibm_hosts ] || \
	($(INSTALL) -d $(LIBX3270DIR) && $(INSTALL) ibm_hosts $(LIBX3270DIR)/ibm_hosts)
install::
	-cd pr3287 && $(MAKE) install

install.man:
	$(INSTALL) c3270.man $(MANDIR)/man1/c3270.1
	$(INSTALL) x3270if.man $(MANDIR)/man1/x3270if.1
	$(INSTALL) x3270-script.man $(MANDIR)/man1/x3270-script.1
	$(INSTALL) ibm_hosts.man $(MANDIR)/man1/ibm_hosts.1
	-cd pr3287 && $(MAKE) install.man

clean:
	$(RM) c3270 *.o
	-cd pr3287 && $(MAKE) clean

depend:
	gccmakedep $(XCPPFLAGS) -s "# DO NOT DELETE" $(SRCS)

# -------------------------------------------------------------------------
# dependencies generated by makedepend

# DO NOT DELETE
