csh(1): Separate hostprog.
authorzrj <rimvydas.jasinskas@gmail.com>
Wed, 25 Apr 2018 16:20:33 +0000 (19:20 +0300)
committerzrj <zrj@dragonflybsd.org>
Wed, 25 Apr 2018 18:21:13 +0000 (21:21 +0300)
bin/csh/Makefile
bin/csh/Makefile.inc [new file with mode: 0644]
bin/csh/csh/Makefile [copied from bin/csh/Makefile with 94% similarity]
bin/csh/csh/config.h [moved from bin/csh/config.h with 100% similarity]
bin/csh/csh/config_p.h [moved from bin/csh/config_p.h with 100% similarity]
bin/csh/csh/host.defs [moved from bin/csh/host.defs with 100% similarity]
bin/csh/gethost/Makefile [new file with mode: 0644]

index 3d8406c..5247185 100644 (file)
@@ -1,125 +1,3 @@
-# $FreeBSD: src/bin/csh/Makefile,v 1.11.2.8 2002/02/19 00:36:40 mp Exp $
-#      @(#)Makefile    8.1 (Berkeley) 5/31/93
-#
-# C Shell with process control; VM/UNIX VAX Makefile
-# Bill Joy UC Berkeley; Jim Kulp IIASA, Austria
-#
-# To profile, put -DPROF in DEFS and -pg in CFLAGS, and recompile.
-
-WARNS?=        2
-
-TCSHDIR= ${.CURDIR}/../../contrib/tcsh-6
-CONTRIBDIR=${TCSHDIR}
-.PATH: ${TCSHDIR}
-
-PROG=  csh
-DFLAGS= -D_PATH_TCSHELL='"/bin/${PROG}"'
-CFLAGS+= -I. -I${.CURDIR} -I${TCSHDIR} ${DFLAGS}
-SRCS=  sh.c sh.dir.c sh.dol.c sh.err.c sh.exec.c sh.char.c \
-       sh.exp.c sh.file.c sh.func.c sh.glob.c sh.hist.c sh.init.c \
-       sh.lex.c sh.misc.c sh.parse.c sh.print.c sh.proc.c sh.sem.c \
-       sh.set.c sh.time.c sh.char.h sh.dir.h sh.proc.h sh.h
-SRCS+= sh.decls.h glob.c glob.h mi.termios.c dotlock.c
-SRCS+= tw.decls.h tw.h tw.help.c tw.init.c tw.parse.c tw.spell.c \
-       tw.comp.c tw.color.c
-SRCS+= ed.chared.c ed.decls.h ed.defns.c ed.h ed.init.c ed.inputl.c \
-       ed.refresh.c ed.screen.c ed.xmap.c ed.term.c ed.term.h
-SRCS+= tc.alloc.c tc.bind.c tc.const.c tc.decls.h tc.disc.c \
-       tc.func.c tc.nls.c tc.os.c tc.os.h tc.printf.c tc.prompt.c \
-       tc.sched.c tc.sig.c tc.sig.h tc.str.c sh.types.h tc.vers.c tc.wait.h \
-       tc.who.c tc.h
-GENHDRS= ed.defns.h sh.err.h tc.const.h tc.defs.c
-SRCS+= ${GENHDRS}
-
-MLINKS= csh.1 tcsh.1
-# MLINKS for Shell built in commands for which there are no userland
-# utilities of the same name are handled with the associated manpage,
-# builtin.1 in share/man/man1/.
-
-DPADD= ${LIBNCURSES} ${LIBCRYPT} ${LIBCRYPTO}
-LDADD= -lprivate_ncurses -lcrypt -lprivate_crypto
-LDFLAGS+=      ${PRIVATELIB_LDFLAGS}
-
-# XXX hmmm
-.if defined(BOOTSTRAPPING)
-. if ${CFLAGS:M-flto}
-LDFLAGS+=      -Wl,--allow-multiple-definition
-. endif
-.endif
-
-LINKS= ${BINDIR}/csh ${BINDIR}/tcsh
-
-CLEANFILES= ${GENHDRS} gethost.nx csh.1
-
-.if !defined(NO_SHARE)
-FILESDIR= ${SHAREDIR}/examples/tcsh
-FILES= complete.tcsh
-
-CATALOGS=      et:et_EE.ISO8859-15 \
-               finnish:fi_FI.ISO8859-1 \
-               french:fr_FR.ISO8859-1 \
-               german:de_DE.ISO8859-1 \
-               greek:el_GR.ISO8859-7 \
-               italian:it_IT.ISO8859-1 \
-               ja:ja_JP.eucJP \
-               russian:ru_RU.KOI8-R \
-               spanish:es_ES.ISO8859-1 \
-               ukrainian:uk_UA.KOI8-U
-
-NLSLINKS_fi_FI.ISO8859-1= fi_FI.ISO8859-15
-NLSLINKS_fr_FR.ISO8859-1= fr_BE.ISO8859-1 fr_BE.ISO8859-15 \
-               fr_CA.ISO8859-1 fr_CA.ISO8859-15 fr_CH.ISO8859-1 \
-               fr_CH.ISO8859-15 fr_FR.ISO8859-15
-NLSLINKS_de_DE.ISO8859-1= de_AT.ISO8859-1 de_AT.ISO8859-15 de_CH.ISO8859-1 \
-               de_CH.ISO8859-15 de_DE.ISO8859-15
-NLSLINKS_it_IT.ISO8859-1= it_CH.ISO8859-1 it_CH.ISO8859-15 it_IT.ISO8859-15
-NLSLINKS_es_ES.ISO8859-1= es_ES.ISO8859-15
-
-NLSNAME= tcsh
-
-.for catalog in ${CATALOGS}
-NLS+=          ${catalog:C/.*://}
-NLSSRCDIR_${catalog:C/.*://}= ${TCSHDIR}/nls/${catalog:C/:.*//}
-NLSSRCFILES_${catalog:C/.*://}!= cd ${NLSSRCDIR_${catalog:C/.*://}}; echo set[0-9]*
-.endfor
-.endif
-
-csh.1: tcsh.man
-       ${LN} -sf ${.ALLSRC} ${.TARGET}
-
-build-tools: gethost.nx
-
-gethost.nx: gethost.c sh.err.h tc.const.h sh.h
-
-tc.defs.c: gethost.nx ${.CURDIR}/host.defs
-       @rm -f ${.TARGET}
-       @echo "/* Do not edit this file, make creates it */" > ${.TARGET}
-       ./gethost.nx ${.CURDIR}/host.defs >> ${.TARGET}
-
-ed.defns.h: ed.defns.c
-       @rm -f ${.TARGET}
-       @echo '/* Do not edit this file, make creates it. */' > ${.TARGET}
-       @echo '#ifndef _h_ed_defns' >> ${.TARGET}
-       @echo '#define _h_ed_defns' >> ${.TARGET}
-       grep '[FV]_' ${TCSHDIR}/ed.defns.c | grep '^#define' >> ${.TARGET}
-       @echo '#endif /* _h_ed_defns */' >> ${.TARGET}
-
-sh.err.h: sh.err.c
-       @rm -f ${.TARGET}
-       @echo '/* Do not edit this file, make creates it. */' > ${.TARGET}
-       @echo '#ifndef _h_sh_err' >> ${.TARGET}
-       @echo '#define _h_sh_err' >> ${.TARGET}
-       grep 'ERR_' ${.ALLSRC} | grep '^#define' >> ${.TARGET}
-       @echo '#endif /* _h_sh_err */' >> ${.TARGET}
-
-tc.const.h: tc.const.c sh.char.h config.h config_f.h sh.types.h sh.err.h
-       @rm -f ${.TARGET}
-       @echo '/* Do not edit this file, make creates it. */' > ${.TARGET}
-       @echo '#ifndef _h_tc_const' >> ${.TARGET}
-       @echo '#define _h_tc_const' >> ${.TARGET}
-       ${CC} -E ${CFLAGS} ${.ALLSRC} -D_h_tc_const | grep 'Char STR' | \
-           sed -e 's/Char \([a-zA-Z0-9_]*\)\(.*\)/extern Char \1[];/' | \
-           sort >> ${.TARGET}
-       @echo '#endif /* _h_tc_const */' >> ${.TARGET}
-
-.include <bsd.prog.mk>
+SUBDIR=                gethost
+SUBDIR+=       csh
+.include <bsd.subdir.mk>
diff --git a/bin/csh/Makefile.inc b/bin/csh/Makefile.inc
new file mode 100644 (file)
index 0000000..01b5f23
--- /dev/null
@@ -0,0 +1 @@
+.include "../Makefile.inc"
similarity index 94%
copy from bin/csh/Makefile
copy to bin/csh/csh/Makefile
index 3d8406c..3e12c79 100644 (file)
@@ -8,7 +8,7 @@
 
 WARNS?=        2
 
-TCSHDIR= ${.CURDIR}/../../contrib/tcsh-6
+TCSHDIR= ${.CURDIR}/../../../contrib/tcsh-6
 CONTRIBDIR=${TCSHDIR}
 .PATH: ${TCSHDIR}
 
@@ -49,7 +49,7 @@ LDFLAGS+=     -Wl,--allow-multiple-definition
 
 LINKS= ${BINDIR}/csh ${BINDIR}/tcsh
 
-CLEANFILES= ${GENHDRS} gethost.nx csh.1
+CLEANFILES= ${GENHDRS} csh.1
 
 .if !defined(NO_SHARE)
 FILESDIR= ${SHAREDIR}/examples/tcsh
@@ -87,14 +87,10 @@ NLSSRCFILES_${catalog:C/.*://}!= cd ${NLSSRCDIR_${catalog:C/.*://}}; echo set[0-
 csh.1: tcsh.man
        ${LN} -sf ${.ALLSRC} ${.TARGET}
 
-build-tools: gethost.nx
-
-gethost.nx: gethost.c sh.err.h tc.const.h sh.h
-
-tc.defs.c: gethost.nx ${.CURDIR}/host.defs
+tc.defs.c: ${.CURDIR}/host.defs gethost.c
        @rm -f ${.TARGET}
        @echo "/* Do not edit this file, make creates it */" > ${.TARGET}
-       ./gethost.nx ${.CURDIR}/host.defs >> ${.TARGET}
+       ${.OBJDIR}/../gethost/gethost.nx ${.CURDIR}/host.defs >> ${.TARGET}
 
 ed.defns.h: ed.defns.c
        @rm -f ${.TARGET}
similarity index 100%
rename from bin/csh/config.h
rename to bin/csh/csh/config.h
similarity index 100%
rename from bin/csh/config_p.h
rename to bin/csh/csh/config_p.h
similarity index 100%
rename from bin/csh/host.defs
rename to bin/csh/csh/host.defs
diff --git a/bin/csh/gethost/Makefile b/bin/csh/gethost/Makefile
new file mode 100644 (file)
index 0000000..8e6428a
--- /dev/null
@@ -0,0 +1,33 @@
+TCSHDIR= ${.CURDIR}/../../../contrib/tcsh-6
+.PATH: ${TCSHDIR} ${.CURDIR}/../csh
+
+PROG=  gethost
+SRCS=  gethost.c sh.err.h tc.const.h
+
+DFLAGS= -D_PATH_TCSHELL='"/bin/${PROG}"'
+CFLAGS+= -I. -I${.CURDIR}/../csh -I${TCSHDIR} ${DFLAGS}
+
+sh.err.h: sh.err.c
+       @rm -f ${.TARGET}
+       @echo '/* Do not edit this file, make creates it. */' > ${.TARGET}
+       @echo '#ifndef _h_sh_err' >> ${.TARGET}
+       @echo '#define _h_sh_err' >> ${.TARGET}
+       grep 'ERR_' ${.ALLSRC} | grep '^#define' >> ${.TARGET}
+       @echo '#endif /* _h_sh_err */' >> ${.TARGET}
+
+tc.const.h: tc.const.c sh.char.h config.h config_f.h sh.types.h sh.err.h
+       @rm -f ${.TARGET}
+       @echo '/* Do not edit this file, make creates it. */' > ${.TARGET}
+       @echo '#ifndef _h_tc_const' >> ${.TARGET}
+       @echo '#define _h_tc_const' >> ${.TARGET}
+       ${CC} -E ${CFLAGS} ${.ALLSRC} -D_h_tc_const | grep 'Char STR' | \
+           sed -e 's/Char \([a-zA-Z0-9_]*\)\(.*\)/extern Char \1[];/' | \
+           sort >> ${.TARGET}
+       @echo '#endif /* _h_tc_const */' >> ${.TARGET}
+
+CLEANFILES+=   sh.err.h tc.const.h
+
+# this gethost is used in place, it is not installed anywhere
+install:
+
+.include <bsd.hostprog.mk>