summaryrefslogtreecommitdiff
path: root/comms
diff options
context:
space:
mode:
Diffstat (limited to 'comms')
-rw-r--r--comms/tn3270/files/Makefile23
-rw-r--r--comms/tn3270/files/Makefile.inc14
-rw-r--r--comms/tn3270/files/mk/prog.mk32
-rw-r--r--comms/tn3270/files/mk/setup.mk43
-rw-r--r--comms/tn3270/files/mset/Makefile38
-rw-r--r--comms/tn3270/files/tn3270/Makefile145
-rw-r--r--comms/tn3270/files/tools/Makefile14
-rw-r--r--comms/tn3270/files/tools/Makefile.inc13
-rw-r--r--comms/tn3270/files/tools/mkastods/Makefile17
-rw-r--r--comms/tn3270/files/tools/mkastosc/Makefile18
-rw-r--r--comms/tn3270/files/tools/mkdctype/Makefile17
-rw-r--r--comms/tn3270/files/tools/mkdstoas/Makefile17
-rw-r--r--comms/tn3270/files/tools/mkhits/Makefile17
-rw-r--r--comms/tn3270/files/tools/mkmake/Makefile17
-rw-r--r--comms/tn3270/files/tools/prt3270/Makefile61
15 files changed, 285 insertions, 201 deletions
diff --git a/comms/tn3270/files/Makefile b/comms/tn3270/files/Makefile
index 2c66f71bbb7..dcd26dade47 100644
--- a/comms/tn3270/files/Makefile
+++ b/comms/tn3270/files/Makefile
@@ -1,6 +1,21 @@
-# $NetBSD: Makefile,v 1.1.1.1 2010/01/17 01:33:16 dholland Exp $
-# From NetBSD: Makefile,v 1.8 2005/09/17 16:52:02 chs Exp
+# $NetBSD: Makefile,v 1.2 2010/01/17 01:41:33 dholland Exp $
-SUBDIR = tools .WAIT tn3270 mset
+TOP=.
+include $(TOP)/mk/setup.mk
-.include <bsd.subdir.mk>
+all depend clean distclean:
+ (cd tools && $(MAKE) $@)
+ (cd tn3270 && $(MAKE) $@)
+ (cd mset && $(MAKE) $@)
+
+install:
+ $(INSTALLDIR) $(DESTDIR)$(BINDIR)
+ $(INSTALLDIR) $(DESTDIR)$(MAN1DIR)
+ $(INSTALLDIR) $(DESTDIR)$(MAN5DIR)
+ $(INSTALLDIR) $(DESTDIR)$(SHAREDIR)
+ $(INSTALLBIN) tn3270/tn3270 $(DESTDIR)$(BINDIR)/tn3270
+ $(INSTALLBIN) mset/mset $(DESTDIR)$(BINDIR)/mset
+ $(INSTALLMAN) tn3270/tn3270.1 $(DESTDIR)$(MAN1DIR)/mset.1
+ $(INSTALLMAN) mset/mset.1 $(DESTDIR)$(MAN1DIR)/mset.1
+ $(INSTALLMAN) mset/map3270.5 $(DESTDIR)$(MAN5DIR)/map3270.5
+ $(INSTALLFILE) mset/map3270 $(DESTDIR)$(SHAREDIR)/map3270
diff --git a/comms/tn3270/files/Makefile.inc b/comms/tn3270/files/Makefile.inc
deleted file mode 100644
index 8396c4b89b9..00000000000
--- a/comms/tn3270/files/Makefile.inc
+++ /dev/null
@@ -1,14 +0,0 @@
-# $NetBSD: Makefile.inc,v 1.1.1.1 2010/01/17 01:33:16 dholland Exp $
-# From NetBSD: Makefile.inc,v 1.12 2009/04/14 22:15:27 lukem Exp
-
-WARNS?= 1 # XXX -Wcast-qual -Wshadow issues
-
-USE_FORT?= yes # network client
-
-CPPFLAGS+=-DTERMCAP -DSRCRT -DKLUDGELINEMODE -DUSE_TERMIO -DTN3270 -Dunix
-CPPFLAGS+=-I${.CURDIR} -I.
-KBD= unix.kbd
-
-.if exists(${.CURDIR}/../../Makefile.inc)
-.include "${.CURDIR}/../../Makefile.inc"
-.endif
diff --git a/comms/tn3270/files/mk/prog.mk b/comms/tn3270/files/mk/prog.mk
new file mode 100644
index 00000000000..7f4a37666a0
--- /dev/null
+++ b/comms/tn3270/files/mk/prog.mk
@@ -0,0 +1,32 @@
+# $NetBSD: prog.mk,v 1.1 2010/01/17 01:41:33 dholland Exp $
+
+OBJS=$(SRCS:T:R:=.o)
+
+all: $(PROG)
+
+$(PROG): $(OBJS)
+ $(CC) $(LDFLAGS) $(OBJS) $(LIBS) -o $(PROG)
+
+.for S in $(SRCS:M*.c)
+$(S:T:R).o: $(S)
+ $(CC) $(CFLAGS) -c $(S)
+.endfor
+
+.for S in $(SRCS:M*.y)
+$(S:T:R).o: $(S)
+ $(YACC) -o $(S:.y=.c) $(S)
+ $(CC) $(CFLAGS) -c $(S:.y=.c)
+.endfor
+
+genfiles: $(GENFILES)
+
+depend:
+ $(MAKE) genfiles
+ $(MKDEP) $(CFLAGS) $(SRCS) > .depend
+
+-include .depend
+
+clean distclean:
+ rm -f $(PROG) *.o $(SRCS:M*.y:.y=.c) $(GENFILES)
+
+.PHONY: all genfiles depend clean distclean
diff --git a/comms/tn3270/files/mk/setup.mk b/comms/tn3270/files/mk/setup.mk
new file mode 100644
index 00000000000..546c6cd95b0
--- /dev/null
+++ b/comms/tn3270/files/mk/setup.mk
@@ -0,0 +1,43 @@
+# $NetBSD: setup.mk,v 1.1 2010/01/17 01:41:33 dholland Exp $
+
+KBD= unix.kbd
+
+############################################################
+# installation
+
+DESTDIR?=# empty
+PREFIX?=/usr/local
+
+BINDIR?=$(PREFIX)/bin
+MAN1DIR?=$(PREFIX)/man/man1
+MAN5DIR?=$(PREFIX)/man/man5
+SHAREDIR?=$(PREFIX)/share/tn3270
+
+BINMODE?=755
+MANMODE?=644
+FILESMODE?=644
+
+############################################################
+# compile flags
+
+CFLAGS+=-fstack-protector -Wstack-protector --param ssp-buffer-size=1
+CFLAGS+=-Wall -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith
+CFLAGS+=-Wsign-compare -Wno-traditional -Wno-pointer-sign
+CFLAGS+=-DTERMCAP -DSRCRT -DKLUDGELINEMODE -DUSE_TERMIO -DTN3270 -Dunix
+
+############################################################
+# programs
+
+CC?=cc
+CFLAGS?=-O
+
+MKDEP?=$(CC) -MM
+
+INSTALL?=install
+
+INSTALLDIR=$(INSTALL) -d
+INSTALLBIN?=$(INSTALL) -c -m $(BINMODE)
+INSTALLMAN?=$(INSTALL) -c -m $(MANMODE)
+INSTALLFILE?=$(INSTALL) -c -m $(FILESMODE)
+
+CFLAGS+=-DPATH_MAP3270=\"$(SHAREDIR)/map3270\"
diff --git a/comms/tn3270/files/mset/Makefile b/comms/tn3270/files/mset/Makefile
index 8982674eb58..d45bfe2aa42 100644
--- a/comms/tn3270/files/mset/Makefile
+++ b/comms/tn3270/files/mset/Makefile
@@ -1,30 +1,28 @@
-# $NetBSD: Makefile,v 1.1.1.1 2010/01/17 01:33:23 dholland Exp $
-# From NetBSD: Makefile,v 1.26 2003/10/21 10:01:22 lukem Exp
+# $NetBSD: Makefile,v 1.2 2010/01/17 01:41:34 dholland Exp $
-.include <bsd.own.mk>
+TOP=..
+include $(TOP)/mk/setup.mk
-PROG= mset
MAN= mset.1 map3270.5
-SRCS= astosc.c map3270.c mset.c
-DPSRCS= astosc.out
-MKASTOSCDIR!=cd $(.CURDIR)/../tools/mkastosc && ${PRINTOBJDIR}
-MKASTOSC=${MKASTOSCDIR}/mkastosc
+CFLAGS+=-I.
-${MKASTOSC}:
- @cd ${.CURDIR}/../tools/mkastosc && ${MAKE}
+PROG=mset
+SRCS=../api/astosc.c ../ascii/map3270.c ../ascii/mset.c
+GENFILES=astosc.out
-CLEANFILES+= astosc.out
-astosc.out: ${.CURDIR}/../ctlr/hostctlr.h ${.CURDIR}/../ctlr/function.h \
- ${.CURDIR}/../ctlr/${KBD} ${MKASTOSC}
- ${_MKTARGET_CREATE}
- ${MKASTOSC} \
- ${.CURDIR}/../ctlr/hostctlr.h ${.CURDIR}/../ctlr/function.h \
- < ${.CURDIR}/../ctlr/${KBD} > tmp
- mv -f tmp ${.TARGET}
+include $(TOP)/mk/prog.mk
-.include <bsd.prog.mk>
+MKASTOSC=../tools/mkastosc/mkastosc
-.PATH: ${.CURDIR}/../api ${.CURDIR}/../ascii
+astosc.out: ${MKASTOSC} ../ctlr/hostctlr.h ../ctlr/function.h ../ctlr/${KBD}
+ ${MKASTOSC} ../ctlr/hostctlr.h ../ctlr/function.h \
+ < ../ctlr/${KBD} > astosc.tmp
+ mv -f astosc.tmp ${.TARGET}
+clean: cleanhere
+cleanhere:
+ rm -f astosc.tmp
+
+# depend should catch this, but just in case
astosc.o: astosc.out
diff --git a/comms/tn3270/files/tn3270/Makefile b/comms/tn3270/files/tn3270/Makefile
index b3f2860c9df..b38f0b3cb37 100644
--- a/comms/tn3270/files/tn3270/Makefile
+++ b/comms/tn3270/files/tn3270/Makefile
@@ -1,87 +1,88 @@
-# $NetBSD: Makefile,v 1.1.1.1 2010/01/17 01:33:25 dholland Exp $
-# From NetBSD: Makefile,v 1.38 2008/08/29 00:02:24 gmcgarry Exp
-
-.include <bsd.own.mk>
-
-CPPFLAGS+=-I${NETBSDSRCDIR}/lib -I${NETBSDSRCDIR}/usr.bin/telnet
-LDADD+= -lcurses -lcrypt
-DPADD+= ${LIBCURSES} ${LIBCRYPT}
-
-PROG= tn3270
-SRCS= api.c api_bsd.c api_exch.c apilib.c asc_ebc.c astosc.c commands.c \
- dctype.c disp_asc.c ebc_disp.c function.c genbsubs.c genget.c \
- globals.c inbound.c main.c map3270.c network.c oia.c options.c \
- outbound.c ring.c sys_bsd.c system.c telnet.c termin.c terminal.c \
- termout.c tn3270.c utilities.c
-DPSRCS= asc_disp.out astosc.out disp_asc.out kbd.out
-
-MKASTOSCDIR !=cd $(.CURDIR)/../tools/mkastosc && ${PRINTOBJDIR}
-MKASTOSC= ${MKASTOSCDIR}/mkastosc
-
-${MKASTOSC}:
- @cd ${.CURDIR}/../tools/mkastosc && ${MAKE}
-
-MKASTODSDIR!=cd $(.CURDIR)/../tools/mkastods && ${PRINTOBJDIR}
-MKASTODS= ${MKASTODSDIR}/mkastods
-
-${MKASTODS}:
- @cd ${.CURDIR}/../tools/mkastods && ${MAKE}
-
-MKDSTOASDIR!=cd $(.CURDIR)/../tools/mkdstoas && ${PRINTOBJDIR}
-MKDSTOAS= ${MKDSTOASDIR}/mkdstoas
-
-${MKDSTOAS}:
- @cd ${.CURDIR}/../tools/mkdstoas && ${MAKE}
-
-MKHITSDIR!=cd $(.CURDIR)/../tools/mkhits && ${PRINTOBJDIR}
-MKHITS= ${MKHITSDIR}/mkhits
-
-${MKHITS}:
- @cd ${.CURDIR}/../tools/mkhits && ${MAKE}
-
-astosc.out: ${.CURDIR}/../ctlr/hostctlr.h ${.CURDIR}/../ctlr/function.h \
- ${.CURDIR}/../ctlr/${KBD} ${MKASTOSC}
- ${_MKTARGET_CREATE}
- ${MKASTOSC} \
- ${.CURDIR}/../ctlr/hostctlr.h ${.CURDIR}/../ctlr/function.h \
- < ${.CURDIR}/../ctlr/${KBD} > astosc.tmp
+# $NetBSD: Makefile,v 1.2 2010/01/17 01:41:34 dholland Exp $
+
+TOP=..
+include $(TOP)/mk/setup.mk
+
+#.if (defined(HAVE_GCC) && ${HAVE_GCC} == 4) || defined(HAVE_PCC)
+#.for f in api commands system telnet terminal termout tn3270 utilities
+#COPTS.${f}.c+= -Wno-pointer-sign
+#.endfor
+#.endif
+
+CFLAGS+=-I.
+
+PROG=tn3270
+SRCS=\
+ ../api/api_bsd.c \
+ ../api/api_exch.c \
+ ../api/apilib.c \
+ ../api/asc_ebc.c \
+ ../api/astosc.c \
+ ../api/dctype.c \
+ ../api/disp_asc.c \
+ ../api/ebc_disp.c \
+ ../ascii/map3270.c \
+ ../ascii/termin.c \
+ ../ctlr/api.c \
+ ../ctlr/function.c \
+ ../ctlr/inbound.c \
+ ../ctlr/oia.c \
+ ../ctlr/options.c \
+ ../ctlr/outbound.c \
+ ../general/genbsubs.c \
+ ../general/globals.c \
+ ../sys_curses/system.c \
+ ../sys_curses/termout.c
+
+GENFILES=asc_disp.out astosc.out disp_asc.out kbd.out
+
+CFLAGS+=-I../telnet
+SRCS+=\
+ ../telnet/libtelnet/genget.c \
+ ../telnet/commands.c \
+ ../telnet/main.c \
+ ../telnet/network.c \
+ ../telnet/ring.c \
+ ../telnet/sys_bsd.c \
+ ../telnet/telnet.c \
+ ../telnet/terminal.c \
+ ../telnet/tn3270.c \
+ ../telnet/utilities.c
+
+LIBS+=-lcurses
+LIBS+=-lcrypt
+
+include $(TOP)/mk/prog.mk
+
+MKASTOSC=../tools/mkastosc/mkastosc
+MKASTODS=../tools/mkastods/mkastods
+MKDSTOAS=../tools/mkdstoas/mkdstoas
+MKHITS=../tools/mkhits/mkhits
+
+astosc.out: ${MKASTOSC} ../ctlr/hostctlr.h ../ctlr/function.h ../ctlr/${KBD}
+ ${MKASTOSC} ../ctlr/hostctlr.h ../ctlr/function.h \
+ < ../ctlr/${KBD} > astosc.tmp
mv -f astosc.tmp ${.TARGET}
-CLEANFILES+= astosc.tmp astosc.out
asc_disp.out: ${MKASTODS}
- ${_MKTARGET_CREATE}
${MKASTODS} > asc_disp.tmp
mv -f asc_disp.tmp ${.TARGET}
-CLEANFILES+= asc_disp.tmp asc_disp.out
disp_asc.out: ${MKDSTOAS}
- ${_MKTARGET_CREATE}
${MKDSTOAS} > disp_asc.tmp
mv -f disp_asc.tmp ${.TARGET}
-CLEANFILES+= disp_asc.tmp disp_asc.out
-
-kbd.out: ${.CURDIR}/../ctlr/hostctlr.h ${.CURDIR}/../ctlr/${KBD} ${MKHITS}
- ${_MKTARGET_CREATE}
- ${CC} ${CPPFLAGS} -E ${.CURDIR}/../ctlr/function.c > TMPfunc.out
- ${MKHITS} \
- ${.CURDIR}/../ctlr/hostctlr.h TMPfunc.out \
- < ${.CURDIR}/../ctlr/${KBD} > kbd.tmp
- rm -f TMPFunc.out
- mv -f kbd.tmp ${.TARGET}
-CLEANFILES+= TMPfunc.out kbd.tmp kbd.out
-
-.include <bsd.prog.mk>
-.if (defined(HAVE_GCC) && ${HAVE_GCC} == 4) || defined(HAVE_PCC)
-.for f in api commands system telnet terminal termout tn3270 utilities
-COPTS.${f}.c+= -Wno-pointer-sign
-.endfor
-.endif
+kbd.out: ${MKHITS} ../ctlr/hostctlr.h ../ctlr/${KBD} ../ctlr/function.c
+ ${CC} ${CPPFLAGS} -E ${.CURDIR}/../ctlr/function.c > kbd.tmp
+ ${MKHITS} ../ctlr/hostctlr.h kbd.tmp < ../ctlr/${KBD} > kbd.tmp2
+ rm -f kbd.tmp
+ mv -f kbd.tmp2 ${.TARGET}
-.PATH: ${.CURDIR}/../api ${.CURDIR}/../ascii ${.CURDIR}/../ctlr
-.PATH: ${.CURDIR}/../general ${.CURDIR}/../sys_curses ${.CURDIR}/../../telnet
-.PATH: ${NETBSDSRCDIR}/lib/libtelnet
+clean: cleanhere
+cleanhere:
+ rm -f astosc.tmp asc_disp.tmp disp_asc.tmp kbd.tmp kbd.tmp2
+# depend should catch these, but just in case
astosc.o: astosc.out
disp_asc.o: asc_disp.out disp_asc.out
inbound.o: kbd.out
diff --git a/comms/tn3270/files/tools/Makefile b/comms/tn3270/files/tools/Makefile
index 99794b98fcc..6998a20fbd1 100644
--- a/comms/tn3270/files/tools/Makefile
+++ b/comms/tn3270/files/tools/Makefile
@@ -1,6 +1,10 @@
-# $NetBSD: Makefile,v 1.1.1.1 2010/01/17 01:33:25 dholland Exp $
-# From NetBSD: Makefile,v 1.6 2005/09/17 16:52:02 chs Exp
+# $NetBSD: Makefile,v 1.2 2010/01/17 01:41:34 dholland Exp $
-SUBDIR = mkhits mkastosc mkastods mkdstoas mkdctype mkmake .WAIT prt3270
-
-.include <bsd.subdir.mk>
+all depend clean distclean:
+ (cd mkhits && $(MAKE) $@)
+ (cd mkastosc && $(MAKE) $@)
+ (cd mkastods && $(MAKE) $@)
+ (cd mkdstoas && $(MAKE) $@)
+ (cd mkdctype && $(MAKE) $@)
+ (cd mkmake && $(MAKE) $@)
+ (cd prt3270 && $(MAKE) $@)
diff --git a/comms/tn3270/files/tools/Makefile.inc b/comms/tn3270/files/tools/Makefile.inc
deleted file mode 100644
index 64e4f5cba1c..00000000000
--- a/comms/tn3270/files/tools/Makefile.inc
+++ /dev/null
@@ -1,13 +0,0 @@
-# $NetBSD: Makefile.inc,v 1.1.1.1 2010/01/17 01:33:25 dholland Exp $
-# From NetBSD: Makefile.inc,v 1.8 2002/09/18 14:00:42 lukem Exp
-
-NOMAN= # defined
-
-HOST_CPPFLAGS+=-I${.CURDIR}/../../api
-KBD= unix.kbd
-
-.PATH: ${.CURDIR}/../../api
-
-.if exists(${.CURDIR}/../../../Makefile.inc)
-.include "${.CURDIR}/../../../Makefile.inc"
-.endif
diff --git a/comms/tn3270/files/tools/mkastods/Makefile b/comms/tn3270/files/tools/mkastods/Makefile
index d3c70cb77cc..54bf16fb560 100644
--- a/comms/tn3270/files/tools/mkastods/Makefile
+++ b/comms/tn3270/files/tools/mkastods/Makefile
@@ -1,8 +1,13 @@
-# $NetBSD: Makefile,v 1.1.1.1 2010/01/17 01:33:25 dholland Exp $
-# From NetBSD: Makefile,v 1.10 2002/09/15 01:27:45 thorpej Exp
+# $NetBSD: Makefile,v 1.2 2010/01/17 01:41:34 dholland Exp $
-HOSTPROG= mkastods
-HOST_CPPFLAGS+= -DHOST_TOOL
-SRCS= mkastods.c asc_ebc.c ebc_disp.c
+TOP=../..
+include $(TOP)/mk/setup.mk
-.include <bsd.hostprog.mk>
+PROG=mkastods
+SRCS=mkastods.c ../../api/asc_ebc.c ../../api/ebc_disp.c
+
+CFLAGS+=-I../../api
+CFLAGS+=-DHOST_TOOL
+
+# should be hostprog.mk for crosscompiling (FUTURE)
+include $(TOP)/mk/prog.mk
diff --git a/comms/tn3270/files/tools/mkastosc/Makefile b/comms/tn3270/files/tools/mkastosc/Makefile
index e9a0bad8ec7..52680182d4d 100644
--- a/comms/tn3270/files/tools/mkastosc/Makefile
+++ b/comms/tn3270/files/tools/mkastosc/Makefile
@@ -1,12 +1,14 @@
-# $NetBSD: Makefile,v 1.1.1.1 2010/01/17 01:33:25 dholland Exp $
-# From NetBSD: Makefile,v 1.10 2002/09/15 01:27:46 thorpej Exp
+# $NetBSD: Makefile,v 1.2 2010/01/17 01:41:34 dholland Exp $
-HOSTPROG= mkastosc
-HOST_CPPFLAGS+= -DHOST_TOOL
-SRCS= mkastosc.c dohits.c asc_ebc.c ebc_disp.c
+TOP=../..
+include $(TOP)/mk/setup.mk
-HOST_CPPFLAGS+=-I${.CURDIR}/../mkhits
-.PATH: ${.CURDIR}/../mkhits
+PROG=mkastosc
+SRCS=mkastosc.c ../mkhits/dohits.c ../../api/asc_ebc.c ../../api/ebc_disp.c
-.include <bsd.hostprog.mk>
+CFLAGS+=-I../../api
+CFLAGS+=-I../mkhits
+CFLAGS+=-DHOST_TOOL
+# should be hostprog.mk for crosscompiling (FUTURE)
+include $(TOP)/mk/prog.mk
diff --git a/comms/tn3270/files/tools/mkdctype/Makefile b/comms/tn3270/files/tools/mkdctype/Makefile
index 5cd8ac35dc8..cc03771b618 100644
--- a/comms/tn3270/files/tools/mkdctype/Makefile
+++ b/comms/tn3270/files/tools/mkdctype/Makefile
@@ -1,8 +1,13 @@
-# $NetBSD: Makefile,v 1.1.1.1 2010/01/17 01:33:25 dholland Exp $
-# From NetBSD: Makefile,v 1.11 2002/09/15 01:27:46 thorpej Exp
+# $NetBSD: Makefile,v 1.2 2010/01/17 01:41:34 dholland Exp $
-HOSTPROG= mkdctype
-HOST_CPPFLAGS+= -DHOST_TOOL
-SRCS= mkdctype.c asc_ebc.c ebc_disp.c ectype.c
+TOP=../..
+include $(TOP)/mk/setup.mk
-.include <bsd.hostprog.mk>
+PROG=mkdctype
+SRCS=mkdctype.c ../../api/asc_ebc.c ../../api/ebc_disp.c ectype.c
+
+CFLAGS+=-I../../api
+CFLAGS+=-DHOST_TOOL
+
+# should be hostprog.mk for crosscompiling (FUTURE)
+include $(TOP)/mk/prog.mk
diff --git a/comms/tn3270/files/tools/mkdstoas/Makefile b/comms/tn3270/files/tools/mkdstoas/Makefile
index e3a1a9c7b1d..d054cc6db89 100644
--- a/comms/tn3270/files/tools/mkdstoas/Makefile
+++ b/comms/tn3270/files/tools/mkdstoas/Makefile
@@ -1,8 +1,13 @@
-# $NetBSD: Makefile,v 1.1.1.1 2010/01/17 01:33:26 dholland Exp $
-# From NetBSD: Makefile,v 1.10 2002/09/15 01:27:47 thorpej Exp
+# $NetBSD: Makefile,v 1.2 2010/01/17 01:41:34 dholland Exp $
-HOSTPROG= mkdstoas
-HOST_CPPFLAGS+= -DHOST_TOOL
-SRCS= mkdstoas.c asc_ebc.c ebc_disp.c
+TOP=../..
+include $(TOP)/mk/setup.mk
-.include <bsd.hostprog.mk>
+PROG=mkdstoas
+SRCS=mkdstoas.c ../../api/asc_ebc.c ../../api/ebc_disp.c
+
+CFLAGS+=-I../../api
+CFLAGS+=-DHOST_TOOL
+
+# should be hostprog.mk for crosscompiling (FUTURE)
+include $(TOP)/mk/prog.mk
diff --git a/comms/tn3270/files/tools/mkhits/Makefile b/comms/tn3270/files/tools/mkhits/Makefile
index 6dbfcc791eb..8e9f08b931f 100644
--- a/comms/tn3270/files/tools/mkhits/Makefile
+++ b/comms/tn3270/files/tools/mkhits/Makefile
@@ -1,8 +1,13 @@
-# $NetBSD: Makefile,v 1.1.1.1 2010/01/17 01:33:26 dholland Exp $
-# From NetBSD: Makefile,v 1.10 2002/09/15 01:27:47 thorpej Exp
+# $NetBSD: Makefile,v 1.2 2010/01/17 01:41:34 dholland Exp $
-HOSTPROG= mkhits
-HOST_CPPFLAGS+= -DHOST_TOOL
-SRCS= mkhits.c dohits.c asc_ebc.c ebc_disp.c
+TOP=../..
+include $(TOP)/mk/setup.mk
-.include <bsd.hostprog.mk>
+PROG=mkhits
+SRCS=mkhits.c dohits.c ../../api/asc_ebc.c ../../api/ebc_disp.c
+
+CFLAGS+=-I../../api
+CFLAGS+=-DHOST_TOOL
+
+# should be hostprog.mk for crosscompiling (FUTURE)
+include $(TOP)/mk/prog.mk
diff --git a/comms/tn3270/files/tools/mkmake/Makefile b/comms/tn3270/files/tools/mkmake/Makefile
index dbe17f47e3a..d8a103ff205 100644
--- a/comms/tn3270/files/tools/mkmake/Makefile
+++ b/comms/tn3270/files/tools/mkmake/Makefile
@@ -1,10 +1,13 @@
-# $NetBSD: Makefile,v 1.1.1.1 2010/01/17 01:33:26 dholland Exp $
-# From NetBSD: Makefile,v 1.4 2006/03/20 01:34:49 gdamore Exp
+# $NetBSD: Makefile,v 1.2 2010/01/17 01:41:34 dholland Exp $
-HOSTPROG= mkmake
-HOST_CPPFLAGS+= -DHOST_TOOL
-SRCS= mkmake.y
+TOP=../..
+include $(TOP)/mk/setup.mk
-.include <bsd.hostprog.mk>
+PROG=mkmake
+SRCS=mkmake.y
-.PATH: ${.CURDIR}/../../api ${.CURDIR}/../../ascii
+CFLAGS+=-I../../api
+CFLAGS+=-DHOST_TOOL
+
+# should be hostprog.mk for crosscompiling (FUTURE)
+include $(TOP)/mk/prog.mk
diff --git a/comms/tn3270/files/tools/prt3270/Makefile b/comms/tn3270/files/tools/prt3270/Makefile
index 800a5c59724..ef5bd3585a5 100644
--- a/comms/tn3270/files/tools/prt3270/Makefile
+++ b/comms/tn3270/files/tools/prt3270/Makefile
@@ -1,47 +1,40 @@
-# $NetBSD: Makefile,v 1.1.1.1 2010/01/17 01:33:27 dholland Exp $
-# From NetBSD: Makefile,v 1.11 2006/03/20 01:34:49 gdamore Exp
+# $NetBSD: Makefile,v 1.2 2010/01/17 01:41:34 dholland Exp $
-NOMAN= # defined
+TOP=../..
+include $(TOP)/mk/setup.mk
-.include <bsd.own.mk>
+PROG=prt3270
+SRCS=prt3270.c ../../api/asc_ebc.c ../../api/ebc_disp.c ../../api/astosc.c
-HOSTPROG= prt3270
-SRCS= prt3270.c asc_ebc.c ebc_disp.c astosc.c
-DPSRCS= kbd.out astosc.out
-HOST_CPPFLAGS+=-I. -DHOST_TOOL
+GENFILES=kbd.out astosc.out
-MKHITSDIR!=cd $(.CURDIR)/../mkhits && ${PRINTOBJDIR}
-MKHITS=${MKHITSDIR}/mkhits
+CFLAGS+=-I../../api
+CFLAGS+=-I.
+CFLAGS+=-DHOST_TOOL
-${MKHITS}:
- cd ${.CURDIR}/../mkhits; ${MAKE}
+# should be hostprog.mk for crosscompiling (FUTURE)
+include $(TOP)/mk/prog.mk
-kbd.out: ${.CURDIR}/../../ctlr/hostctlr.h ${.CURDIR}/../../ctlr/${KBD} ${MKHITS}
- ${HOST_CC} ${HOST_CPPFLAGS} -E ${.CURDIR}/../../ctlr/function.c > TMPfunc.out
- ${MKHITS} \
- ${.CURDIR}/../../ctlr/hostctlr.h TMPfunc.out \
- < ${.CURDIR}/../../ctlr/${KBD} > kbd.tmp
- rm -f TMPfunc.out
- mv -f kbd.tmp ${.TARGET}
-CLEANFILES+= TMPfunc.out kbd.tmp kbd.out
+MKHITS=../mkhits/mkhits
+MKASTOSC=../mkastosc/mkastosc
-MKASTOSCDIR!=cd ${.CURDIR}/../mkastosc && ${PRINTOBJDIR}
-MKASTOSC= ${MKASTOSCDIR}/mkastosc
+kbd.out astosc.out: ../../ctlr/hostctlr.h ../../ctlr/$(KBD)
-${MKASTOSC}:
- cd ${.CURDIR}/../mkastosc; ${MAKE}
+kbd.out: $(MKHITS) ../../ctlr/function.c
+ $(CC) $(CFLAGS) -E ../../ctlr/function.c > kbd.tmp
+ $(MKHITS) ../../ctlr/hostctlr.h kbd.tmp < ../../ctlr/$(KBD) > kbd.tmp2
+ rm -f kbd.tmp
+ mv -f kbd.tmp2 kbd.out
-astosc.out: ${.CURDIR}/../../ctlr/hostctlr.h ${.CURDIR}/../../ctlr/function.h \
- ${.CURDIR}/../../ctlr/${KBD} ${MKASTOSC}
- ${MKASTOSC} \
- ${.CURDIR}/../../ctlr/hostctlr.h ${.CURDIR}/../../ctlr/function.h \
- < ${.CURDIR}/../../ctlr/${KBD} > astosc.tmp
- mv -f astosc.tmp ${.TARGET}
-CLEANFILES+= astosc.tmp astosc.out
+astosc.out: ${MKASTOSC} ../../ctlr/function.h
+ ${MKASTOSC} ../../ctlr/hostctlr.h ../../ctlr/function.h \
+ < ../../ctlr/${KBD} > astosc.tmp
+ mv -f astosc.tmp astosc.out
-.include <bsd.hostprog.mk>
-
-.PATH: ${.CURDIR}/../../api ${.CURDIR}/../../ascii
+clean: cleanhere
+cleanhere:
+ rm -f kbd.tmp kbd.tmp2 astosc.tmp
+# depend ought to pick these up, but just in case
astosc.o: astosc.out
prt3270.o: kbd.out