9abd6890a608287daee96c156122528e305f7725
[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 DPADD=          ${LIBNCURSESW}
20 LDADD=          -lprivate_ncursesw
21 CFLAGS+=        -I${_SHLIBDIRPREFIX}/usr/include/priv/ncurses
22 LDFLAGS+=       ${PRIVATELIB_LDFLAGS}
23
24 term.h:
25         awk -f ${.CURDIR}/../../lib/libncurses/include/MKterm.h.awk ${TERMINFO_CAPS} \
26           > ${.TARGET}.new
27         sh ${NCURSESDIR}/include/edit_cfg.sh ${.CURDIR}/../../lib/libncurses/include/ncurses_cfg.h \
28           ${.TARGET}.new
29         mv -f ${.TARGET}.new ${.TARGET}
30
31 ncurses_def.h:
32         AWK=awk sh ${NCURSESDIR}/include/MKncurses_def.sh \
33           ${NCURSESDIR}/include/ncurses_defs > ${.TARGET}
34
35 parametrized.h:
36         AWK=awk sh ${NCURSESDIR}/include/MKparametrized.sh \
37           ${TERMINFO_CAPS} > ${.TARGET}
38
39 beforedepend:   termsort.c
40
41 termsort.c:
42         sh ${PROGSDIR}/MKtermsort.sh awk ${TERMINFO_CAPS} > termsort.c
43
44 tic.o: ${PROGSDIR}/tic.c
45         ${CC} ${CFLAGS} -c ${PROGSDIR}/tic.c -o ${.TARGET}
46
47 transform.o: ${PROGSDIR}/transform.c
48         ${CC} ${CFLAGS} -c ${PROGSDIR}/transform.c -o ${.TARGET}
49
50 dump_entry.o: ${PROGSDIR}/dump_entry.c termsort.c
51         ${CC} ${CFLAGS} -c ${PROGSDIR}/dump_entry.c -o ${.TARGET}
52
53 CLEANFILES=     ncurses_def.h parametrized.h term.h termsort.c
54
55 SRCS=   ncurses_def.h parametrized.h term.h
56 SRCS+=  tic.c dump_entry.c tparm_type.c transform.c
57
58 .include <bsd.prog.mk>