-# $OpenBSD: Makefile,v 1.24 2016/03/30 06:38:46 jmc Exp $
+# $OpenBSD: Makefile,v 1.25 2017/12/14 10:02:53 martijn Exp $
# @(#)Makefile.in 8.75 (Berkeley) 10/23/96
PROG= vi
# Modern curses (ncurses)
-CFLAGS+=-I${.CURDIR} -I${.CURDIR}/../include
+CFLAGS+=-I${.CURDIR} -I${.CURDIR}/../include -I.
LDADD+=-lcurses
DPADD+= ${LIBCURSES}
LINKS= ${BINDIR}/vi ${BINDIR}/ex
LINKS+= ${BINDIR}/vi ${BINDIR}/view
+options_def.h: common/options.awk common/options.c
+ awk -f ${.CURDIR}/../common/options.awk ${.CURDIR}/../common/options.c \
+ > $@.tmp && mv $@.tmp $@ || rm $@.tmp
+
+ex_def.h: ex/ex.awk ex/ex_cmd.c
+ awk -f ${.CURDIR}/../ex/ex.awk ${.CURDIR}/../ex/ex_cmd.c > $@.tmp \
+ && mv $@.tmp $@ || rm $@.tmp
+
+BUILDFIRST = options_def.h ex_def.h
+CLEANFILES += options_def.h ex_def.h
+
.PATH: ${.CURDIR}/../vi ${.CURDIR}/../ex ${.CURDIR}/../cl ${.CURDIR}/../common ${.CURDIR}/../docs/USD.doc/vi.man
.include "../../Makefile.inc"
-# $OpenBSD: options.awk,v 1.3 2001/01/29 01:58:31 niklas Exp $
+# $OpenBSD: options.awk,v 1.4 2017/12/14 10:02:53 martijn Exp $
# @(#)options.awk 10.1 (Berkeley) 6/8/95
-
+
+BEGIN {
+ printf("enum {\n");
+ first = 1;
+}
/^\/\* O_[0-9A-Z_]*/ {
- printf("#define %s %d\n", $2, cnt++);
+ printf("\t%s%s,\n", $2, first ? " = 0" : "");
+ first = 0;
next;
}
END {
- printf("#define O_OPTIONCOUNT %d\n", cnt);
+ printf("\tO_OPTIONCOUNT\n};\n");
}
-# $OpenBSD: ex.awk,v 1.2 2001/01/29 01:58:40 niklas Exp $
+# $OpenBSD: ex.awk,v 1.3 2017/12/14 10:02:53 martijn Exp $
# @(#)ex.awk 10.1 (Berkeley) 6/8/95
-
+
+BEGIN {
+ printf("enum {");
+ first = 1;
+}
/^\/\* C_[0-9A-Z_]* \*\/$/ {
- printf("#define %s %d\n", $2, cnt++);
+ printf("%s\n\t%s%s", first ? "" : ",", $2, first ? " = 0" : "");
+ first = 0;
next;
}
+END {
+ printf("\n};\n");
+}
+++ /dev/null
-/* $OpenBSD: ex_def.h,v 1.5 2015/11/19 07:53:31 bentley Exp $ */
-
-#define C_SCROLL 0
-#define C_BANG 1
-#define C_HASH 2
-#define C_SUBAGAIN 3
-#define C_STAR 4
-#define C_SHIFTL 5
-#define C_EQUAL 6
-#define C_SHIFTR 7
-#define C_AT 8
-#define C_APPEND 9
-#define C_ABBR 10
-#define C_ARGS 11
-#define C_BG 12
-#define C_CHANGE 13
-#define C_CD 14
-#define C_CHDIR 15
-#define C_COPY 16
-#define C_DELETE 17
-#define C_DISPLAY 18
-#define C_EDIT 19
-#define C_EX 20
-#define C_EXUSAGE 21
-#define C_FILE 22
-#define C_FG 23
-#define C_GLOBAL 24
-#define C_HELP 25
-#define C_INSERT 26
-#define C_JOIN 27
-#define C_K 28
-#define C_LIST 29
-#define C_MOVE 30
-#define C_MARK 31
-#define C_MAP 32
-#define C_MKEXRC 33
-#define C_NEXT 34
-#define C_NUMBER 35
-#define C_OPEN 36
-#define C_PRINT 37
-#define C_PRESERVE 38
-#define C_PREVIOUS 39
-#define C_PUT 40
-#define C_QUIT 41
-#define C_READ 42
-#define C_RECOVER 43
-#define C_RESIZE 44
-#define C_REWIND 45
-#define C_SUBSTITUTE 46
-#define C_SCRIPT 47
-#define C_SET 48
-#define C_SHELL 49
-#define C_SOURCE 50
-#define C_STOP 51
-#define C_SUSPEND 52
-#define C_T 53
-#define C_TAG 54
-#define C_TAGNEXT 55
-#define C_TAGPOP 56
-#define C_TAGPREV 57
-#define C_TAGTOP 58
-#define C_UNDO 59
-#define C_UNABBREVIATE 60
-#define C_UNMAP 61
-#define C_V 62
-#define C_VERSION 63
-#define C_VISUAL_EX 64
-#define C_VISUAL_VI 65
-#define C_VIUSAGE 66
-#define C_WRITE 67
-#define C_WN 68
-#define C_WQ 69
-#define C_XIT 70
-#define C_YANK 71
-#define C_Z 72
-#define C_SUBTILDE 73
+++ /dev/null
-/* $OpenBSD: options_def.h,v 1.8 2017/07/03 07:01:14 bentley Exp $ */
-
-enum {
- O_ALTWERASE = 0,
- O_AUTOINDENT,
- O_AUTOPRINT,
- O_AUTOWRITE,
- O_BACKUP,
- O_BEAUTIFY,
- O_CDPATH,
- O_CEDIT,
- O_COLUMNS,
- O_COMMENT,
- O_EDCOMPATIBLE,
- O_ESCAPETIME,
- O_ERRORBELLS,
- O_EXRC,
- O_EXTENDED,
- O_FILEC,
- O_FLASH,
- O_HARDTABS,
- O_ICLOWER,
- O_IGNORECASE,
- O_KEYTIME,
- O_LEFTRIGHT,
- O_LINES,
- O_LIST,
- O_LOCKFILES,
- O_MAGIC,
- O_MATCHTIME,
- O_MESG,
- O_NOPRINT,
- O_NUMBER,
- O_OCTAL,
- O_OPEN,
- O_PARAGRAPHS,
- O_PATH,
- O_PRINT,
- O_PROMPT,
- O_READONLY,
- O_RECDIR,
- O_REMAP,
- O_REPORT,
- O_RULER,
- O_SCROLL,
- O_SEARCHINCR,
- O_SECTIONS,
- O_SECURE,
- O_SHELL,
- O_SHELLMETA,
- O_SHIFTWIDTH,
- O_SHOWMATCH,
- O_SHOWMODE,
- O_SIDESCROLL,
- O_TABSTOP,
- O_TAGLENGTH,
- O_TAGS,
- O_TERM,
- O_TERSE,
- O_TILDEOP,
- O_TIMEOUT,
- O_TTYWERASE,
- O_VERBOSE,
- O_W1200,
- O_W300,
- O_W9600,
- O_WARN,
- O_WINDOW,
- O_WINDOWNAME,
- O_WRAPLEN,
- O_WRAPMARGIN,
- O_WRAPSCAN,
- O_WRITEANY,
- O_OPTIONCOUNT,
-};