# Auxiliary makefile for x3270

TARDIR=x3270-3.1.1

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

# Development tools.

SOURCES = Cme.c CmeBSB.c CmeLine.c CmplxMenu.c about.c actions.c ansi.c apl.c \
	ctlr.c ft.c ft_cut.c ft_dft.c keypad.c kybd.c macros.c main.c \
	menubar.c popups.c print.c save.c screen.c scroll.c select.c sf.c \
	status.c tables.c telnet.c trace_ds.c util.c x3270if.c qcpp.c
HEADERS = 3270ds.h Cme.h CmeBSB.h CmeBSBP.h CmeLine.h CmeLineP.h CmeP.h \
	CmplxMenu.h CmplxMenuP.h aboutc.h actionsc.h ansic.h aplc.h appres.h \
	cg.h ctlr.h ctlrc.h ftc.h ft_cut_ds.h ft_cutc.h ft_dftc.h ft_dft_ds.h \
	globals.h keypadc.h kybdc.h macrosc.h mainc.h menubarc.h objects.h \
	popupsc.h printc.h resources.h savec.h screen.h screenc.h scrollc.h \
	selectc.h sfc.h statusc.h tablesc.h telnet.h telnetc.h trace_dsc.h \
	utilc.h owinc/X11/Xfuncproto.h
BITMAPS = keypad.bm dot.bm arrow.bm diamond.bm ky.bm no_diamond.bm null.bm \
	wait.bm x3270.bm
FONTS = 3270.bdf 3270b.bdf 3270-12.bdf 3270-12b.bdf 3270-20.bdf 3270-20b.bdf \
	3270d.bdf 3270h.bdf 3270gt8.bdf 3270gt12.bdf 3270gt12b.bdf \
	3270gt16.bdf 3270gt16b.bdf 3270gt24.bdf 3270gt24b.bdf 3270gt32.bdf \
	3270gt32b.bdf
MISC = version.txt X3270.xad x3270.man x3270-script.man ibm_hosts.man \
	x3270if.man mkfb.c Imakefile Imakefile.R4 mkversion.sh Makefile.aux \
	Makefile.openwin dryrun ibm_hosts Examples/child_script.bash \
	Examples/child_script.ksh Examples/child_script.sh Examples/ibm_hosts \
	Examples/peer_script.bash Examples/peer_script.expect \
	Examples/peer_script.ksh Examples/peer_script.sh Playback/playback.c \
	Playback/playback.man Playback/Makefile README x3270.lsm
DOCS = Docs/Attributes Docs/FAQ Docs/Lineage Docs/Resources Docs/Bugs \
	Docs/Build Docs/Charset Docs/Intro Docs/Wishlist Docs/New Docs/Y2K
HTML = html/README.html html/Attributes.html html/FAQ.html html/Lineage.html \
	html/Resources.html html/Bugs.html html/Build.html \
	html/Charset.html html/Intro.html html/Wishlist.html \
	html/New.html html/Y2K.html html/x3270.man.html html/x3270-script.html \
	html/ibm_hosts.html html/x3270.xbm html/x3270.jpg html/x3270if.html

FILES = $(SOURCES) $(HEADERS) $(BITMAPS) $(FONTS) $(MISC) $(DOCS) $(HTML)

Imakefile.R4: Imakefile
	rm -f $@
	sed 's/FontObj(\([-a-zA-Z0-9]*\))/\1.snf/g' Imakefile > $@
	chmod -w $@

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

x3270.tar: $(FILES) tarlist
	rm -f $(TARDIR)
	ln -s . $(TARDIR)
	#tar -cofh - -I tarlist > $@
	tar -ch -T tarlist -f x3270.tar
	rm -f $(TARDIR)

x3270.tgz: x3270.tar
	gzip < x3270.tar > $@

lint:
	lint -abhxz $(SOURCES) -DLIBX3270DIR=\"/usr/lib/X11/x3270\" 2>&1 | \
	 grep -v 'ossible pointer alignment problem' | tee lint.out

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

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

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