pull up r24469, r24530, r24533, r24534, r24535, r24537 from trunk
[krb5.git] / src / util / et / Makefile.in
1 prefix=@prefix@
2 bindir=@bindir@
3 datadir=@datadir@
4 mydatadir=$(datadir)/et
5 mydir=util$(S)et
6 BUILDTOP=$(REL)..$(S)..
7 RELDIR=../util/et
8 SED = sed
9 DEFS=
10
11 ##DOS##BUILDTOP = ..\..
12 ##DOS##LIBNAME=$(OUTPRE)comerr.lib
13 ##DOS##XTRA=
14 ##DOS##OBJFILE=$(OUTPRE)comerr.lst
15
16 STLIBOBJS=error_message.o et_name.o com_err.o
17 STOBJLISTS=OBJS.ST
18 LIBBASE=com_err
19 LIBMAJOR=3
20 LIBMINOR=0
21 LIBINITFUNC=com_err_initialize
22 LIBFINIFUNC=com_err_terminate
23
24 all-unix:: all-liblinks
25 clean-unix:: clean-liblinks clean-libs clean-libobjs clean-lclint
26 install-unix:: install-libs
27
28 LINTFLAGS=-uhvb 
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)
35
36 FILES=  Makefile et_name.c error_message.c compile_et.c \
37                 et_lex.lex.l error_table.y init_et.c \
38                 com_err.c com_err.h \
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 \
45 #       init_et.c com_err.c
46 SRCS= $(srcdir)/error_message.c \
47         $(srcdir)/et_name.c \
48         $(srcdir)/com_err.c
49
50 #
51 # Warning flags
52 #
53 # Uncomment WFLAGS if you want really anal GCC warning messages
54 #
55 #
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 
61
62 DEPLIBS=
63 SHLIB_LIBS=
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)
70
71 COM_ERR_HDR=$(BUILDTOP)$(S)include$(S)com_err.h
72
73 all-windows:: $(COM_ERR_HDR)
74
75 $(COM_ERR_HDR): com_err.h
76         $(CP) com_err.h "$@"
77
78 generate-files-mac: compile_et
79
80 error_table.c: et_lex.lex.c 
81 error_table.c: $(srcdir)/error_table.y
82
83 error_table.o: error_table.c et_lex.lex.c
84         $(CC) $(ALL_CFLAGS) -c error_table.c
85
86 com_err.o : com_err.c
87
88 et_lex.lex.o: et_lex.lex.c
89 test1.o: test1.c
90 test2.o: test2.c
91 test_et.o: test1.h test2.h
92 et1.o: et1.c
93 et2.o: et2.c
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
97
98 # /u1/kr/lclint-2.5q/bin/lclint -warnposix -D__sparc
99 LCLINT=lclint
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)
103 # -warnposix
104 # +charintliteral
105 # +ignoresigns
106 # -predboolint
107 # -exportlocal
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
121 clean-lclint:
122         $(RM) com_err.new com_err.lcd
123 ITS4=its4
124 ITS4OPTS=
125 do-its4: error_table.y et_lex.lex.c
126         $(ITS4) $(ITS4OPTS) $(SRCS)
127
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)
132
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)
139
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) $**
143
144 all-unix:: compile_et includes
145
146 includes:: com_err.h
147         if cmp $(srcdir)/com_err.h \
148         $(BUILDTOP)/include/com_err.h >/dev/null 2>&1; then :; \
149         else \
150                 (set -x; $(RM) $(BUILDTOP)/include/com_err.h; \
151                  $(CP) $(srcdir)/com_err.h \
152                         $(BUILDTOP)/include/com_err.h) ; \
153         fi
154
155 clean-unix::
156         $(RM) $(BUILDTOP)/include/com_err.h
157
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
164
165 check-windows:: $(OUTPRE)test_et$(EXEEXT)
166         set path=$(BUILDTOP)\lib\$(OUTPRE);%path%;
167         path
168         $(OUTPRE)test_et$(EXEEXT)
169
170 # The real compile_et just isn't portable.  (But then again, anything using 
171 # lex and yacc isn't portable by definition.  :-(  )
172 #
173 #compile_et: compile_et.o error_table.o
174 #       $(CC) $(CFLAGS) -o $@ compile_et.o error_table.o $(LEXLIB) $(BSDLIB)
175 #
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)
181
182
183 install-headers:: compile_et
184
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
188         chmod 755 compile_et    
189
190 rebuild: rebuild-c rebuild-h
191 rebuild-c:
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
194 rebuild-h:
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
197
198 clean-unix::
199         $(RM) compile_et
200
201 depend:: 
202
203 install:: com_err.h 
204         $(INSTALL_DATA) $(srcdir)/com_err.h  $(DESTDIR)$(KRB5_INCDIR)/com_err.h
205
206 install-unix:: compile_et.1
207         $(INSTALL_DATA) $(srcdir)/compile_et.1 $(DESTDIR)$(CLIENT_MANDIR)/compile_et.1
208
209
210 ## install_library_target(com_err,$(LIBOBJS),$(LINTFILES),)
211
212 clean-unix:: clean-files
213
214 clean-files::
215         rm -f *~ \#* *.bak \
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 \
221                 et_lex.lex.c \
222                 test1.h test1.c test2.h test2.c test_et \
223                 et1.c et1.h et2.c et2.h t_com_err \
224                 eddep makedep *.ln
225
226 clean-windows::
227         $(RM) $(COM_ERR_HDR)
228
229 com_err.ps : com_err.dvi
230 com_err.dvi: com_err.texinfo
231
232 libcom_err.o:   $(LIBOBJS)
233         ld -r -s -o libcom_err.o $(LIBOBJS)
234         chmod -x libcom_err.o
235
236 archive:        et.tar
237
238 TAGS:   et_name.c error_message.c compile_et.c error_table.c \
239                 lex.yy.c init_et.c
240         etags et_name.c error_message.c compile_et.c \
241                 error_table.c init_et.c
242
243 depend::  et_lex.lex.c includes compile_et
244
245
246 @lib_frag@
247 @libobj_frag@
248