Merge branch 'vendor/GREP'
[dragonfly.git] / usr.bin / tic / Makefile
1 NCURSESDIR=     ${.CURDIR}/../../contrib/ncurses
2 TERMINFO_CAPS=  ${NCURSESDIR}/include/Caps
3 PROGSDIR=       ${NCURSESDIR}/progs
4 .PATH:          ${PROGSDIR}
5
6 PROG=           tic
7
8 CFLAGS+=        -D_XOPEN_SOURCE_EXTENDED
9 CFLAGS+=        -DENABLE_WIDEC
10 CFLAGS+=        -DSET_NCURSES_CH_T=cchar_t
11 CFLAGS+=        -DSET_NEED_WCHAR_H=1
12 CFLAGS+=        -I${PROGSDIR}
13 CFLAGS+=        -I.
14 CFLAGS+=        -I${NCURSESDIR}/include
15 CFLAGS+=        -I${.CURDIR}/../../lib/libncurses/include
16 CFLAGS+=        -I${.CURDIR}
17 CFLAGS+=        -I${.OBJDIR}
18
19 # Ideally this should be -lncursesw
20 # Wide version can be used when DragonFly 3.3 branch is created
21 DPADD=          ${LIBNCURSES}
22 LDADD=          -lncurses
23
24 ncurses_def.h:
25         AWK=awk sh ${NCURSESDIR}/include/MKncurses_def.sh \
26           ${NCURSESDIR}/include/ncurses_defs > ${.TARGET}
27
28 parametrized.h:
29         AWK=awk sh ${NCURSESDIR}/include/MKparametrized.sh \
30           ${TERMINFO_CAPS} > ${.TARGET}
31
32 # Hack: It's really termsort.c, but bootstrap stage chokes on it
33 termsort.h:
34         sh ${PROGSDIR}/MKtermsort.sh awk ${TERMINFO_CAPS} > termsort.c
35
36 tic.o: ${PROGSDIR}/tic.c
37         ${CC} ${CFLAGS} -c ${PROGSDIR}/tic.c -o ${.TARGET}
38
39 transform.o: ${PROGSDIR}/transform.c
40         ${CC} ${CFLAGS} -c ${PROGSDIR}/transform.c -o ${.TARGET}
41
42 dump_entry.o: ${PROGSDIR}/dump_entry.c termsort.h
43         ${CC} ${CFLAGS} -c ${PROGSDIR}/dump_entry.c -o ${.TARGET}
44
45 CLEANFILES=     ncurses_def.h parametrized.h termsort.c
46
47 SRCS=   ncurses_def.h parametrized.h termsort.h
48 SRCS+=  tic.c dump_entry.c transform.c
49
50 .include <bsd.prog.mk>