Add SCTP to LINT.
[dragonfly.git] / usr.bin / vi / Makefile
CommitLineData
984263bc
MD
1#
2# $FreeBSD: src/usr.bin/vi/Makefile,v 1.27.2.7 2002/08/07 16:32:01 ru Exp $
3e8979e7 3# $DragonFly: src/usr.bin/vi/Makefile,v 1.4 2006/02/26 17:18:04 dillon Exp $
984263bc
MD
4#
5# This has most of the glue needed to compile tknvi and the perl hooks,
6# but not all.
7#
8
9SRCDIR= ${.CURDIR}/../../contrib/nvi
3e8979e7
MD
10PATCHES!= echo ${.CURDIR}/patches/*.patch
11CONTRIBDIR= ${SRCDIR}/vi
984263bc
MD
12
13.if defined(RELEASE_CRUNCH)
14# When building `vi' for the fixit floppy, don't include any of the
15# API stuff.
16APISTUFF= ex_notcl.c ex_noperl.c
17
18.else
19
20#TCLINTERP= yes #we don't have it in the base tree
21#TKNVI= yes #not ready, needs X11, tk, doesn't quite work yet
22#PERLINTERP= yes #works if perl has no thread support built in
23
24APISTUFF= ex_tcl.c ex_perl.c
25
26.if defined(PERLINTERP)
27PERL?= /usr/bin/perl5
28CFLAGS+= -DHAVE_PERL_5_003_01 # If perl >= 5.03.01
29.endif
30
31.endif
32
33CFLAGS+= -DGTAGS
34
35#if using ncurses:
36CFLAGS+= -DSYSV_CURSES
37
38VI= nvi
39EX= nex
40VIEW= nview
41
42PROG= nvi
43
44LINKS= ${BINDIR}/${VI} ${BINDIR}/${EX} ${BINDIR}/${VI} ${BINDIR}/${VIEW}
45LINKS+= ${BINDIR}/${VI} ${BINDIR}/vi ${BINDIR}/${EX} ${BINDIR}/ex
46LINKS+= ${BINDIR}/${VI} ${BINDIR}/view
47
48MAN= ${SRCDIR}/docs/USD.doc/vi.man/vi.1
49MLINKS+=vi.1 ex.1 vi.1 view.1
50MLINKS+=vi.1 nex.1 vi.1 nview.1 vi.1 nvi.1
51
52CATALOGS= dutch english french german polish ru_SU.KOI8-R spanish swedish \
53 uk_UA.KOI8-U
54NLLINKS= nl_NL
55ENLINKS= en_AU en_CA en_GB en_US
56FRLINKS= fr_BE fr_CA fr_CH fr_FR
57DELINKS= de_AT de_CH de_DE
58ESLINKS= es_ES
59SVLINKS= sv_SE
60PLLINKS= pl_PL
61
62.PATH: ${SRCDIR}/common
63.PATH: ${SRCDIR}/ex
64.PATH: ${SRCDIR}/cl
65.PATH: ${SRCDIR}/vi
66
3e8979e7 67CFLAGS+=-I${.CURDIR} -I${SRCDIR} -I${SRCDIR}/include -I${SRCDIR}/vi
984263bc
MD
68
69.if !defined(TKNVI)
70DPADD+= ${LIBNCURSES}
71LDADD+= -lncurses
72
73.else
74
75.PATH: ${SRCDIR}/tk
76LDADD+= -L/usr/local/lib -L/usr/X11R6/lib -ltk41 -lX11
77CFLAGS+= -I/usr/local/include -I/usr/X11R6/include
78.endif
79
80.if defined(TCLINTERP)
81.PATH: ${SRCDIR}/tcl_api
82DPADD+= ${LIBTCL} ${LIBM}
83LDADD+= -ltcl -lm
84CFLAGS+= -DHAVE_TCL_INTERP -I${DESTDIR}/usr/include/tcl
85.endif
86
87.if defined(PERLINTERP)
88.PATH: ${SRCDIR}/perl_api
89
90# Perl "knows" how to compile its components. Ask it for details...
91PERLLIB!= ${PERL} -MConfig -e 'print $$Config{privlib}'
92PERLCPPFLAGS!= cd ${SRCDIR}/build; ${PERL} -MExtUtils::Embed -e 'ccflags;perl_inc'
93PERLLIBS!= cd ${SRCDIR}/build; ${PERL} -MExtUtils::Embed -e 'ldopts'
94PERLLDFLAGS!= cd ${SRCDIR}/build; ${PERL} -MExtUtils::Embed -e 'ccdlflags'
95
96LDADD+= ${PERLLDFLAGS} ${PERLLIBS}
97CFLAGS+= -DHAVE_PERL_INTERP ${PERLCPPFLAGS}
98
99.endif
100
101CLEANFILES+=${EX}
102
103# Vi curses sources
104.if !defined(TKNVI)
105SRCS+= cl_bsd.c cl_funcs.c cl_main.c cl_read.c cl_screen.c cl_term.c
106.endif
107
108# Vi Tk sources
109.if defined(TKNVI)
110SRCS+= tk_funcs.c tk_main.c tk_read.c tk_screen.c tk_term.c tk_util.c
111.endif
112
113# Vi Tcl/Perl interpreter sources
114.if defined(TCLINTERP) || defined(PERLINTERP)
115SRCS+= api.c
116.endif
117.if defined(TCLINTERP)
118SRCS+= tcl.c
119.endif
120.if defined(PERLINTERP)
121# perl.c is generated
122SRCS+= perl.c perlsfio.c
123.endif
124
125# General sources.
126SRCS+= cut.c delete.c exf.c key.c line.c log.c main.c mark.c msg.c options.c \
127 options_f.c put.c screen.c search.c seq.c recover.c util.c
128
129# Ex source.
130SRCS+= ex.c ex_abbrev.c ex_append.c ex_args.c ex_argv.c ex_at.c ex_bang.c \
131 ex_cd.c ex_cmd.c ex_cscope.c ex_delete.c ex_display.c \
132 ex_edit.c ex_equal.c ex_file.c ex_filter.c ex_global.c \
133 ex_init.c ex_join.c ex_map.c ex_mark.c ex_mkexrc.c ex_move.c \
134 ex_open.c ex_preserve.c ex_print.c ex_put.c ex_quit.c \
135 ex_read.c ex_screen.c ex_script.c ex_set.c ex_shell.c \
136 ex_shift.c ex_source.c ex_stop.c ex_subst.c ex_tag.c \
137 ex_txt.c ex_undo.c ex_usage.c ex_util.c ex_version.c ex_visual.c \
138 ex_write.c ex_yank.c ex_z.c ${APISTUFF}
139
140# Vi source.
141SRCS+= getc.c v_at.c v_ch.c v_cmd.c v_delete.c v_ex.c v_increment.c v_init.c \
142 v_itxt.c v_left.c v_mark.c v_match.c v_paragraph.c v_put.c v_redraw.c \
143 v_replace.c v_right.c v_screen.c v_scroll.c v_search.c v_section.c \
144 v_sentence.c v_status.c v_txt.c v_ulcase.c v_undo.c \
145 v_util.c v_word.c v_xchar.c v_yank.c v_z.c v_zexit.c vi.c
3e8979e7 146SRCS+= ${PATCHES}
984263bc
MD
147
148# Vi screen source.
149SRCS+= vs_line.c vs_msg.c vs_refresh.c vs_relative.c vs_smap.c vs_split.c
150
151# Generate perl.c
152.if defined(PERLINTERP)
153perl.c: perl.xs typemap
154 echo "#define _PATH_PERLSCRIPTS \"/usr/share/vi/perl\"" > ${.TARGET}
155 $(PERL) $(PERLLIB)/ExtUtils/xsubpp -typemap \
156 $(PERLLIB)/ExtUtils/typemap $(SRCDIR)/perl_api/perl.xs >> ${.TARGET}
157 ($(PERL) -ne 'print "sub $$1 {\$$curscr->$$1(\@_)}\n" \
158 if /newXS\("VI::([^":]*)"/;' $@ ; echo "1;") > VI.pm
159
160CLEANFILES+= VI.pm perl.c
161.endif
162
163# unifdef has some *weird* exit codes, sigh! RTFM unifdef(1)...
164ex_notcl.c: ex_tcl.c
165 -unifdef -UHAVE_TCL_INTERP ${SRCDIR}/ex/ex_tcl.c > ${.TARGET}
166
167ex_noperl.c: ex_perl.c
168 -unifdef -UHAVE_PERL_INTERP ${SRCDIR}/ex/ex_perl.c > ${.TARGET}
169
170CLEANFILES+= ex_notcl.c ex_noperl.c
171
172afterinstall:
173 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
174 ${CATALOGS:S;^;${SRCDIR}/catalog/;} \
175 ${DESTDIR}/usr/share/vi/catalog
176 for l in ${NLLINKS}; do \
062db326
SS
177 ${LN} -fs dutch ${DESTDIR}/usr/share/vi/catalog/$$l.ISO8859-1; \
178 ${LN} -fs dutch ${DESTDIR}/usr/share/vi/catalog/$$l.ISO_8859-1; \
179 ${LN} -fs dutch ${DESTDIR}/usr/share/vi/catalog/$$l.ISO8859-15; \
180 ${LN} -fs dutch ${DESTDIR}/usr/share/vi/catalog/$$l.ISO_8859-15; \
984263bc
MD
181 done
182 for l in ${ENLINKS}; do \
062db326
SS
183 ${LN} -fs english ${DESTDIR}/usr/share/vi/catalog/$$l.ISO8859-1; \
184 ${LN} -fs english ${DESTDIR}/usr/share/vi/catalog/$$l.ISO_8859-1; \
185 ${LN} -fs english ${DESTDIR}/usr/share/vi/catalog/$$l.ISO8859-15; \
186 ${LN} -fs english ${DESTDIR}/usr/share/vi/catalog/$$l.ISO_8859-15; \
187 ${LN} -fs english ${DESTDIR}/usr/share/vi/catalog/$$l.US-ASCII; \
984263bc 188 done
062db326
SS
189 ${LN} -fs english ${DESTDIR}/usr/share/vi/catalog/en_US.US-ASCII
190 ${LN} -fs english ${DESTDIR}/usr/share/vi/catalog/US-ASCII
191 ${LN} -fs english ${DESTDIR}/usr/share/vi/catalog/ASCII
192 ${LN} -fs english ${DESTDIR}/usr/share/vi/catalog/POSIX
193 ${LN} -fs english ${DESTDIR}/usr/share/vi/catalog/C
984263bc 194 for l in ${FRLINKS}; do \
062db326
SS
195 ${LN} -fs french ${DESTDIR}/usr/share/vi/catalog/$$l.ISO8859-1; \
196 ${LN} -fs french ${DESTDIR}/usr/share/vi/catalog/$$l.ISO_8859-1; \
197 ${LN} -fs french ${DESTDIR}/usr/share/vi/catalog/$$l.ISO8859-15; \
198 ${LN} -fs french ${DESTDIR}/usr/share/vi/catalog/$$l.ISO_8859-15; \
984263bc
MD
199 done
200 for l in ${DELINKS}; do \
062db326
SS
201 ${LN} -fs german ${DESTDIR}/usr/share/vi/catalog/$$l.ISO8859-1; \
202 ${LN} -fs german ${DESTDIR}/usr/share/vi/catalog/$$l.ISO_8859-1; \
203 ${LN} -fs german ${DESTDIR}/usr/share/vi/catalog/$$l.ISO8859-15; \
204 ${LN} -fs german ${DESTDIR}/usr/share/vi/catalog/$$l.ISO_8859-15; \
984263bc
MD
205 done
206 for l in ${ESLINKS}; do \
062db326
SS
207 ${LN} -fs spanish ${DESTDIR}/usr/share/vi/catalog/$$l.ISO8859-1; \
208 ${LN} -fs spanish ${DESTDIR}/usr/share/vi/catalog/$$l.ISO_8859-1; \
209 ${LN} -fs spanish ${DESTDIR}/usr/share/vi/catalog/$$l.ISO8859-15; \
210 ${LN} -fs spanish ${DESTDIR}/usr/share/vi/catalog/$$l.ISO_8859-15; \
984263bc
MD
211 done
212 for l in ${SVLINKS}; do \
062db326
SS
213 ${LN} -fs swedish ${DESTDIR}/usr/share/vi/catalog/$$l.ISO8859-1; \
214 ${LN} -fs swedish ${DESTDIR}/usr/share/vi/catalog/$$l.ISO_8859-1; \
215 ${LN} -fs swedish ${DESTDIR}/usr/share/vi/catalog/$$l.ISO8859-15; \
216 ${LN} -fs swedish ${DESTDIR}/usr/share/vi/catalog/$$l.ISO_8859-15; \
984263bc
MD
217 done
218 for l in ${PLLINKS}; do \
062db326
SS
219 ${LN} -fs polish ${DESTDIR}/usr/share/vi/catalog/$$l.ISO8859-2; \
220 ${LN} -fs polish ${DESTDIR}/usr/share/vi/catalog/$$l.ISO_8859-2; \
984263bc 221 done
062db326 222 ${LN} -fs ru_SU.KOI8-R ${DESTDIR}/usr/share/vi/catalog/ru_RU.KOI8-R
984263bc
MD
223 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
224 ${SRCDIR}/tcl_scripts/*.tcl \
225 ${DESTDIR}/usr/share/vi/tcl
226 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
227 ${SRCDIR}/perl_scripts/*.pl \
228 ${DESTDIR}/usr/share/vi/perl
229.if defined(PERLINTERP)
230 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 VI.pm \
231 ${DESTDIR}/usr/share/vi/perl
232.endif
233
234.include <bsd.prog.mk>