1996-11-01 08:16:24 +00:00
|
|
|
#
|
1998-06-09 04:07:23 +00:00
|
|
|
# $Id: Makefile,v 1.21 1997/09/22 23:14:37 wosch Exp $
|
1996-11-01 08:16:24 +00:00
|
|
|
#
|
|
|
|
# This has most of the glue needed to compile tknvi and the perl hooks,
|
|
|
|
# but not all.
|
|
|
|
#
|
1994-08-16 23:36:45 +00:00
|
|
|
|
1996-11-01 08:16:24 +00:00
|
|
|
SRCDIR= ${.CURDIR}/../../contrib/nvi
|
|
|
|
|
1996-11-09 16:54:33 +00:00
|
|
|
.if defined(RELEASE_BUILD_FIXIT)
|
|
|
|
# When building `vi' for the fixit floppy, don't include any of the
|
|
|
|
# API stuff.
|
|
|
|
APISTUFF= ex_notcl.c ex_noperl.c
|
|
|
|
|
|
|
|
.else
|
|
|
|
|
1997-04-12 14:34:02 +00:00
|
|
|
.if !defined(NOTCL)
|
1997-08-18 05:25:14 +00:00
|
|
|
#TCLINTERP= yes #we have it in the base tree, little cost to vi
|
1997-04-12 14:28:13 +00:00
|
|
|
.endif
|
1996-12-30 09:24:19 +00:00
|
|
|
#TKNVI= yes #not ready, needs X11, tk, doesn't quite work yet
|
1996-11-03 21:32:37 +00:00
|
|
|
#PERLINTERP= yes #needs the perl5 v5.003 port
|
1996-11-01 08:16:24 +00:00
|
|
|
|
1996-11-09 16:54:33 +00:00
|
|
|
APISTUFF= ex_tcl.c ex_perl.c
|
1996-12-30 09:24:19 +00:00
|
|
|
|
|
|
|
# Any better ideas?
|
|
|
|
#PERL= /usr/local/bin/perl5.003
|
|
|
|
#CFLAGS+= -DHAVE_PERL_5_003_01 # If perl >= 5.03.01
|
|
|
|
|
1996-11-09 16:54:33 +00:00
|
|
|
.endif
|
|
|
|
|
1997-04-18 23:44:54 +00:00
|
|
|
CFLAGS+= -DGTAGS
|
|
|
|
|
1996-11-01 08:16:24 +00:00
|
|
|
#if using ncurses:
|
1996-11-01 08:34:51 +00:00
|
|
|
#CFLAGS+= -DSYSV_CURSES
|
1996-11-01 08:16:24 +00:00
|
|
|
|
|
|
|
VI= nvi
|
|
|
|
EX= nex
|
|
|
|
VIEW= nview
|
|
|
|
|
|
|
|
PROG= nvi
|
|
|
|
|
|
|
|
LINKS= ${BINDIR}/${VI} ${BINDIR}/${EX} ${BINDIR}/${VI} ${BINDIR}/${VIEW}
|
|
|
|
LINKS+= ${BINDIR}/${VI} ${BINDIR}/vi ${BINDIR}/${EX} ${BINDIR}/ex
|
|
|
|
LINKS+= ${BINDIR}/${VI} ${BINDIR}/view
|
|
|
|
|
|
|
|
MAN1= ${SRCDIR}/docs/USD.doc/vi.man/vi.1
|
|
|
|
MLINKS+=vi.1 ex.1 vi.1 view.1
|
|
|
|
MLINKS+=vi.1 nex.1 vi.1 nview.1 vi.1 nvi.1
|
|
|
|
|
1997-09-22 23:14:37 +00:00
|
|
|
CATALOGS= dutch english french german polish ru_SU.KOI8-R spanish swedish
|
1996-12-08 14:05:08 +00:00
|
|
|
NLLINKS= nl_NL
|
1996-11-04 02:52:33 +00:00
|
|
|
ENLINKS= en_AU en_CA en_GB en_US
|
|
|
|
FRLINKS= fr_BE fr_CA fr_CH fr_FR
|
|
|
|
DELINKS= de_AT de_CH de_DE
|
|
|
|
ESLINKS= es_ES
|
|
|
|
SVLINKS= sv_SE
|
1997-09-22 23:14:37 +00:00
|
|
|
PLLINKS= pl_PL
|
1996-11-01 08:16:24 +00:00
|
|
|
|
|
|
|
.PATH: ${SRCDIR}/common
|
|
|
|
.PATH: ${SRCDIR}/ex
|
|
|
|
.PATH: ${SRCDIR}/cl
|
|
|
|
.PATH: ${SRCDIR}/vi
|
|
|
|
|
|
|
|
CFLAGS+=-I${.CURDIR} -I${SRCDIR} -I${SRCDIR}/include
|
|
|
|
|
1996-11-03 21:32:37 +00:00
|
|
|
.if !defined(TKNVI)
|
|
|
|
DPADD+= ${LIBCURSES} ${LIBTERMCAP}
|
|
|
|
LDADD+= -lcurses -ltermcap
|
|
|
|
.endif
|
1996-11-01 08:16:24 +00:00
|
|
|
|
|
|
|
.if defined(TKNVI)
|
1996-11-03 21:32:37 +00:00
|
|
|
.PATH: ${SRCDIR}/tk
|
|
|
|
LDADD+= -L/usr/local/lib -L/usr/X11R6/lib -ltk41 -lX11
|
|
|
|
CFLAGS+= -I/usr/local/include -I/usr/X11R6/include
|
1996-11-01 08:16:24 +00:00
|
|
|
.endif
|
|
|
|
|
|
|
|
.if defined(TCLINTERP)
|
1996-11-03 21:32:37 +00:00
|
|
|
.PATH: ${SRCDIR}/tcl_api
|
|
|
|
DPADD+= ${LIBTCL} ${LIBM}
|
|
|
|
LDADD+= -ltcl -lm
|
1997-08-19 01:52:11 +00:00
|
|
|
CFLAGS+= -DHAVE_TCL_INTERP -I${DESTDIR}/usr/include/tcl
|
1996-11-01 08:16:24 +00:00
|
|
|
.endif
|
|
|
|
|
|
|
|
.if defined(PERLINTERP)
|
1996-11-03 21:32:37 +00:00
|
|
|
.PATH: ${SRCDIR}/perl_api
|
1996-12-30 09:24:19 +00:00
|
|
|
|
|
|
|
# Perl "knows" how to compile it's components. Ask it for details...
|
|
|
|
PERLLIB!= ${PERL} -MConfig -e 'print $$Config{privlib}'
|
|
|
|
PERLCPPFLAGS!= cd ${SRCDIR}/build; ${PERL} -MExtUtils::Embed -e 'ccflags;perl_inc'
|
|
|
|
PERLLIBS!= cd ${SRCDIR}/build; ${PERL} -MExtUtils::Embed -e 'ldopts'
|
|
|
|
PERLLDFLAGS!= cd ${SRCDIR}/build; ${PERL} -MExtUtils::Embed -e 'ccdlflags'
|
|
|
|
|
|
|
|
LDADD+= ${PERLLDFLAGS} ${PERLLIBS}
|
|
|
|
CFLAGS+= -DHAVE_PERL_INTERP ${PERLCPPFLAGS}
|
|
|
|
|
1996-11-01 08:16:24 +00:00
|
|
|
.endif
|
|
|
|
|
|
|
|
CLEANFILES+=${EX}
|
|
|
|
|
|
|
|
# Vi curses sources
|
1996-11-03 21:32:37 +00:00
|
|
|
.if !defined(TKNVI)
|
1996-11-01 08:16:24 +00:00
|
|
|
SRCS+= cl_bsd.c cl_funcs.c cl_main.c cl_read.c cl_screen.c cl_term.c
|
1996-11-03 21:32:37 +00:00
|
|
|
.endif
|
1996-11-01 08:16:24 +00:00
|
|
|
|
|
|
|
# Vi Tk sources
|
|
|
|
.if defined(TKNVI)
|
|
|
|
SRCS+= tk_funcs.c tk_main.c tk_read.c tk_screen.c tk_term.c tk_util.c
|
|
|
|
.endif
|
|
|
|
|
|
|
|
# Vi Tcl/Perl interpreter sources
|
|
|
|
.if defined(TCLINTERP) || defined(PERLINTERP)
|
|
|
|
SRCS+= api.c
|
|
|
|
.endif
|
|
|
|
.if defined(TCLINTERP)
|
|
|
|
SRCS+= tcl.c
|
|
|
|
.endif
|
|
|
|
.if defined(PERLINTERP)
|
|
|
|
# perl.c is generated
|
|
|
|
SRCS+= perl.c perlsfio.c
|
|
|
|
.endif
|
|
|
|
|
|
|
|
# General sources.
|
|
|
|
SRCS+= cut.c delete.c exf.c key.c line.c log.c main.c mark.c msg.c options.c \
|
|
|
|
options_f.c put.c screen.c search.c seq.c recover.c util.c
|
|
|
|
|
|
|
|
# Ex source.
|
|
|
|
SRCS+= ex.c ex_abbrev.c ex_append.c ex_args.c ex_argv.c ex_at.c ex_bang.c \
|
|
|
|
ex_cd.c ex_cmd.c ex_cscope.c ex_delete.c ex_display.c \
|
|
|
|
ex_edit.c ex_equal.c ex_file.c ex_filter.c ex_global.c \
|
|
|
|
ex_init.c ex_join.c ex_map.c ex_mark.c ex_mkexrc.c ex_move.c \
|
1996-11-09 16:54:33 +00:00
|
|
|
ex_open.c ex_preserve.c ex_print.c ex_put.c ex_quit.c \
|
1996-11-01 08:16:24 +00:00
|
|
|
ex_read.c ex_screen.c ex_script.c ex_set.c ex_shell.c \
|
1996-11-09 16:54:33 +00:00
|
|
|
ex_shift.c ex_source.c ex_stop.c ex_subst.c ex_tag.c \
|
1996-11-01 08:16:24 +00:00
|
|
|
ex_txt.c ex_undo.c ex_usage.c ex_util.c ex_version.c ex_visual.c \
|
1996-11-09 16:54:33 +00:00
|
|
|
ex_write.c ex_yank.c ex_z.c ${APISTUFF}
|
1996-11-01 08:16:24 +00:00
|
|
|
|
|
|
|
# Vi source.
|
|
|
|
SRCS+= getc.c v_at.c v_ch.c v_cmd.c v_delete.c v_ex.c v_increment.c v_init.c \
|
|
|
|
v_itxt.c v_left.c v_mark.c v_match.c v_paragraph.c v_put.c v_redraw.c \
|
|
|
|
v_replace.c v_right.c v_screen.c v_scroll.c v_search.c v_section.c \
|
|
|
|
v_sentence.c v_status.c v_txt.c v_ulcase.c v_undo.c \
|
|
|
|
v_util.c v_word.c v_xchar.c v_yank.c v_z.c v_zexit.c vi.c
|
|
|
|
|
|
|
|
# Vi screen source.
|
|
|
|
SRCS+= vs_line.c vs_msg.c vs_refresh.c vs_relative.c vs_smap.c vs_split.c
|
|
|
|
|
|
|
|
# Generate perl.c
|
|
|
|
.if defined(PERLINTERP)
|
|
|
|
perl.c: perl.xs typemap
|
1998-06-09 04:07:23 +00:00
|
|
|
echo "#define _PATH_PERLSCRIPTS \"/usr/share/vi/perl\"" > ${.TARGET}
|
1996-11-01 08:16:24 +00:00
|
|
|
$(PERL) $(PERLLIB)/ExtUtils/xsubpp -typemap \
|
1998-06-09 04:07:23 +00:00
|
|
|
$(PERLLIB)/ExtUtils/typemap $(SRCDIR)/perl_api/perl.xs >> ${.TARGET}
|
1996-11-01 08:16:24 +00:00
|
|
|
($(PERL) -ne 'print "sub $$1 {\$$curscr->$$1(\@_)}\n" \
|
|
|
|
if /newXS\("VI::([^":]*)"/;' $@ ; echo "1;") > VI.pm
|
|
|
|
|
|
|
|
CLEANFILES+= VI.pm perl.c
|
|
|
|
.endif
|
|
|
|
|
1996-11-09 16:54:33 +00:00
|
|
|
# unifdef has some *weird* exit codes, sigh! RTFM unifdef(1)...
|
|
|
|
ex_notcl.c: ex_tcl.c
|
|
|
|
-unifdef -UHAVE_TCL_INTERP ${SRCDIR}/ex/ex_tcl.c > ${.TARGET}
|
|
|
|
|
|
|
|
ex_noperl.c: ex_perl.c
|
|
|
|
-unifdef -UHAVE_PERL_INTERP ${SRCDIR}/ex/ex_perl.c > ${.TARGET}
|
|
|
|
|
|
|
|
CLEANFILES+= ex_notcl.c ex_noperl.c
|
|
|
|
|
1996-11-01 08:16:24 +00:00
|
|
|
afterinstall:
|
|
|
|
${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 444 \
|
|
|
|
${CATALOGS:S;^;${SRCDIR}/catalog/;} \
|
|
|
|
${DESTDIR}/usr/share/vi/catalog
|
1996-12-08 14:05:08 +00:00
|
|
|
for l in ${NLLINKS}; do \
|
1996-11-04 02:52:33 +00:00
|
|
|
ln -fs dutch ${DESTDIR}/usr/share/vi/catalog/$$l.ISO_8859-1; \
|
|
|
|
done
|
|
|
|
for l in ${ENLINKS}; do \
|
|
|
|
ln -fs english ${DESTDIR}/usr/share/vi/catalog/$$l.ISO_8859-1; \
|
|
|
|
done
|
|
|
|
ln -fs english ${DESTDIR}/usr/share/vi/catalog/us-ascii
|
|
|
|
for l in ${FRLINKS}; do \
|
|
|
|
ln -fs french ${DESTDIR}/usr/share/vi/catalog/$$l.ISO_8859-1; \
|
|
|
|
done
|
|
|
|
for l in ${DELINKS}; do \
|
|
|
|
ln -fs german ${DESTDIR}/usr/share/vi/catalog/$$l.ISO_8859-1; \
|
|
|
|
done
|
|
|
|
for l in ${ESLINKS}; do \
|
|
|
|
ln -fs spanish ${DESTDIR}/usr/share/vi/catalog/$$l.ISO_8859-1; \
|
|
|
|
done
|
|
|
|
for l in ${SVLINKS}; do \
|
|
|
|
ln -fs swedish ${DESTDIR}/usr/share/vi/catalog/$$l.ISO_8859-1; \
|
|
|
|
done
|
1997-09-22 23:14:37 +00:00
|
|
|
for l in ${PLLINKS}; do \
|
|
|
|
ln -fs polish ${DESTDIR}/usr/share/vi/catalog/$$l.ISO_8859-2; \
|
|
|
|
done
|
1996-11-21 10:13:25 +00:00
|
|
|
ln -fs ru_SU.KOI8-R ${DESTDIR}/usr/share/vi/catalog/ru_RU.KOI8-R
|
1996-11-01 08:16:24 +00:00
|
|
|
${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 444 \
|
|
|
|
${SRCDIR}/tcl_scripts/*.tcl \
|
|
|
|
${DESTDIR}/usr/share/vi/tcl
|
1996-11-03 21:32:37 +00:00
|
|
|
${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 444 \
|
|
|
|
${SRCDIR}/perl_scripts/*.pl \
|
|
|
|
${DESTDIR}/usr/share/vi/perl
|
|
|
|
.if defined(PERLINTERP)
|
1997-01-01 04:22:23 +00:00
|
|
|
${INSTALL} ${COPY} -o ${BINOWN} -g ${BINGRP} -m 444 VI.pm \
|
1996-11-03 21:32:37 +00:00
|
|
|
${DESTDIR}/usr/share/vi/perl
|
1996-11-01 08:16:24 +00:00
|
|
|
.endif
|
|
|
|
|
|
|
|
.include <bsd.prog.mk>
|