c177fd6cea6695a2e1e314b5321da9dcd99db7f9
[openafs.git] / src / comerr / Makefile
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 #       $Locker$
8 #
9
10 SHELL = /bin/sh
11 COMPONENT=comerr
12 include ../config/Makefile.${SYS_NAME}
13 MKDIR_IF_NEEDED=[ -d $$1 ] || mkdir -p $$1
14
15 LINTFLAGS= -uhvpb
16 LINTFILES= error_msg.c et_name.c com_err.c
17 LIBOBJS= error_msg.o et_name.o com_err.o
18
19 UKERNELDIR=../libuafs/
20
21 CFLAGS= ${OPTMZ} -I${DESTDIR}include ${XCFLAGS}
22 FILES=  Makefile et_name.c error_msg.c compile_et.c \
23                 error_table.y et_lex.lex.l \
24                 com_err.c com_err.h \
25                 error_table.h mit-sipb-cr.h \
26                 test.c test1.et test2.et \
27                 compiler.h internal.h
28
29 CFILES= compile_et.c error_table.c error_msg.c et_name.c \
30         com_err.c
31
32 UKSRCS=com_err.c com_err.h error_msg.c error_table.h mit-sipb-cr.h internal.h et_name.c
33
34 COMPONENT=comerr
35 include ../config/Makefile.version
36
37 utilib=${SRCDIR}lib/afs/util.a ${XLIBS}
38
39 system noversion: install
40
41 #
42 # what to build...
43 #
44 ${DESTDIR}bin/compile_et: compile_et
45         ${INSTALL} compile_et ${DESTDIR}bin/compile_et
46
47 all:    libcom_err.a ${DESTDIR}bin/compile_et
48
49 lint:   llib-lcom_err.ln
50
51 archive:        et.tar
52
53 doc:    com_err.dvi
54
55 #
56 # rules
57 #
58 .SUFFIXES: .l .h .c .et .ps .x9700 .mss .dvi .texinfo
59
60 .l.c:
61         $(RM) -f $*.c
62         $(LEX) -t $*.l >$*.c
63
64 .et.c:
65         ./compile_et $*.et
66
67 .et.h:
68         ./compile_et $*.et
69
70 .texinfo.dvi:
71         tex $<
72
73 .dvi.ps:
74         rm -f $@.new
75         dvi2ps -r $< > $@.new
76         mv $@.new $@
77
78 .c.o:
79 #       ${CC} -c -pg ${CFLAGS} $*.c
80 #       mv $*.o profiled/$*.o
81         ${CC} -c ${CFLAGS} $*.c
82
83 #
84 # real entries...
85 #
86 compile_et:     compile_et.o error_table.o
87         case $(SYS_NAME) in \
88         *_linux* ) \
89         ${CC} ${CFLAGS} -o compile_et compile_et.o error_table.o ${utilib};; \
90         * ) \
91         ${CC} ${CFLAGS} -o compile_et compile_et.o error_table.o ${utilib} -ll;; \
92         esac
93
94 et.tar: ${FILES}
95         rm -f et.tar
96         tar cfrlv et.tar ${FILES}
97
98 tags:   TAGS
99
100 kinstall:
101         @echo No $@ source here.
102
103 ukinstall webinstall: install
104         set ${UKERNELDIR}afs; $(MKDIR_IF_NEEDED)
105         ${INSTALL} ${UKSRCS} ${UKERNELDIR}afs
106
107 install: all ukinstall
108         ${INSTALL} com_err.h ${DESTDIR}include/afs/com_err.h
109         ${INSTALL} error_table.h ${DESTDIR}include/afs/error_table.h
110         ${INSTALL} mit-sipb-cr.h ${DESTDIR}include/afs/mit-sipb-cr.h
111         ${INSTALL} libcom_err.a ${DESTDIR}lib/afs/libcom_err.a
112
113 TAGS:   et_name.c error_msg.c compile_et.c error_table.c \
114                 lex.yy.c perror.c
115         etags et_name.c error_msg.c compile_et.c \
116                 error_table.c perror.c
117
118 libcom_err.a:   $(LIBOBJS) AFS_component_version_number.o
119         - rm -f libcom_err.a
120         $(AR) cruv libcom_err.a $(LIBOBJS) AFS_component_version_number.o
121         $(RANLIB) libcom_err.a
122
123 llib-lcom_err.ln: $(LINTFILES)
124         lint -Ccom_err $(LINTFLAGS) $(LINTFILES)
125
126 clean:
127         -rm -f *~ \#* *.bak \
128                 *.otl *.aux *.toc *.PS *.dvi *.x9700 *.ps \
129                 *.cp *.fn *.ky *.log *.pg *.tp *.vr \
130                 *.o libcom_err.a \
131                 com_err.o compile_et \
132                 et.ar TAGS y.tab.c lex.yy.c error_table.c \
133                 et_lex.lex.c \
134                 test1.h test1.c test2.h test2.c test \
135                 eddep makedep core\
136                 AFS_component_version_number.c
137
138 test:
139         cd test; $(MAKE)
140
141 # 'make depend' code
142 depend: ${CFILES} et_lex.lex.c
143         rm -f eddep makedep
144         ${CC} -M ${CFLAGS} ${CFILES} | \
145         sed 's; ./; ;' | \
146         sed -e ':loop' \
147             -e 's/\.\.\/[^ /]*\/\.\./../' \
148             -e 't loop' > makedep
149         echo '/^# DO NOT DELETE THIS LINE/+1,$$d' >eddep
150         echo '$$r makedep' >>eddep
151         echo 'w' >>eddep
152         cp Makefile Makefile.bak
153         ed - Makefile < eddep
154         rm eddep makedep
155
156 compile_et.o:  AFS_component_version_number.c
157 #
158 # the last line in the makefile should be...
159 # DO NOT DELETE THIS LINE -- make depend depends on it.
160 compile_et.o: compile_et.c 
161 compile_et.o: mit-sipb-cr.h
162 error_table.o: error_table.c
163 error_table.o: internal.h
164 error_table.o: mit-sipb-cr.h
165 error_table.o: error_table.h
166 error_table.o: mit-sipb-cr.h
167 error_table.o: et_lex.lex.c
168 error_msg.o: error_msg.c
169 error_msg.o: error_table.h
170 error_msg.o: mit-sipb-cr.h
171 error_msg.o: internal.h
172 error_msg.o: mit-sipb-cr.h
173 et_name.o: et_name.c
174 et_name.o: error_table.h
175 et_name.o: mit-sipb-cr.h
176 et_name.o: internal.h
177 et_name.o: mit-sipb-cr.h
178 perror.o: perror.c
179 perror.o: internal.h
180 perror.o: mit-sipb-cr.h
181 perror.o: com_err.h
182 perror.o: mit-sipb-cr.h
183 perror.o: mit-sipb-cr.h
184 com_err.o: com_err.c
185 com_err.o: error_table.h
186 com_err.o: mit-sipb-cr.h
187 com_err.o: internal.h
188 com_err.o: mit-sipb-cr.h