#
# Copyright 1987, 1989 MIT Student Information Processing Board
# For copyright info, see mit-sipb-cr.h.
-#
-# $Locker$
-#
-
-DESTDIR=@DESTDIR@
-SRCDIR=@SRCDIR@
-TOP_SRCDIR=@TOP_SRCDIR@
-SYS_NAME=@AFS_SYSNAME@
-
-SHELL = /bin/sh
-
-include ../config/Makefile.${SYS_NAME}
-MKDIR_IF_NEEDED=[ -d $$1 ] || mkdir -p $$1
-
-LINTFLAGS= -uhvpb
-LINTFILES= error_msg.c et_name.c com_err.c
-LIBOBJS= error_msg.o et_name.o com_err.o
-
-UKERNELDIR=../libuafs/
-
-CFLAGS= ${OPTMZ} -I${DESTDIR}include -I${TOP_SRCDIR}/config ${XCFLAGS}
-FILES= Makefile et_name.c error_msg.c compile_et.c \
- error_table.y et_lex.lex.l \
- com_err.c com_err.h \
- error_table.h mit-sipb-cr.h \
- test.c test1.et test2.et \
- compiler.h internal.h
-
-CFILES= compile_et.c error_table.c error_msg.c et_name.c \
- com_err.c
-
-UKSRCS=com_err.c com_err.h error_msg.c error_table.h mit-sipb-cr.h internal.h et_name.c
-
-
-include ../config/Makefile.version
-
-system noversion: install
-
-#
-# what to build...
-#
-${DESTDIR}bin/compile_et: compile_et
- ${INSTALL} compile_et ${DESTDIR}bin/compile_et
-all: libcom_err.a ${DESTDIR}bin/compile_et
+srcdir=@srcdir@
+include @TOP_OBJDIR@/src/config/Makefile.config
+include @TOP_OBJDIR@/src/config/Makefile.libtool
+include @TOP_OBJDIR@/src/config/Makefile.lwp
-lint: llib-lcom_err.ln
+LT_objs = error_msg.lo et_name.lo com_err.lo AFS_component_version_number.lo
+LT_deps = $(top_builddir)/src/opr/liboafs_opr.la
+LT_libs = $(MT_LIBS)
-archive: et.tar
+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 \
+ liboafs_comerr.la
-doc: com_err.dvi
+buildtools: compile_et
-#
-# rules
-#
-.SUFFIXES: .l .h .c .et .ps .x9700 .mss .dvi .texinfo
-
-.l.c:
- $(RM) -f $*.c
- $(LEX) -t $*.l >$*.c
+${TOP_INCDIR}/afs/com_err.h: com_err.h
+ ${INSTALL_DATA} $? $@
-.et.c:
- ./compile_et $*.et
+${TOP_INCDIR}/afs/error_table.h: error_table.h
+ ${INSTALL_DATA} $? $@
-.et.h:
- ./compile_et $*.et
+${TOP_INCDIR}/afs/mit-sipb-cr.h: mit-sipb-cr.h
+ ${INSTALL_DATA} $? $@
-.texinfo.dvi:
- tex $<
+${TOP_LIBDIR}/libafscom_err.a: libafscom_err.a
+ ${INSTALL_DATA} $? $@
-.dvi.ps:
- rm -f $@.new
- dvi2ps -r $< > $@.new
- mv $@.new $@
+et_lex.lex.c: et_lex.lex.l
+ $(RM) -f et_lex.lex.c
+ $(LEX) -t $(srcdir)/et_lex.lex.l > et_lex.lex.c
-.c.o:
-# ${CC} -c -pg ${CFLAGS} $*.c
-# mv $*.o profiled/$*.o
- ${CC} -c ${CFLAGS} $*.c
-
-#
-# real entries...
-#
compile_et: compile_et.o error_table.o
- case $(SYS_NAME) in \
- *_linux* ) \
- ${CC} ${CFLAGS} -o compile_et compile_et.o error_table.o -L${DESTDIR}/lib/afs -lafsutil;; \
+ $(Q)case $(SYS_NAME) in \
+ *_linux* | *_umlinux* ) \
+ $(AFS_LDRULE_NOQ) compile_et.o error_table.o -L${TOP_LIBDIR} -lopr;; \
* ) \
- ${CC} ${CFLAGS} -o compile_et compile_et.o error_table.o -L${DESTDIR}/lib/afs -lafsutil -ll;; \
+ $(AFS_LDRULE_NOQ) compile_et.o error_table.o -L${TOP_LIBDIR} -lopr -ll;; \
esac
-et.tar: ${FILES}
- rm -f et.tar
- tar cfrlv et.tar ${FILES}
-
-tags: TAGS
-
-kinstall:
- @echo No $@ source here.
-
-ukinstall webinstall: install
- set ${UKERNELDIR}afs; $(MKDIR_IF_NEEDED)
- ${INSTALL} ${UKSRCS} ${UKERNELDIR}afs
+libafscom_err.a: $(LT_objs)
+ $(LT_LDLIB_lwp) $(LT_objs)
-install: all ukinstall
- ${INSTALL} com_err.h ${DESTDIR}include/afs/com_err.h
- ${INSTALL} error_table.h ${DESTDIR}include/afs/error_table.h
- ${INSTALL} mit-sipb-cr.h ${DESTDIR}include/afs/mit-sipb-cr.h
- ${INSTALL} libcom_err.a ${DESTDIR}lib/afs/libcom_err.a
+liboafs_comerr.la: $(LT_objs) $(LT_deps)
+ $(LT_LDLIB_shlib) $(LT_objs) $(LT_deps) $(LT_libs)
-TAGS: et_name.c error_msg.c compile_et.c error_table.c \
- lex.yy.c perror.c
- etags et_name.c error_msg.c compile_et.c \
- error_table.c perror.c
-
-libcom_err.a: $(LIBOBJS) AFS_component_version_number.o
- - rm -f libcom_err.a
- $(AR) cruv libcom_err.a $(LIBOBJS) AFS_component_version_number.o
- $(RANLIB) libcom_err.a
+# When we build this file, we're using a .c file that's in the object directory,
+# so we need to add the source directory to the includes to pick up local headers.
+#
+CFLAGS_error_table.o= -I${srcdir} @CFLAGS_NOUNUSED@ @CFLAGS_NOOLDSTYLE@
-llib-lcom_err.ln: $(LINTFILES)
- lint -Ccom_err $(LINTFLAGS) $(LINTFILES)
+#
+# Installation targets
+#
+install: compile_et com_err.h error_table.h mit-sipb-cr.h libafscom_err.a \
+ liboafs_comerr.la
+ ${INSTALL} -d ${DESTDIR}${bindir}
+ ${INSTALL} -d ${DESTDIR}${includedir}/afs
+ ${INSTALL} -d ${DESTDIR}${libdir}/afs
+ ${INSTALL_PROGRAM} compile_et ${DESTDIR}${bindir}/afs_compile_et
+ ${INSTALL_DATA} ${srcdir}/com_err.h ${DESTDIR}${includedir}/afs/com_err.h
+ ${INSTALL_DATA} ${srcdir}/error_table.h ${DESTDIR}${includedir}/afs/error_table.h
+ ${INSTALL_DATA} ${srcdir}/mit-sipb-cr.h ${DESTDIR}${includedir}/afs/mit-sipb-cr.h
+ ${INSTALL_DATA} libafscom_err.a ${DESTDIR}${libdir}/afs/libafscom_err.a
+ $(LT_INSTALL_DATA) liboafs_comerr.la $(DESTDIR)$(libdir)liboafs_comerr.la
+
+dest: compile_et com_err.h error_table.h mit-sipb-cr.h libafscom_err.a
+ ${INSTALL} -d ${DEST}/bin
+ ${INSTALL} -d ${DEST}/include/afs
+ ${INSTALL} -d ${DEST}/lib/afs
+ ${INSTALL_PROGRAM} compile_et ${DEST}/bin/afs_compile_et
+ ${INSTALL_DATA} ${srcdir}/com_err.h ${DEST}/include/afs/com_err.h
+ ${INSTALL_DATA} ${srcdir}/error_table.h ${DEST}/include/afs/error_table.h
+ ${INSTALL_DATA} ${srcdir}/mit-sipb-cr.h ${DEST}/include/afs/mit-sipb-cr.h
+ ${INSTALL_DATA} libafscom_err.a ${DEST}/lib/afs/libafscom_err.a
clean:
- -rm -f *~ \#* *.bak \
- *.otl *.aux *.toc *.PS *.dvi *.x9700 *.ps \
- *.cp *.fn *.ky *.log *.pg *.tp *.vr \
- *.o libcom_err.a \
- com_err.o compile_et \
- et.ar TAGS y.tab.c lex.yy.c error_table.c \
- et_lex.lex.c \
- test1.h test1.c test2.h test2.c test \
- eddep makedep core\
- AFS_component_version_number.c
+ $(LT_CLEAN)
+ $(RM) -f *~ \#* *.bak *.otl *.aux *.toc *.PS *.dvi *.x9700 *.ps \
+ *.cp *.fn *.ky *.log *.pg *.tp *.vr *.o libafscom_err.a \
+ com_err.o compile_et et.ar TAGS y.tab.c lex.yy.c error_table.c \
+ et_lex.lex.c test1.h test1.c test2.h test2.c \
+ eddep makedep core AFS_component_version_number.c
test:
cd test; $(MAKE)
-# 'make depend' code
-depend: ${CFILES} et_lex.lex.c
- rm -f eddep makedep
- ${CC} -M ${CFLAGS} ${CFILES} | \
- sed 's; ./; ;' | \
- sed -e ':loop' \
- -e 's/\.\.\/[^ /]*\/\.\./../' \
- -e 't loop' > makedep
- echo '/^# DO NOT DELETE THIS LINE/+1,$$d' >eddep
- echo '$$r makedep' >>eddep
- echo 'w' >>eddep
- cp Makefile Makefile.bak
- ed - Makefile < eddep
- rm eddep makedep
-
compile_et.o: AFS_component_version_number.c
-#
-# the last line in the makefile should be...
-# DO NOT DELETE THIS LINE -- make depend depends on it.
-compile_et.o: compile_et.c
-compile_et.o: mit-sipb-cr.h
-error_table.o: error_table.c
-error_table.o: internal.h
-error_table.o: mit-sipb-cr.h
-error_table.o: error_table.h
-error_table.o: mit-sipb-cr.h
-error_table.o: et_lex.lex.c
-error_msg.o: error_msg.c
-error_msg.o: error_table.h
-error_msg.o: mit-sipb-cr.h
-error_msg.o: internal.h
-error_msg.o: mit-sipb-cr.h
-et_name.o: et_name.c
-et_name.o: error_table.h
-et_name.o: mit-sipb-cr.h
-et_name.o: internal.h
-et_name.o: mit-sipb-cr.h
-perror.o: perror.c
-perror.o: internal.h
-perror.o: mit-sipb-cr.h
-perror.o: com_err.h
-perror.o: mit-sipb-cr.h
-perror.o: mit-sipb-cr.h
-com_err.o: com_err.c
-com_err.o: error_table.h
-com_err.o: mit-sipb-cr.h
-com_err.o: internal.h
-com_err.o: mit-sipb-cr.h
+# specify yacc build product as a dependency so our .c.o rule will apply
+error_table.o: et_lex.lex.c error_table.c
+error_table.lo: et_lex.lex.c error_table.c
+
+include ../config/Makefile.version