]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
budb: Only have one build rule for budb_errs.c
authorSimon Wilkinson <sxw@your-file-system.com>
Mon, 21 Feb 2011 00:29:33 +0000 (00:29 +0000)
committerDerrick Brashear <shadow@dementia.org>
Mon, 21 Feb 2011 17:11:03 +0000 (09:11 -0800)
budb had two build rules that could produce budb_errs.c, but only
one of them also produced budb_client.h. This led to problems with
parallel makes, as depending on which rule fired first, budb_client.h
might, or might not, exist.

Rework all of this so that it's cleaner. Instead of producing two
copies of the error table, just make budb_client.h a static file,
and include the dynamically generated budb_errs.h from it. This
reduces code duplication, and means that we have to run compile_et
one less time.

Change-Id: Ib9b982454cc3f1ef3bdeb629c64dbb9901397fdb
Reviewed-on: http://gerrit.openafs.org/4027
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
src/budb/.gitignore
src/budb/Makefile.in
src/budb/budb_client.h [new file with mode: 0644]
src/budb/budb_client.p.h [deleted file]

index 1427515862b08ed3b0125d7360446a0f201793b7..d8128702833d8d13d7c6963eaa0bfbc553eafec5 100644 (file)
@@ -3,7 +3,6 @@
 # to check that you haven't inadvertently ignored any tracked files.
 
 /budb.h
-/budb_client.h
 /budb_errs.c
 /budb_errs.h
 /budb_server
index d0fd89c5324287d607cad8a220f1fa49feffb3ef..ed21f6a969859c7552617e0c14da5ba7b1fe76fd 100644 (file)
@@ -26,6 +26,8 @@ INCLS=\
        ${TOP_INCDIR}/afs/cellconfig.h \
        ${TOP_INCDIR}/afs/com_err.h \
        ${TOP_INCDIR}/afs/bubasics.h \
+       ${TOP_INCDIR}/afs/budb_client.h \
+       ${TOP_INCDIR}/afs/budb_errs.h \
        budb.h budb_client.h database.h
 
 # library ordering defined by top level makefile
@@ -53,7 +55,7 @@ SERVER_OBJS = ${COMMON_OBJS} budb.ss.o budb.xdr.o dbs_dump.o db_lock.o db_text.o
 all: ${TOP_LIBDIR}/libbudb.a ${TOP_INCDIR}/afs/budb.h ${TOP_INCDIR}/afs/budb_errs.h ${TOP_INCDIR}/afs/budb_prototypes.h budb_server
 
 generated: \
-       budb_errs.c budb_errs.h budb_client.h \
+       budb_errs.c budb_errs.h \
        budb.cs.c budb.ss.c budb.xdr.c budb.h
 
 ${TOP_LIBDIR}/libbudb.a: libbudb.a
@@ -63,7 +65,7 @@ ${TOP_INCDIR}/afs/budb.h: budb.h
        ${INSTALL_DATA} $? $@
 
 ${TOP_INCDIR}/afs/budb_errs.h: budb_errs.h
-       ${INSTALL_DATA} $? $@
+       ${INSTALL_DATA} budb_errs.h $@
 
 ${TOP_INCDIR}/afs/budb_client.h: budb_client.h
        ${INSTALL_DATA} $? $@
@@ -71,18 +73,10 @@ ${TOP_INCDIR}/afs/budb_client.h: budb_client.h
 ${TOP_INCDIR}/afs/budb_prototypes.h: budb_prototypes.h
        ${INSTALL_DATA} $? $@
 
-#
-# budb_errs.o actually depends on neither budb_client.h nor budb_errs.h
-# but generating either of them will rebuild budb_errs.c
-#
-budb_errs.o: budb_errs.c budb_client.h budb_errs.h
-
-budb_client.h: budb_errs.c
-
-budb_errs.c: budb_errs.et budb_client.p.h
-       $(RM) -f budb_client.h budb_errs.c; ${COMPILE_ET} -p ${srcdir} budb_errs -h budb_client
+budb_errs.h: budb_errs.c
 
-budb_errs.h: budb_errs.et
+budb_errs.c: budb_errs.et
+       $(RM) -f budb_errs.c
        ${COMPILE_ET} -p ${srcdir} budb_errs
 
 database.o: database.c budb_errs.h globals.h ${INCLS}
@@ -93,7 +87,7 @@ db_text.o:  db_text.c budb_errs.h ${INCLS}
 db_hash.o: db_hash.c budb_errs.h ${INCLS}
 ol_verify.o:   ol_verify.c budb_errs.h ${INCLS}
 procs.o: procs.c budb_errs.h globals.h ${INCLS}
-struct_ops.o: budb_errs.h ${TOP_INCDIR}/afs/budb_client.h
+struct_ops.o: budb_errs.h ${INCLS}
 server.o: server.c budb_errs.h ${INCLS} AFS_component_version_number.c
 
 budb_server: $(SERVER_OBJS) ${LIBS} ${TOP_INCDIR}/afs/budb_client.h
@@ -147,7 +141,7 @@ dest: libbudb.a budb.h budb_errs.h budb_client.h budb_server
 # Misc targets
 #
 clean:
-       $(RM) -f *.o *~ budb_errs.[ch] budb.h budb_client.h *.a *.xdr.c \
+       $(RM) -f *.o *~ budb_errs.[ch] budb.h *.a *.xdr.c \
                *.ss.c *.cs.c core budb_server AFS_component_version_number.c
 
 include ../config/Makefile.version
diff --git a/src/budb/budb_client.h b/src/budb/budb_client.h
new file mode 100644 (file)
index 0000000..ce5e234
--- /dev/null
@@ -0,0 +1,55 @@
+/*
+ * Copyright 2000, International Business Machines Corporation and others.
+ * All Rights Reserved.
+ *
+ * This software has been released under the terms of the IBM Public
+ * License.  For details, see the LICENSE file in the top-level source
+ * directory or online at http://www.openafs.org/dl/license10.html
+ */
+
+#ifndef __BUDB_CLIENT__
+#define __BUDB_CLIENT__
+
+#include <ubik.h>
+#ifndef BUDB_MAJORVERSION      /* get the installed RPC stuff */
+#include <sys/types.h>
+#include <rx/xdr.h>
+#include <afs/budb.h>
+#endif
+
+#include <afs/budb_errs.h>
+
+/* for ubik_Call_SingleServer */
+
+#define UF_SINGLESERVER         1      /* begin single server operation */
+#define UF_END_SINGLESERVER     2      /* terminate single server operation */
+
+
+/* handle for the ubik database connection */
+
+struct udbHandleS {
+    afs_int32 uh_scIndex;      /* what type of sec. object */
+    struct rx_securityClass *uh_secobj;        /* security object */
+    struct rx_connection *uh_serverConn[MAXSERVERS];   /* server connections */
+    struct ubik_client *uh_client;     /* ubik client handle */
+    afs_uint32 uh_instanceId;  /* instance of client */
+};
+
+typedef struct udbHandleS udbHandleT;
+typedef udbHandleT *udbHandleP;
+
+/* suggested text block management structure */
+
+struct udbClientTextS {
+    char *textName;            /* for info. only */
+    afs_int32 textType;                /* used as key for access */
+    afs_uint32 textVersion;    /* version # for cache mgmt */
+    afs_uint32 lockHandle;     /* for atomicity */
+    afs_int32 textSize;                /* no. of bytes */
+    FILE *textStream;          /* file stream or NULL */
+};
+
+typedef struct udbClientTextS udbClientTextT;
+typedef udbClientTextT *udbClientTextP;
+
+#endif
diff --git a/src/budb/budb_client.p.h b/src/budb/budb_client.p.h
deleted file mode 100644 (file)
index 9088fec..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Copyright 2000, International Business Machines Corporation and others.
- * All Rights Reserved.
- *
- * This software has been released under the terms of the IBM Public
- * License.  For details, see the LICENSE file in the top-level source
- * directory or online at http://www.openafs.org/dl/license10.html
- */
-
-#ifndef __BUDB_CLIENT__
-#define __BUDB_CLIENT__
-
-#include <ubik.h>
-#ifndef BUDB_MAJORVERSION      /* get the installed RPC stuff */
-#include <sys/types.h>
-#include <rx/xdr.h>
-#include <afs/budb.h>
-#endif
-
-
-/* for ubik_Call_SingleServer */
-
-#define UF_SINGLESERVER         1      /* begin single server operation */
-#define UF_END_SINGLESERVER     2      /* terminate single server operation */
-
-
-/* handle for the ubik database connection */
-
-struct udbHandleS {
-    afs_int32 uh_scIndex;      /* what type of sec. object */
-    struct rx_securityClass *uh_secobj;        /* security object */
-    struct rx_connection *uh_serverConn[MAXSERVERS];   /* server connections */
-    struct ubik_client *uh_client;     /* ubik client handle */
-    afs_uint32 uh_instanceId;  /* instance of client */
-};
-
-typedef struct udbHandleS udbHandleT;
-typedef udbHandleT *udbHandleP;
-
-/* suggested text block management structure */
-
-struct udbClientTextS {
-    char *textName;            /* for info. only */
-    afs_int32 textType;                /* used as key for access */
-    afs_uint32 textVersion;    /* version # for cache mgmt */
-    afs_uint32 lockHandle;     /* for atomicity */
-    afs_int32 textSize;                /* no. of bytes */
-    FILE *textStream;          /* file stream or NULL */
-};
-
-typedef struct udbClientTextS udbClientTextT;
-typedef udbClientTextT *udbClientTextP;
-
-#endif