# Copyright (c) 1999-2010, 2013-2014 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@ @IPV6@ \
	-DLIBX3270DIR=\"@LIBX3270DIR@\"
LDFLAGS = @LDFLAGS@
LIBS = @LIBS@
INSTALL = @INSTALL@

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

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

XVERSION = xversion.c
version.o: version.txt mkversion.sh
	$(RM) $(XVERSION)
	@chmod +x mkversion.sh version.txt
	sh ./mkversion.sh pr3287 >$(XVERSION)
	$(CC) $(CFLAGS) -c -o $@ $(XVERSION)
	$(RM) $(XVERSION)

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 -- $(CFLAGS) -- -s "# DO NOT DELETE" $(SRCS)

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

# DO NOT DELETE
