# Copyright (c) 1999-2010, Paul Mattes.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#     * Redistributions of source code must retain the above copyright
#       notice, this list of conditions and the following disclaimer.
#     * Redistributions in binary form must reproduce the above copyright
#       notice, this list of conditions and the following disclaimer in the
#       documentation and/or other materials provided with the distribution.
#     * Neither the names of Paul Mattes nor the names of his contributors
#       may be used to endorse or promote products derived from this software
#       without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY PAUL MATTES "AS IS" AND ANY EXPRESS OR IMPLIED
# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
# EVENT SHALL PAUL MATTES BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

# Makefile for pr3287

RM = rm -f
CC = @CC@

all: pr3287

prefix = @prefix@
exec_prefix = @exec_prefix@
datarootdir = @datarootdir@
MANDIR = @mandir@
BINDIR = @bindir@
sysconfdir = @sysconfdir@

#CDEBUGFLAGS = -g -Wall

XCPPFLAGS = @CPPFLAGS@ @XANSI@ @XPRECOMP@
CFLAGS = @CFLAGS@ -DPR3287=1 $(XCPPFLAGS) $(CDEBUGFLAGS) @SSL@ @DBCS@ @ICONV@ \
	-DLIBX3270DIR=\"@LIBX3270DIR@\"
LDFLAGS = @LDFLAGS@
LIBS = @LIBS@
INSTALL = @INSTALL@

SRCS = pr3287.c ctlr.c trace_ds.c tables.c telnet.c sf.c charset.c resolver.c \
	see.c proxy.c unicode.c unicode_dbcs.c utf8.c
OBJECTS = pr3287.o ctlr.o trace_ds.o tables.o telnet.o sf.o charset.o \
	resolver.o see.o proxy.o unicode.o unicode_dbcs.o utf8.o

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

pr3287: $(OBJECTS) version.o
	$(CC) -o $@ $(OBJECTS) version.o $(LDFLAGS) $(LIBS)

install: pr3287
	[ -d $(DESTDIR)$(BINDIR) ] || \
		mkdir -p $(DESTDIR)$(BINDIR)
	$(INSTALL) pr3287 $(DESTDIR)$(BINDIR)/pr3287

install.man:
	[ -d $(DESTDIR)$(MANDIR)/man1 ] || \
		mkdir -p $(DESTDIR)$(MANDIR)/man1
	$(INSTALL) pr3287.man $(DESTDIR)$(MANDIR)/man1/pr3287.1

clean:
	$(RM) pr3287 *.o

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

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

# DO NOT DELETE
