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