1
0
mirror of https://github.com/openbsd/src.git synced 2025-01-03 06:45:37 -08:00

The files editline.c, historyn.c, and tokenizern.c are completely

constant and very short and simple.  Check them into CVS rather
than generating them at build time in a complicated way.
OK martijn@, also proofread by Christian Heckendorf <mbie at ulmus dot me>
This commit is contained in:
schwarze 2016-05-03 11:19:30 +00:00
parent 0a1a8905a6
commit 933c3038f3
5 changed files with 38 additions and 43 deletions

View File

@ -1,4 +1,4 @@
# $OpenBSD: Makefile,v 1.21 2016/04/20 01:11:45 schwarze Exp $
# $OpenBSD: Makefile,v 1.22 2016/05/03 11:19:30 schwarze Exp $
# $NetBSD: Makefile,v 1.41 2010/02/03 15:34:43 roy Exp $
# @(#)Makefile 8.1 (Berkeley) 6/4/93
@ -11,21 +11,19 @@ OSRCS= chared.c common.c el.c eln.c emacs.c fcns.c filecomplete.c help.c \
MAN= editline.3 editrc.5 editline.7
# For speed and debugging
#SRCS= ${OSRCS} tokenizer.c history.c readline.c
#SRCS= ${OSRCS}
# For protection
SRCS= editline.c tokenizer.c history.c readline.c
SRCS= editline.c
SRCS+= tokenizern.c historyn.c
CLEANFILES+=tokenizern.c.tmp tokenizern.c historyn.c.tmp historyn.c
SRCS += history.c historyn.c tokenizer.c tokenizern.c readline.c
LIBEDITDIR?=${.CURDIR}
INCS= histedit.h
INCSDIR=/usr/include
CLEANFILES+=editline.c
CLEANFILES+=common.h.tmp editline.c.tmp emacs.h.tmp fcns.c.tmp fcns.h.tmp
CLEANFILES+=help.c.tmp help.h.tmp vi.h.tmp tc1.o tc1
CLEANFILES+=common.h.tmp emacs.h.tmp fcns.c.tmp fcns.h.tmp
CLEANFILES+=help.c.tmp help.h.tmp vi.h.tmp tc1.o tc1 .depend
CFLAGS+=-Wall
CPPFLAGS+=-I. -I${LIBEDITDIR}
CPPFLAGS+=-I. -I${.CURDIR}
@ -40,6 +38,8 @@ CLEANFILES+= ${AHDR} fcns.h help.h fcns.c help.c
#SUBDIR+= readline
HOST_SH= sh
.depend: ${AHDR} fcns.h help.h fcns.c help.c
vi.h: vi.c makelist
${HOST_SH} ${LIBEDITDIR}/makelist -h ${LIBEDITDIR}/vi.c \
> ${.TARGET}.tmp && \
@ -71,18 +71,6 @@ help.h: ${ASRC} makelist
${HOST_SH} ${LIBEDITDIR}/makelist -bh ${ASRC} > ${.TARGET}.tmp && \
mv ${.TARGET}.tmp ${.TARGET}
editline.c: ${OSRCS} makelist
${HOST_SH} ${LIBEDITDIR}/makelist -e ${OSRCS:T} > ${.TARGET}.tmp && \
mv ${.TARGET}.tmp ${.TARGET}
tokenizern.c: makelist
${HOST_SH} ${LIBEDITDIR}/makelist -n tokenizer.c > ${.TARGET}.tmp && \
mv ${.TARGET}.tmp ${.TARGET}
historyn.c: makelist
${HOST_SH} ${LIBEDITDIR}/makelist -n history.c > ${.TARGET}.tmp && \
mv ${.TARGET}.tmp ${.TARGET}
tc1.o: ${LIBEDITDIR}/TEST/tc1.c
tc1: libedit.a tc1.o

23
lib/libedit/editline.c Normal file
View File

@ -0,0 +1,23 @@
#define protected static
#define SCCSID
#include "chared.c"
#include "common.c"
#include "el.c"
#include "eln.c"
#include "emacs.c"
#include "fcns.c"
#include "filecomplete.c"
#include "help.c"
#include "hist.c"
#include "keymacro.c"
#include "map.c"
#include "chartype.c"
#include "parse.c"
#include "prompt.c"
#include "read.c"
#include "refresh.c"
#include "search.c"
#include "sig.c"
#include "terminal.c"
#include "tty.c"
#include "vi.c"

3
lib/libedit/historyn.c Normal file
View File

@ -0,0 +1,3 @@
#include "config.h"
#define NARROWCHAR
#include "history.c"

View File

@ -36,7 +36,7 @@
# makelist.sh: Automatically generate header files...
AWK=awk
USAGE="Usage: $0 -n|-h|-e|-fc|-fh|-bc|-bh <filenames>"
USAGE="Usage: $0 -h|-fc|-fh|-bc|-bh <filenames>"
if [ "x$1" = "x" ]
then
@ -51,15 +51,6 @@ FILES="$@"
case $FLAG in
# generate foo.h file from foo.c
#
-n)
cat << _EOF
#define NARROWCHAR
#include "${FILES}"
_EOF
;;
-h)
set - `echo $FILES | sed -e 's/\\./_/g'`
hdr="_h_`basename $1`"
@ -201,19 +192,6 @@ _EOF
}'
;;
# generate editline.c from various .c files
#
-e)
echo "$FILES" | tr ' ' '\012' | $AWK '
BEGIN {
printf("/* Automatically generated file, do not edit */\n");
printf("#define protected static\n");
}
{
printf("#include \"%s\"\n", $1);
}'
;;
*)
echo $USAGE 1>&2
exit 1

3
lib/libedit/tokenizern.c Normal file
View File

@ -0,0 +1,3 @@
#include "config.h"
#define NARROWCHAR
#include "tokenizer.c"