4 mydatadir=$(datadir)/et
6 BUILDTOP=$(REL)..$(S)..
11 ##DOS##BUILDTOP = ..\..
12 ##DOS##LIBNAME=$(OUTPRE)comerr.lib
14 ##DOS##OBJFILE=$(OUTPRE)comerr.lst
16 STLIBOBJS=error_message.o et_name.o com_err.o
21 LIBINITFUNC=com_err_initialize
22 LIBFINIFUNC=com_err_terminate
24 all-unix:: all-liblinks
25 clean-unix:: clean-liblinks clean-libs clean-libobjs clean-lclint
26 install-unix:: install-libs
29 LINTFILES= error_message.c et_name.c com_err.c
30 LIBOBJS=$(OUTPRE)com_err.$(OBJEXT) \
31 $(OUTPRE)error_message.$(OBJEXT) \
32 $(OUTPRE)et_name.$(OBJEXT)
33 # for et_lex.lex.c include in error_table.y
34 LOCALINCLUDES=-I. -I$(srcdir)
36 FILES= Makefile et_name.c error_message.c compile_et.c \
37 et_lex.lex.l error_table.y init_et.c \
39 error_table.h mit-sipb-copyright.h \
40 test_et.c test1.et test2.et \
41 t_com_err.c et1.et et2.et \
42 compiler.h internal.h \
43 com_err.texinfo texinfo.tex
44 #SRCS= compile_et.c error_table.c error_message.c et_name.c \
46 SRCS= $(srcdir)/error_message.c \
53 # Uncomment WFLAGS if you want really anal GCC warning messages
56 WFLAGS= -ansi -D_POSIX_SOURCE -pedantic \
57 -Wall -Wwrite-strings -Wpointer-arith \
58 -Wcast-qual -Wcast-align -Wtraditional \
59 -Wstrict-prototypes -Wmissing-prototypes \
60 -Wnested-externs -Winline -DNO_INLINE_FUNCS -Wshadow
64 SHLIB_EXPDEPS = $(SUPPORT_DEPLIB)
65 SHLIB_EXPLIBS=-l$(SUPPORT_LIBNAME) $(LIBS)
66 SHLIB_LDFLAGS= $(LDFLAGS) @SHLIB_RPATH_DIRS@
67 SHLIB_LIBDIRS= @SHLIB_LIBDIRS@
68 SHLIB_RDIRS=$(KRB5_LIBDIR)
69 SHLIB_DIRS=-L$(TOPLIBD)
71 COM_ERR_HDR=$(BUILDTOP)$(S)include$(S)com_err.h
73 all-windows:: $(COM_ERR_HDR)
75 $(COM_ERR_HDR): com_err.h
78 generate-files-mac: compile_et
80 error_table.c: et_lex.lex.c
81 error_table.c: $(srcdir)/error_table.y
83 error_table.o: error_table.c et_lex.lex.c
84 $(CC) $(ALL_CFLAGS) -c error_table.c
88 et_lex.lex.o: et_lex.lex.c
91 test_et.o: test1.h test2.h
94 test1.c test2.c et1.c et2.c test1.h test2.h et1.h et2.h: \
95 compile_et et_c.awk et_h.awk
96 t_com_err.o: et1.h et2.h t_com_err.c
98 # /u1/kr/lclint-2.5q/bin/lclint -warnposix -D__sparc
100 # +posixlib gets more complete errno list than ansilib
101 # -usedef turns off bogus warnings from poor dataflow analysis (should be
102 # redundant with gcc warnings anyways)
108 # -retvalint allow ignoring of int return values (e.g., fputs)
109 LCLINTOPTS=+posixlib \
110 -usedef -warnposix +charintliteral +ignoresigns -predboolint +boolint \
111 -exportlocal -retvalint \
112 +mod-uncon +modinternalstrict +modfilesys
113 com_err.lcd: error_table.c error_table.h et_lex.lex.c com_err.h
114 $(LCLINT) $(LCLINTOPTS) $(LOCALINCLUDES) $(DEFS) $(SRCS) \
115 -dump com_err.new -expect 1
116 mv -f com_err.new com_err.lcd
117 do-lclint: com_err.lcd t_com_err.c et1.c et2.c et1.h et2.h
118 $(LCLINT) $(LCLINTOPTS) $(LOCALINCLUDES) \
119 $(srcdir)/t_com_err.c et1.c et2.c
120 # "-load com_err.lcd" -> lclint brokenness
122 $(RM) com_err.new com_err.lcd
125 do-its4: error_table.y et_lex.lex.c
126 $(ITS4) $(ITS4OPTS) $(SRCS)
128 #test_et: test_et.o test1.o test2.o $(LIBOBJS)
129 # $(CC) -o test_et test_et.o test1.o test2.o $(LIBOBJS)
130 #t_com_err: t_com_err.o et1.o et2.o $(LIBOBJS)
131 # $(CC) -o t_com_err t_com_err.o et1.o et2.o $(LIBOBJS)
133 PROG_RPATH=$(KRB5_LIBDIR)
134 PROG_LIBPATH=-L$(TOPLIBD)
135 test_et: test_et.o test1.o test2.o $(COM_ERR_DEPLIB) $(SUPPORT_DEPLIB)
136 $(CC_LINK) -o test_et test_et.o test1.o test2.o -lcom_err $(SUPPORT_LIB)
137 t_com_err: t_com_err.o et1.o et2.o $(COM_ERR_DEPLIB) $(SUPPORT_DEPLIB)
138 $(CC_LINK) -o t_com_err t_com_err.o et1.o et2.o -lcom_err $(SUPPORT_LIB)
140 $(OUTPRE)test_et.exe: $(OUTPRE)test_et.$(OBJEXT) $(OUTPRE)test1.$(OBJEXT) \
141 $(OUTPRE)test2.$(OBJEXT) $(CLIB)
142 link $(EXE_LINKOPTS) -out:$(OUTPRE)test_et$(EXEEXT) $**
144 all-unix:: compile_et includes
147 if cmp $(srcdir)/com_err.h \
148 $(BUILDTOP)/include/com_err.h >/dev/null 2>&1; then :; \
150 (set -x; $(RM) $(BUILDTOP)/include/com_err.h; \
151 $(CP) $(srcdir)/com_err.h \
152 $(BUILDTOP)/include/com_err.h) ; \
156 $(RM) $(BUILDTOP)/include/com_err.h
158 RUN_SETUP = @KRB5_RUN_ENV@
159 # test_et doesn't have an interesting exit status, but it'll exercise
160 # some cases that t_com_err doesn't, so let's see if it crashes.
161 check-unix:: t_com_err test_et
162 $(RUN_SETUP) $(VALGRIND) ./test_et
163 $(RUN_SETUP) $(VALGRIND) ./t_com_err
165 check-windows:: $(OUTPRE)test_et$(EXEEXT)
166 set path=$(BUILDTOP)\lib\$(OUTPRE);%path%;
168 $(OUTPRE)test_et$(EXEEXT)
170 # The real compile_et just isn't portable. (But then again, anything using
171 # lex and yacc isn't portable by definition. :-( )
173 #compile_et: compile_et.o error_table.o
174 # $(CC) $(CFLAGS) -o $@ compile_et.o error_table.o $(LEXLIB) $(BSDLIB)
176 install-unix:: compile_et
177 $(INSTALL) compile_et $(DESTDIR)$(bindir)/compile_et
178 test -d $(DESTDIR)$(mydatadir) || mkdir $(DESTDIR)$(mydatadir)
179 $(INSTALL_DATA) $(srcdir)/et_c.awk $(DESTDIR)$(mydatadir)
180 $(INSTALL_DATA) $(srcdir)/et_h.awk $(DESTDIR)$(mydatadir)
183 install-headers:: compile_et
185 compile_et: $(srcdir)/compile_et.sh $(srcdir)/config_script
186 $(SHELL) $(srcdir)/config_script $(srcdir)/compile_et.sh \
187 "$(mydatadir)" $(AWK) $(SED) > compile_et
190 rebuild: rebuild-c rebuild-h
192 a2p < $(srcdir)/et_c.awk | awk 'NR != 1 || $$0 !~ /^\043!/{print;}' > $(srcdir)/et_c.tmp
193 mv -f $(srcdir)/et_c.tmp $(srcdir)/et_c.pl
195 a2p < $(srcdir)/et_h.awk | awk 'NR != 1 || $$0 !~ /^\043!/{print;}' > $(srcdir)/et_h.tmp
196 mv -f $(srcdir)/et_h.tmp $(srcdir)/et_h.pl
204 $(INSTALL_DATA) $(srcdir)/com_err.h $(DESTDIR)$(KRB5_INCDIR)/com_err.h
206 install-unix:: compile_et.1
207 $(INSTALL_DATA) $(srcdir)/compile_et.1 $(DESTDIR)$(CLIENT_MANDIR)/compile_et.1
210 ## install_library_target(com_err,$(LIBOBJS),$(LINTFILES),)
212 clean-unix:: clean-files
216 *.otl *.aux *.toc *.PS *.dvi *.x9700 *.ps \
217 *.cp *.fn *.ky *.log *.pg *.tp *.vr \
218 *.o profiled/?*.o libcom_err.a libcom_err_p.a \
219 com_err.o compile_et \
220 et.ar TAGS y.tab.c lex.yy.c error_table.c \
222 test1.h test1.c test2.h test2.c test_et \
223 et1.c et1.h et2.c et2.h t_com_err \
229 com_err.ps : com_err.dvi
230 com_err.dvi: com_err.texinfo
232 libcom_err.o: $(LIBOBJS)
233 ld -r -s -o libcom_err.o $(LIBOBJS)
234 chmod -x libcom_err.o
238 TAGS: et_name.c error_message.c compile_et.c error_table.c \
240 etags et_name.c error_message.c compile_et.c \
241 error_table.c init_et.c
243 depend:: et_lex.lex.c includes compile_et