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