explain yacc build product dependency so it is not removed
[openafs.git] / src / comerr / Makefile.in
index 26b202c..4b0c6c1 100644 (file)
@@ -6,6 +6,8 @@
 
 srcdir=@srcdir@
 include @TOP_OBJDIR@/src/config/Makefile.config
+include @TOP_OBJDIR@/src/config/Makefile.lwp
+
 INSTALL = @INSTALL@
 INSTALL_DATA = @INSTALL_DATA@
 INSTALL_PROGRAM = @INSTALL_PROGRAM@
@@ -13,6 +15,8 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@
 
 all: compile_et ${TOP_INCDIR}/afs/com_err.h ${TOP_INCDIR}/afs/error_table.h ${TOP_INCDIR}/afs/mit-sipb-cr.h ${TOP_LIBDIR}/libcom_err.a
 
+buildtools: compile_et
+
 ${TOP_INCDIR}/afs/com_err.h: com_err.h
        ${INSTALL_DATA} $? $@
 
@@ -32,9 +36,9 @@ et_lex.lex.c: et_lex.lex.l
 compile_et:    compile_et.o error_table.o
        case $(SYS_NAME) in \
        *_linux* | *_umlinux* ) \
-       ${CC} ${CFLAGS} -o compile_et compile_et.o error_table.o -L${TOP_LIBDIR} -lafsutil;; \
+       $(AFS_LDRULE) compile_et.o error_table.o -L${TOP_LIBDIR} -lafsutil;; \
        * ) \
-       ${CC} ${CFLAGS} -o compile_et compile_et.o error_table.o -L${TOP_LIBDIR} -lafsutil -ll;; \
+       $(AFS_LDRULE) compile_et.o error_table.o -L${TOP_LIBDIR} -lafsutil -ll;; \
        esac
 
 libcom_err.a: error_msg.o et_name.o com_err.o AFS_component_version_number.o
@@ -46,8 +50,7 @@ libcom_err.a: error_msg.o et_name.o com_err.o AFS_component_version_number.o
 # 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.
 #
-error_table.o: error_table.c
-       $(CC) $(CFLAGS) -I${srcdir} @CFLAGS_NOUNUSED@ -c $<
+CFLAGS_error_table.o= -I${srcdir} @CFLAGS_NOUNUSED@ @CFLAGS_NOOLDSTYLE@
 
 #
 # Installation targets
@@ -57,9 +60,9 @@ install: compile_et com_err.h error_table.h mit-sipb-cr.h libcom_err.a
        ${INSTALL} -d ${DESTDIR}${includedir}/afs
        ${INSTALL} -d ${DESTDIR}${libdir}/afs
        ${INSTALL_PROGRAM} compile_et ${DESTDIR}${bindir}/afs_compile_et
-       ${INSTALL_DATA} com_err.h ${DESTDIR}${includedir}/afs/com_err.h
-       ${INSTALL_DATA} error_table.h ${DESTDIR}${includedir}/afs/error_table.h
-       ${INSTALL_DATA} mit-sipb-cr.h ${DESTDIR}${includedir}/afs/mit-sipb-cr.h
+       ${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} libcom_err.a ${DESTDIR}${libdir}/afs/libcom_err.a
 
 dest: compile_et com_err.h error_table.h mit-sipb-cr.h libcom_err.a
@@ -67,9 +70,9 @@ dest: compile_et com_err.h error_table.h mit-sipb-cr.h libcom_err.a
        ${INSTALL} -d ${DEST}/include/afs
        ${INSTALL} -d ${DEST}/lib/afs
        ${INSTALL_PROGRAM} compile_et ${DEST}/bin/afs_compile_et
-       ${INSTALL_DATA} com_err.h ${DEST}/include/afs/com_err.h
-       ${INSTALL_DATA} error_table.h ${DEST}/include/afs/error_table.h
-       ${INSTALL_DATA} mit-sipb-cr.h ${DEST}/include/afs/mit-sipb-cr.h
+       ${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} libcom_err.a ${DEST}/lib/afs/libcom_err.a
 
 clean:
@@ -83,6 +86,7 @@ test:
        cd test; $(MAKE)
 
 compile_et.o:  AFS_component_version_number.c
-error_table.o: et_lex.lex.c
+# specify yacc build product as a dependency so our .c.o rule will apply
+error_table.o: et_lex.lex.c error_table.c
 
 include ../config/Makefile.version