9ca2a91eab27e9652758473e11989b76bbeb1c88
[dragonfly.git] / kerberos5 / lib / libhdb / Makefile
1 # $FreeBSD: src/kerberos5/lib/libhdb/Makefile,v 1.2.2.5 2002/08/19 16:10:22 ru Exp $
2 # $DragonFly: src/kerberos5/lib/libhdb/Makefile,v 1.4 2004/03/26 21:58:12 dillon Exp $
3
4 LIB=    hdb
5 CFLAGS+=-I${KRB5DIR}/include \
6         -I${INCLUDEOBJDIR} \
7         -I${KRB5DIR}/lib/krb5 \
8         -I${KRB5DIR}/lib/hdb \
9         -I${KRB5DIR}/lib/asn1 \
10         -I${KRB5DIR}/lib/roken \
11         -I${.OBJDIR} \
12         -I${ASN1OBJDIR}
13
14 SRCS=   \
15         common.c                                \
16         db.c                                    \
17         db3.c                                   \
18         hdb-ldap.c                              \
19         hdb.c                                   \
20         keytab.c                                \
21         mkey.c                                  \
22         ndbm.c                                  \
23         print.c                                 \
24         hdb_err.c                               \
25         hdb_err.h                               \
26         hdb_asn1.h                              \
27         k524_err.h                              \
28         krb5_err.h                              \
29         heim_err.h                              \
30         ${GEN:S/.x/.c/g}
31
32 GEN=                                            \
33         asn1_Key.x                              \
34         asn1_GENERATION.x                       \
35         asn1_Event.x                            \
36         asn1_HDBFlags.x                         \
37         asn1_hdb_entry.x                        \
38         asn1_Salt.x
39
40 .include <bsd.lib.mk>
41
42 .PATH:  ${KRB5DIR}/lib/hdb
43 .PATH:  ${KRB5DIR}/lib/asn1
44 .PATH:  ${KRB5DIR}/lib/vers
45 .PATH:  ${KRB5DIR}/lib/roken
46
47 build-tools:    make-print-version.nx asn1_compile.nx
48
49 .for I in ${GEN}
50 ${I:S/.x/.c/}:  ${I}
51         cmp -s ${.OODATE} ${.TARGET} 2> /dev/null || cp ${.OODATE} ${.TARGET}
52 .endfor
53
54 CLEANFILES+=    ${GEN:S/.x/.c/g} hdb_asn1.h asn1_files
55
56 ${GEN} hdb_asn1.h:      asn1_compile.nx hdb.asn1
57         ./asn1_compile.nx ${KRB5DIR}/lib/hdb/hdb.asn1 hdb_asn1
58
59 asn1_compile.nx:        parse.no lex.no main.c hash.c symbol.c emalloc.c gen.c \
60                 gen_encode.c gen_decode.c gen_free.c gen_length.c \
61                 gen_copy.c gen_glue.c getarg.c warnerr.c print_version.no \
62                 get_window_size.c strupr.c
63         ${NXCC} ${NXCFLAGS} ${.ALLSRC} -o ${.TARGET}
64
65 .if defined(BOOTSTRAPPING)
66 asn1_compile.nx: getprogname.c setprogname.c
67 .endif
68
69 parse.no:       parse.c
70         ${NXCC} ${NXCFLAGS} -c -o ${.TARGET} parse.c
71
72 .ORDER: parse.c parse.h
73 parse.h parse.c:        parse.y
74         ${YACC} -d ${.OODATE}
75         cp y.tab.c parse.c
76         cp y.tab.h parse.h
77
78 lex.no:         lex.l
79         ${LEX} ${LFLAGS} -o${.TARGET}.c ${.ALLSRC:M*.l}
80         ${NXCC} ${CFLAGS} -c ${.TARGET}.c -o ${.TARGET}
81         rm -f ${.TARGET}.c
82
83 print_version.no: print_version.h print_version.c
84         ${NXCC} ${NXCFLAGS} -c -o ${.TARGET} ${KRB5DIR}/lib/vers/print_version.c
85
86 print_version.h: make-print-version.nx
87         ./make-print-version.nx print_version.h
88
89 make-print-version.nx: make-print-version.c
90         ${NXCC} ${NXCFLAGS} ${NXLDFLAGS} ${.ALLSRC} ${NXLDLIBS} -o ${.TARGET}
91
92 CLEANFILES+=    ${GEN} asn1_compile.nx lex.no parse.no parse.c parse.h \
93                 hdb_asn1.h make-print-version.nx print_version.h \
94                 print_version.no y.tab.c y.tab.h