From b3c1c587b64b09f5acaec7fd72efae50bb8d633a Mon Sep 17 00:00:00 2001 From: Mark Murray Date: Fri, 30 Nov 2001 21:34:51 +0000 Subject: [PATCH] Diff-reduce WRT src/secure/*telnet*/Makefile. Also, add an "unifdef:" target, so that the telnet sources can be remade from the crypto sources in src/crypto/telnet. --- lib/libtelnet/Makefile | 23 ++++++++++++++++++----- libexec/telnetd/Makefile | 15 +++++++++++++-- usr.bin/telnet/Makefile | 19 +++++++++++++++---- 3 files changed, 46 insertions(+), 11 deletions(-) diff --git a/lib/libtelnet/Makefile b/lib/libtelnet/Makefile index ec466707a5b4..2b55cbe0c154 100644 --- a/lib/libtelnet/Makefile +++ b/lib/libtelnet/Makefile @@ -8,15 +8,28 @@ INTERNALSTATICLIB=yes NOPIC= yes SRCS= genget.c getent.c misc.c -CFLAGS+= -DHAS_CGETENT + +WARNS?= 2 + +unifdef: + -cd ${.CURDIR} ; \ + ( for i in *.[ch] ; do \ + unifdef -UAUTHENTICATION -UENCRYPTION \ + ${.CURDIR}/../../crypto/telnet/libtelnet/$$i \ + > ${.CURDIR}/$$i ; \ + echo $$i ; \ + done ) + +.include # # Remove obsolete shared libraries, if any. We don't bother moving them # to /usr/lib/compat, since they were only used by telnet, telnetd and # tn3270. # -beforeinstall: +beforeinstall: __remove-stale-libs +__remove-stale-libs: .PHONY +.if exists(${DESTDIR}${SHLIBDIR}/lib${LIB}.so.2.0) + -chflags noschg ${DESTDIR}${SHLIBDIR}/lib${LIB}.so.2.0 rm -f ${DESTDIR}${SHLIBDIR}/lib${LIB}.so.2.0 - -.include - +.endif diff --git a/libexec/telnetd/Makefile b/libexec/telnetd/Makefile index b6ac1e029dbb..0c5b23ed7eeb 100644 --- a/libexec/telnetd/Makefile +++ b/libexec/telnetd/Makefile @@ -6,12 +6,14 @@ PROG= telnetd MAN= telnetd.8 +SRCS= global.c slc.c state.c sys_term.c telnetd.c \ + termstat.c utility.c + CFLAGS+= -DLINEMODE -DUSE_TERMIO -DDIAGNOSTICS -DOLD_ENVIRON \ -DENV_HACK \ -I${.CURDIR}/../../lib -DINET6 -SRCS= global.c slc.c state.c sys_term.c telnetd.c \ - termstat.c utility.c +WARNS?= 2 .if exists(${.OBJDIR}/../../lib/libtelnet) LIBTELNET= ${.OBJDIR}/../../lib/libtelnet/libtelnet.a @@ -22,4 +24,13 @@ LIBTELNET= ${.CURDIR}/../../lib/libtelnet/libtelnet.a DPADD= ${LIBUTIL} ${LIBTERMCAP} ${LIBTELNET} LDADD= -lutil -ltermcap ${LIBTELNET} +unifdef: + -cd ${.CURDIR} ; \ + ( for i in *.[ch] ; do \ + unifdef -UAUTHENTICATION -UENCRYPTION \ + ${.CURDIR}/../../crypto/telnet/telnetd/$$i \ + > ${.CURDIR}/$$i ; \ + echo $$i ; \ + done ) + .include diff --git a/usr.bin/telnet/Makefile b/usr.bin/telnet/Makefile index 8e1adfc0de3f..65b41bbaee31 100644 --- a/usr.bin/telnet/Makefile +++ b/usr.bin/telnet/Makefile @@ -2,11 +2,13 @@ PROG= telnet -CFLAGS+= -DKLUDGELINEMODE -DUSE_TERMIO -DENV_HACK -DOPIE \ - -I${.CURDIR}/../../lib - SRCS= commands.c main.c network.c ring.c sys_bsd.c \ - telnet.c terminal.c tn3270.c utilities.c + telnet.c terminal.c utilities.c + +CFLAGS+= -DKLUDGELINEMODE -DUSE_TERMIO -DENV_HACK -DOPIE \ + -I${.CURDIR}/../../lib -I${.CURDIR}/../../lib/libtelnet/ + +WARNS?= 2 .if exists(${.OBJDIR}/../../lib/libtelnet) LIBTELNET= ${.OBJDIR}/../../lib/libtelnet/libtelnet.a @@ -28,4 +30,13 @@ SRCS+= genget.c getent.c misc.c CFLAGS+= -DHAS_CGETENT .endif +unifdef: + -cd ${.CURDIR} ; \ + ( for i in *.[ch] ; do \ + unifdef -UAUTHENTICATION -UENCRYPTION \ + ${.CURDIR}/../../crypto/telnet/telnet/$$i \ + > ${.CURDIR}/$$i ; \ + echo $$i ; \ + done ) + .include