Hack-fix buildworld after the ncurses upgrade.
[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 -lprivate_ncursesw
20 # Wide version can be used when DragonFly 3.3 branch is created
21 .if defined(BOOTSTRAPPING)
22 CFLAGS+=        -DBOOTSTRAPPING
23 .  if exists (/usr/lib/libncurses.a)
24 DPADD=          /usr/lib/libncurses.a
25 LDADD=          -lncurses
26 .  else
27 DPADD=          ${LIBNCURSES}
28 LDADD=          -lprivate_ncurses
29 LDFLAGS+=       -rpath /lib/priv -L /usr/lib/priv
30 .  endif
31 .else
32 DPADD=          ${LIBNCURSES}
33 LDADD=          -lprivate_ncurses
34 LDFLAGS+=       -rpath /lib/priv -L ${_SHLIBDIRPREFIX}/usr/lib/priv
35 .endif
36
37 ncurses_def.h:
38         AWK=awk sh ${NCURSESDIR}/include/MKncurses_def.sh \
39           ${NCURSESDIR}/include/ncurses_defs > ${.TARGET}
40
41 parametrized.h:
42         AWK=awk sh ${NCURSESDIR}/include/MKparametrized.sh \
43           ${TERMINFO_CAPS} > ${.TARGET}
44
45 # Hack: It's really termsort.c, but bootstrap stage chokes on it
46 termsort.h:
47         sh ${PROGSDIR}/MKtermsort.sh awk ${TERMINFO_CAPS} > termsort.c
48
49 tic.o: ${PROGSDIR}/tic.c
50         ${CC} ${CFLAGS} -c ${PROGSDIR}/tic.c -o ${.TARGET}
51
52 transform.o: ${PROGSDIR}/transform.c
53         ${CC} ${CFLAGS} -c ${PROGSDIR}/transform.c -o ${.TARGET}
54
55 dump_entry.o: ${PROGSDIR}/dump_entry.c termsort.h
56         ${CC} ${CFLAGS} -c ${PROGSDIR}/dump_entry.c -o ${.TARGET}
57
58 CLEANFILES=     ncurses_def.h parametrized.h termsort.c
59
60 SRCS=   ncurses_def.h parametrized.h termsort.h
61 SRCS+=  tic.c dump_entry.c tparm_type.c transform.c
62
63 .include <bsd.prog.mk>