Rename libcom_err to libafscom_err
[openafs.git] / src / comerr / Makefile.in
1 #
2 # Makefile for error-table routines
3 #
4 # Copyright 1987, 1989 MIT Student Information Processing Board
5 # For copyright info, see mit-sipb-cr.h.
6
7 srcdir=@srcdir@
8 include @TOP_OBJDIR@/src/config/Makefile.config
9 include @TOP_OBJDIR@/src/config/Makefile.lwp
10
11 INSTALL = @INSTALL@
12 INSTALL_DATA = @INSTALL_DATA@
13 INSTALL_PROGRAM = @INSTALL_PROGRAM@
14 INSTALL_SCRIPT = @INSTALL_SCRIPT@
15
16 all: compile_et ${TOP_INCDIR}/afs/com_err.h ${TOP_INCDIR}/afs/error_table.h ${TOP_INCDIR}/afs/mit-sipb-cr.h ${TOP_LIBDIR}/libafscom_err.a
17
18 buildtools: compile_et
19
20 ${TOP_INCDIR}/afs/com_err.h: com_err.h
21         ${INSTALL_DATA} $? $@
22
23 ${TOP_INCDIR}/afs/error_table.h: error_table.h
24         ${INSTALL_DATA} $? $@
25
26 ${TOP_INCDIR}/afs/mit-sipb-cr.h: mit-sipb-cr.h
27         ${INSTALL_DATA} $? $@
28
29 ${TOP_LIBDIR}/libafscom_err.a: libafscom_err.a
30         ${INSTALL_DATA} $? $@
31
32 et_lex.lex.c: et_lex.lex.l
33         $(RM) -f et_lex.lex.c
34         $(LEX) -t $(srcdir)/et_lex.lex.l > et_lex.lex.c
35
36 compile_et:     compile_et.o error_table.o
37         case $(SYS_NAME) in \
38         *_linux* | *_umlinux* ) \
39         $(AFS_LDRULE) compile_et.o error_table.o -L${TOP_LIBDIR} -lafsutil;; \
40         * ) \
41         $(AFS_LDRULE) compile_et.o error_table.o -L${TOP_LIBDIR} -lafsutil -ll;; \
42         esac
43
44 libafscom_err.a: error_msg.o et_name.o com_err.o AFS_component_version_number.o
45         $(RM) -f $@
46         $(AR) crv $@ error_msg.o et_name.o com_err.o AFS_component_version_number.o
47         $(RANLIB) $@
48
49 #
50 # When we build this file, we're using a .c file that's in the object directory,
51 # so we need to add the source directory to the includes to pick up local headers.
52 #
53 CFLAGS_error_table.o= -I${srcdir} @CFLAGS_NOUNUSED@ @CFLAGS_NOOLDSTYLE@
54
55 #
56 # Installation targets
57 #
58 install: compile_et com_err.h error_table.h mit-sipb-cr.h libafscom_err.a
59         ${INSTALL} -d ${DESTDIR}${bindir}
60         ${INSTALL} -d ${DESTDIR}${includedir}/afs
61         ${INSTALL} -d ${DESTDIR}${libdir}/afs
62         ${INSTALL_PROGRAM} compile_et ${DESTDIR}${bindir}/afs_compile_et
63         ${INSTALL_DATA} ${srcdir}/com_err.h ${DESTDIR}${includedir}/afs/com_err.h
64         ${INSTALL_DATA} ${srcdir}/error_table.h ${DESTDIR}${includedir}/afs/error_table.h
65         ${INSTALL_DATA} ${srcdir}/mit-sipb-cr.h ${DESTDIR}${includedir}/afs/mit-sipb-cr.h
66         ${INSTALL_DATA} libafscom_err.a ${DESTDIR}${libdir}/afs/libafscom_err.a
67
68 dest: compile_et com_err.h error_table.h mit-sipb-cr.h libafscom_err.a
69         ${INSTALL} -d ${DEST}/bin
70         ${INSTALL} -d ${DEST}/include/afs
71         ${INSTALL} -d ${DEST}/lib/afs
72         ${INSTALL_PROGRAM} compile_et ${DEST}/bin/afs_compile_et
73         ${INSTALL_DATA} ${srcdir}/com_err.h ${DEST}/include/afs/com_err.h
74         ${INSTALL_DATA} ${srcdir}/error_table.h ${DEST}/include/afs/error_table.h
75         ${INSTALL_DATA} ${srcdir}/mit-sipb-cr.h ${DEST}/include/afs/mit-sipb-cr.h
76         ${INSTALL_DATA} libafscom_err.a ${DEST}/lib/afs/libafscom_err.a
77
78 clean:
79         $(RM) -f *~ \#* *.bak *.otl *.aux *.toc *.PS *.dvi *.x9700 *.ps \
80                 *.cp *.fn *.ky *.log *.pg *.tp *.vr *.o libafscom_err.a \
81                 com_err.o compile_et et.ar TAGS y.tab.c lex.yy.c error_table.c \
82                 et_lex.lex.c test1.h test1.c test2.h test2.c \
83                 eddep makedep core AFS_component_version_number.c
84
85 test:
86         cd test; $(MAKE)
87
88 compile_et.o:  AFS_component_version_number.c
89 # specify yacc build product as a dependency so our .c.o rule will apply
90 error_table.o: et_lex.lex.c error_table.c
91
92 include ../config/Makefile.version