# Copyright (c) 2000-2009, 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 name of Paul Mattes nor 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.

# Auxiliary makefile for wpr3287

TARDIR=wpr3287-3.3
RM=rm -f

all:
	@echo "Must pick a specific make target."

# Development tools.

SOURCES = charset.c ctlr.c pr3287.c proxy.c resolver.c see.c sf.c tables.c \
	telnet.c trace_ds.c utf8.c w3misc.c windirs.c winvers.c ws.c \
	unicode.c unicode_dbcs.c
HEADERS = 3270ds.h ctlrc.h globals.h localdefs.h popupsc.h proxy.h proxyc.h \
	resolverc.h seec.h sfc.h tablesc.h telnetc.h tn3270e.h trace_dsc.h \
	utf8c.h w3miscc.h windirsc.h winversc.h wsc.h arpa_telnet.h \
	charsetc.h unicodec.h unicode_dbcsc.h
MISC = mkversion.sh version.txt LICENSE Makefile Makefile.aux \
	pr3287.ico wpr3287.rc Msc/deprecated.h Msc/Makefile Msc/mkversion.c \
	Msc/README.txt
DEVKIT = pr3287.man.m4 m42man
HTML = html/wpr3287-man.html html/Build.html html/ReleaseNotes.html

FILES = $(SOURCES) $(HEADERS) $(MISC) $(HTML) 

tarlist: Makefile.aux
	$(RM) tarlist
	for i in $(FILES); \
	do echo $(TARDIR)/$$i; \
	done >$@

wpr3287-src.tar: $(FILES) tarlist
	$(RM) $(TARDIR)
	ln -s . $(TARDIR)
	$(RM) $@
	tar -ch -T tarlist -f $@
	$(RM) $(TARDIR)

wpr3287-src.tgz: wpr3287-src.tar
	gzip <wpr3287-src.tar >$@

man: html/wpr3287-man.html
html/wpr3287-man.html: pr3287.man.m4 html.m4 version.txt
	./m42html wpr3287 pr3287.man.m4 >$@
html/ReleaseNotes.html: html/documentation-relnotes-body.html mkstand.bash
	./mkstand.bash "wpr3287 Release Notes" html/documentation-relnotes-body.html $@

configure: configure.in
	autoconf

ID: $(SOURCES) $(HEADERS)
	mkid $(SOURCES) $(HEADERS)

tags: $(SOURCES) $(HEADERS)
	ctags $(SOURCES) $(HEADERS)

lessman:
	tbl wpr3287.man | nroff -man | less
