xref: /dragonfly/usr.bin/tic/Makefile (revision 4d4ae2fa)
1NCURSESDIR=	${.CURDIR}/../../contrib/ncurses
2TERMINFO_CAPS=  ${NCURSESDIR}/include/Caps
3PROGSDIR=	${NCURSESDIR}/progs
4.PATH:		${PROGSDIR}
5
6PROG=		tic
7
8CFLAGS+=	-D_XOPEN_SOURCE_EXTENDED
9CFLAGS+=	-DENABLE_WIDEC
10CFLAGS+=	-DSET_NCURSES_CH_T=cchar_t
11CFLAGS+=	-DSET_NEED_WCHAR_H=1
12CFLAGS+=	-I${PROGSDIR}
13CFLAGS+=	-I.
14CFLAGS+=	-I${NCURSESDIR}/include
15CFLAGS+=	-I${.CURDIR}/../../lib/libncurses/include
16CFLAGS+=	-I${.CURDIR}
17CFLAGS+=	-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)
22CFLAGS+=	-DBOOTSTRAPPING
23.  if exists (/usr/lib/libncurses.a)
24DPADD=		/usr/lib/libncurses.a
25LDADD=		-lncurses
26.  else
27DPADD=		${LIBNCURSES}
28LDADD=		-lprivate_ncurses
29LDFLAGS+=	${PRIVATELIB_BLDFLAGS}
30.  endif
31.else
32DPADD=		${LIBNCURSES}
33LDADD=		-lprivate_ncurses
34LDFLAGS+=	${PRIVATELIB_LDFLAGS}
35.endif
36
37ncurses_def.h:
38	AWK=awk sh ${NCURSESDIR}/include/MKncurses_def.sh \
39	  ${NCURSESDIR}/include/ncurses_defs > ${.TARGET}
40
41parametrized.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.if defined(BOOTSTRAPPING)
47_termsortc=	termsort.h
48.else
49_termsortc=	termsort.c
50beforedepend:	termsort.c
51.endif
52${_termsortc}:
53	sh ${PROGSDIR}/MKtermsort.sh awk ${TERMINFO_CAPS} > termsort.c
54
55tic.o: ${PROGSDIR}/tic.c
56	${CC} ${CFLAGS} -c ${PROGSDIR}/tic.c -o ${.TARGET}
57
58transform.o: ${PROGSDIR}/transform.c
59	${CC} ${CFLAGS} -c ${PROGSDIR}/transform.c -o ${.TARGET}
60
61dump_entry.o: ${PROGSDIR}/dump_entry.c ${_termsortc}
62	${CC} ${CFLAGS} -c ${PROGSDIR}/dump_entry.c -o ${.TARGET}
63
64CLEANFILES=	ncurses_def.h parametrized.h termsort.c
65
66SRCS=	ncurses_def.h parametrized.h
67.if defined(BOOTSTRAPPING)
68SRCS+=	termsort.h
69.endif
70SRCS+=	tic.c dump_entry.c tparm_type.c transform.c
71
72.include <bsd.prog.mk>
73