Adjust some perl & tcl related things in various scripts & utilities.
[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 $
c03f08f3 3# $DragonFly: src/usr.bin/vi/Makefile,v 1.6 2007/08/27 16:51:01 pavalos Exp $
984263bc 4#
984263bc
MD
5
6SRCDIR= ${.CURDIR}/../../contrib/nvi
75694cfb 7CONTRIBDIR= ${SRCDIR}
c03f08f3 8WARNS?= 0
984263bc
MD
9
10.if defined(RELEASE_CRUNCH)
11# When building `vi' for the fixit floppy, don't include any of the
12# API stuff.
13APISTUFF= ex_notcl.c ex_noperl.c
14
15.else
16
984263bc
MD
17APISTUFF= ex_tcl.c ex_perl.c
18
984263bc
MD
19.endif
20
21CFLAGS+= -DGTAGS
22
23#if using ncurses:
24CFLAGS+= -DSYSV_CURSES
25
26VI= nvi
27EX= nex
28VIEW= nview
29
30PROG= nvi
31
32LINKS= ${BINDIR}/${VI} ${BINDIR}/${EX} ${BINDIR}/${VI} ${BINDIR}/${VIEW}
33LINKS+= ${BINDIR}/${VI} ${BINDIR}/vi ${BINDIR}/${EX} ${BINDIR}/ex
34LINKS+= ${BINDIR}/${VI} ${BINDIR}/view
35
36MAN= ${SRCDIR}/docs/USD.doc/vi.man/vi.1
37MLINKS+=vi.1 ex.1 vi.1 view.1
38MLINKS+=vi.1 nex.1 vi.1 nview.1 vi.1 nvi.1
39
40CATALOGS= dutch english french german polish ru_SU.KOI8-R spanish swedish \
41 uk_UA.KOI8-U
42NLLINKS= nl_NL
43ENLINKS= en_AU en_CA en_GB en_US
44FRLINKS= fr_BE fr_CA fr_CH fr_FR
45DELINKS= de_AT de_CH de_DE
46ESLINKS= es_ES
47SVLINKS= sv_SE
48PLLINKS= pl_PL
49
50.PATH: ${SRCDIR}/common
51.PATH: ${SRCDIR}/ex
52.PATH: ${SRCDIR}/cl
53.PATH: ${SRCDIR}/vi
54
3e8979e7 55CFLAGS+=-I${.CURDIR} -I${SRCDIR} -I${SRCDIR}/include -I${SRCDIR}/vi
984263bc
MD
56
57.if !defined(TKNVI)
58DPADD+= ${LIBNCURSES}
59LDADD+= -lncurses
60
61.else
62
63.PATH: ${SRCDIR}/tk
64LDADD+= -L/usr/local/lib -L/usr/X11R6/lib -ltk41 -lX11
65CFLAGS+= -I/usr/local/include -I/usr/X11R6/include
66.endif
67
984263bc
MD
68CLEANFILES+=${EX}
69
70# Vi curses sources
71.if !defined(TKNVI)
72SRCS+= cl_bsd.c cl_funcs.c cl_main.c cl_read.c cl_screen.c cl_term.c
73.endif
74
75# Vi Tk sources
76.if defined(TKNVI)
77SRCS+= tk_funcs.c tk_main.c tk_read.c tk_screen.c tk_term.c tk_util.c
78.endif
79
984263bc
MD
80# General sources.
81SRCS+= cut.c delete.c exf.c key.c line.c log.c main.c mark.c msg.c options.c \
82 options_f.c put.c screen.c search.c seq.c recover.c util.c
83
84# Ex source.
85SRCS+= ex.c ex_abbrev.c ex_append.c ex_args.c ex_argv.c ex_at.c ex_bang.c \
86 ex_cd.c ex_cmd.c ex_cscope.c ex_delete.c ex_display.c \
87 ex_edit.c ex_equal.c ex_file.c ex_filter.c ex_global.c \
88 ex_init.c ex_join.c ex_map.c ex_mark.c ex_mkexrc.c ex_move.c \
89 ex_open.c ex_preserve.c ex_print.c ex_put.c ex_quit.c \
90 ex_read.c ex_screen.c ex_script.c ex_set.c ex_shell.c \
91 ex_shift.c ex_source.c ex_stop.c ex_subst.c ex_tag.c \
92 ex_txt.c ex_undo.c ex_usage.c ex_util.c ex_version.c ex_visual.c \
93 ex_write.c ex_yank.c ex_z.c ${APISTUFF}
94
95# Vi source.
96SRCS+= getc.c v_at.c v_ch.c v_cmd.c v_delete.c v_ex.c v_increment.c v_init.c \
97 v_itxt.c v_left.c v_mark.c v_match.c v_paragraph.c v_put.c v_redraw.c \
98 v_replace.c v_right.c v_screen.c v_scroll.c v_search.c v_section.c \
99 v_sentence.c v_status.c v_txt.c v_ulcase.c v_undo.c \
100 v_util.c v_word.c v_xchar.c v_yank.c v_z.c v_zexit.c vi.c
101
102# Vi screen source.
103SRCS+= vs_line.c vs_msg.c vs_refresh.c vs_relative.c vs_smap.c vs_split.c
104
984263bc
MD
105# unifdef has some *weird* exit codes, sigh! RTFM unifdef(1)...
106ex_notcl.c: ex_tcl.c
107 -unifdef -UHAVE_TCL_INTERP ${SRCDIR}/ex/ex_tcl.c > ${.TARGET}
108
109ex_noperl.c: ex_perl.c
110 -unifdef -UHAVE_PERL_INTERP ${SRCDIR}/ex/ex_perl.c > ${.TARGET}
111
75694cfb
SZ
112v_ex.c: ${CONTRIBDIR}/vi/v_ex.c ${.CURDIR}/patches/v_ex.c.patch
113 patch -o ${.TARGET} -i ${.ALLSRC:M*.patch} ${CONTRIBDIR}/vi/${.TARGET}
114
115ex_write.c: ${CONTRIBDIR}/ex/ex_write.c ${.CURDIR}/patches/ex_write.c.patch
116 patch -o ${.TARGET} -i ${.ALLSRC:M*.patch} ${CONTRIBDIR}/ex/${.TARGET}
117
984263bc
MD
118CLEANFILES+= ex_notcl.c ex_noperl.c
119
120afterinstall:
121 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
122 ${CATALOGS:S;^;${SRCDIR}/catalog/;} \
123 ${DESTDIR}/usr/share/vi/catalog
124 for l in ${NLLINKS}; do \
062db326
SS
125 ${LN} -fs dutch ${DESTDIR}/usr/share/vi/catalog/$$l.ISO8859-1; \
126 ${LN} -fs dutch ${DESTDIR}/usr/share/vi/catalog/$$l.ISO_8859-1; \
127 ${LN} -fs dutch ${DESTDIR}/usr/share/vi/catalog/$$l.ISO8859-15; \
128 ${LN} -fs dutch ${DESTDIR}/usr/share/vi/catalog/$$l.ISO_8859-15; \
984263bc
MD
129 done
130 for l in ${ENLINKS}; do \
062db326
SS
131 ${LN} -fs english ${DESTDIR}/usr/share/vi/catalog/$$l.ISO8859-1; \
132 ${LN} -fs english ${DESTDIR}/usr/share/vi/catalog/$$l.ISO_8859-1; \
133 ${LN} -fs english ${DESTDIR}/usr/share/vi/catalog/$$l.ISO8859-15; \
134 ${LN} -fs english ${DESTDIR}/usr/share/vi/catalog/$$l.ISO_8859-15; \
135 ${LN} -fs english ${DESTDIR}/usr/share/vi/catalog/$$l.US-ASCII; \
984263bc 136 done
062db326
SS
137 ${LN} -fs english ${DESTDIR}/usr/share/vi/catalog/en_US.US-ASCII
138 ${LN} -fs english ${DESTDIR}/usr/share/vi/catalog/US-ASCII
139 ${LN} -fs english ${DESTDIR}/usr/share/vi/catalog/ASCII
140 ${LN} -fs english ${DESTDIR}/usr/share/vi/catalog/POSIX
141 ${LN} -fs english ${DESTDIR}/usr/share/vi/catalog/C
984263bc 142 for l in ${FRLINKS}; do \
062db326
SS
143 ${LN} -fs french ${DESTDIR}/usr/share/vi/catalog/$$l.ISO8859-1; \
144 ${LN} -fs french ${DESTDIR}/usr/share/vi/catalog/$$l.ISO_8859-1; \
145 ${LN} -fs french ${DESTDIR}/usr/share/vi/catalog/$$l.ISO8859-15; \
146 ${LN} -fs french ${DESTDIR}/usr/share/vi/catalog/$$l.ISO_8859-15; \
984263bc
MD
147 done
148 for l in ${DELINKS}; do \
062db326
SS
149 ${LN} -fs german ${DESTDIR}/usr/share/vi/catalog/$$l.ISO8859-1; \
150 ${LN} -fs german ${DESTDIR}/usr/share/vi/catalog/$$l.ISO_8859-1; \
151 ${LN} -fs german ${DESTDIR}/usr/share/vi/catalog/$$l.ISO8859-15; \
152 ${LN} -fs german ${DESTDIR}/usr/share/vi/catalog/$$l.ISO_8859-15; \
984263bc
MD
153 done
154 for l in ${ESLINKS}; do \
062db326
SS
155 ${LN} -fs spanish ${DESTDIR}/usr/share/vi/catalog/$$l.ISO8859-1; \
156 ${LN} -fs spanish ${DESTDIR}/usr/share/vi/catalog/$$l.ISO_8859-1; \
157 ${LN} -fs spanish ${DESTDIR}/usr/share/vi/catalog/$$l.ISO8859-15; \
158 ${LN} -fs spanish ${DESTDIR}/usr/share/vi/catalog/$$l.ISO_8859-15; \
984263bc
MD
159 done
160 for l in ${SVLINKS}; do \
062db326
SS
161 ${LN} -fs swedish ${DESTDIR}/usr/share/vi/catalog/$$l.ISO8859-1; \
162 ${LN} -fs swedish ${DESTDIR}/usr/share/vi/catalog/$$l.ISO_8859-1; \
163 ${LN} -fs swedish ${DESTDIR}/usr/share/vi/catalog/$$l.ISO8859-15; \
164 ${LN} -fs swedish ${DESTDIR}/usr/share/vi/catalog/$$l.ISO_8859-15; \
984263bc
MD
165 done
166 for l in ${PLLINKS}; do \
062db326
SS
167 ${LN} -fs polish ${DESTDIR}/usr/share/vi/catalog/$$l.ISO8859-2; \
168 ${LN} -fs polish ${DESTDIR}/usr/share/vi/catalog/$$l.ISO_8859-2; \
984263bc 169 done
062db326 170 ${LN} -fs ru_SU.KOI8-R ${DESTDIR}/usr/share/vi/catalog/ru_RU.KOI8-R
984263bc
MD
171
172.include <bsd.prog.mk>