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