xref: /freebsd/contrib/libedit/Makefile (revision 911f0260390e18cf85f3dbf2c719b593efdc1e3c)
1#	$NetBSD: Makefile,v 1.66 2019/10/13 07:28:10 mrg Exp $
2#	@(#)Makefile	8.1 (Berkeley) 6/4/93
3
4USE_SHLIBDIR=	yes
5
6WARNS?=	5
7LIB=	edit
8
9LIBDPLIBS+=     terminfo ${.CURDIR}/../libterminfo
10
11.include "bsd.own.mk"
12
13COPTS+=	-Wunused-parameter
14CWARNFLAGS.gcc+=	-Wconversion
15CWARNFLAGS.clang+=	-Wno-cast-qual
16
17SRCS =	chared.c chartype.c common.c el.c eln.c emacs.c filecomplete.c \
18	hist.c history.c historyn.c keymacro.c literal.c map.c \
19	parse.c prompt.c read.c readline.c refresh.c search.c sig.c \
20	terminal.c tokenizer.c tokenizern.c tty.c vi.c
21
22MAN=	editline.3 editrc.5 editline.7
23
24MLINKS= \
25editline.3 el_deletestr.3 \
26editline.3 el_end.3 \
27editline.3 el_get.3 \
28editline.3 el_getc.3 \
29editline.3 el_gets.3 \
30editline.3 el_init.3 \
31editline.3 el_init_fd.3 \
32editline.3 el_insertstr.3 \
33editline.3 el_line.3 \
34editline.3 el_parse.3 \
35editline.3 el_push.3 \
36editline.3 el_reset.3 \
37editline.3 el_resize.3 \
38editline.3 el_set.3 \
39editline.3 el_source.3 \
40editline.3 history.3 \
41editline.3 history_end.3 \
42editline.3 history_init.3 \
43editline.3 tok_end.3 \
44editline.3 tok_init.3 \
45editline.3 tok_line.3 \
46editline.3 tok_reset.3 \
47editline.3 tok_str.3
48
49MLINKS+= \
50editline.3 el_wdeletestr.3 \
51editline.3 el_wget.3 \
52editline.3 el_wgetc.3 \
53editline.3 el_wgets.3 \
54editline.3 el_winsertstr.3 \
55editline.3 el_wline.3 \
56editline.3 el_wparse.3 \
57editline.3 el_wpush.3 \
58editline.3 el_wset.3 \
59editline.3 history_w.3 \
60editline.3 history_wend.3 \
61editline.3 history_winit.3 \
62editline.3 tok_wend.3 \
63editline.3 tok_winit.3 \
64editline.3 tok_wline.3 \
65editline.3 tok_wreset.3 \
66editline.3 tok_wstr.3
67
68LIBEDITDIR?=${.CURDIR}
69
70INCS= histedit.h
71INCSDIR=/usr/include
72
73CLEANFILES+=common.h.tmp emacs.h.tmp fcns.h.tmp func.h.tmp
74CLEANFILES+=help.h.tmp vi.h.tmp tc1.o tc1 .depend
75
76CPPFLAGS+=-I. -I${LIBEDITDIR}
77CPPFLAGS+=-I. -I${.CURDIR}
78#CPPFLAGS+=-DDEBUG_TTY -DDEBUG_KEY -DDEBUG -DDEBUG_REFRESH
79#CPPFLAGS+=-DDEBUG_PASTE -DDEBUG_EDIT
80
81AHDR=vi.h emacs.h common.h
82ASRC=${LIBEDITDIR}/vi.c ${LIBEDITDIR}/emacs.c ${LIBEDITDIR}/common.c
83
84DPSRCS+=	${AHDR} fcns.h func.h help.h
85CLEANFILES+=	${AHDR} fcns.h func.h help.h
86
87SUBDIR=	readline
88
89.depend: ${AHDR} fcns.h func.h help.h
90
91vi.h: vi.c makelist Makefile
92	${_MKTARGET_CREATE}
93	${HOST_SH} ${LIBEDITDIR}/makelist -h ${LIBEDITDIR}/vi.c \
94	    > ${.TARGET}.tmp && \
95	    mv ${.TARGET}.tmp ${.TARGET}
96
97emacs.h: emacs.c makelist Makefile
98	${_MKTARGET_CREATE}
99	${HOST_SH} ${LIBEDITDIR}/makelist -h ${LIBEDITDIR}/emacs.c \
100	    > ${.TARGET}.tmp && \
101	    mv ${.TARGET}.tmp ${.TARGET}
102
103common.h: common.c makelist Makefile
104	${_MKTARGET_CREATE}
105	${HOST_SH} ${LIBEDITDIR}/makelist -h ${LIBEDITDIR}/common.c \
106	    > ${.TARGET}.tmp && \
107	    mv ${.TARGET}.tmp ${.TARGET}
108
109fcns.h: ${AHDR} makelist Makefile
110	${_MKTARGET_CREATE}
111	${HOST_SH} ${LIBEDITDIR}/makelist -fh ${AHDR} > ${.TARGET}.tmp && \
112	    mv ${.TARGET}.tmp ${.TARGET}
113
114func.h: ${AHDR} makelist Makefile
115	${_MKTARGET_CREATE}
116	${HOST_SH} ${LIBEDITDIR}/makelist -fc ${AHDR} > ${.TARGET}.tmp && \
117	    mv ${.TARGET}.tmp ${.TARGET}
118
119help.h: ${ASRC} makelist Makefile
120	${_MKTARGET_CREATE}
121	${HOST_SH} ${LIBEDITDIR}/makelist -bh ${ASRC} > ${.TARGET}.tmp && \
122	    mv ${.TARGET}.tmp ${.TARGET}
123
124tc1.o:	${LIBEDITDIR}/TEST/tc1.c
125
126tc1:	libedit.a tc1.o
127	${_MKTARGET_LINK}
128	${CC} ${LDFLAGS} ${.ALLSRC} -o ${.TARGET} libedit.a ${LDADD} -ltermlib
129
130.include <bsd.lib.mk>
131.include <bsd.subdir.mk>
132
133# XXX
134.if defined(HAVE_GCC)
135COPTS.editline.c+=	-Wno-cast-qual
136COPTS.literal.c+=	-Wno-sign-conversion
137COPTS.tokenizer.c+=	-Wno-cast-qual
138COPTS.tokenizern.c+=	-Wno-cast-qual
139.endif
140
141COPTS.history.c+=	${GCC_NO_STRINGOP_OVERFLOW}
142COPTS.historyn.c+=	${GCC_NO_STRINGOP_OVERFLOW}
143COPTS.readline.c+=	${GCC_NO_STRINGOP_TRUNCATION} ${GCC_NO_STRINGOP_OVERFLOW}
144