From 0d0b5048a5b68d4079b13609775f9234183d1947 Mon Sep 17 00:00:00 2001 From: Simon Wilkinson Date: Mon, 21 Feb 2011 00:29:33 +0000 Subject: [PATCH] budb: Only have one build rule for budb_errs.c 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 Reviewed-by: Derrick Brashear --- src/budb/.gitignore | 1 - src/budb/Makefile.in | 24 ++++++++------------- src/budb/budb_client.h | 55 ++++++++++++++++++++++++++++++++++++++++++++++++ src/budb/budb_client.p.h | 54 ----------------------------------------------- 4 files changed, 64 insertions(+), 70 deletions(-) create mode 100644 src/budb/budb_client.h delete mode 100644 src/budb/budb_client.p.h diff --git a/src/budb/.gitignore b/src/budb/.gitignore index 1427515..d812870 100644 --- a/src/budb/.gitignore +++ b/src/budb/.gitignore @@ -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 diff --git a/src/budb/Makefile.in b/src/budb/Makefile.in index d0fd89c..ed21f6a 100644 --- a/src/budb/Makefile.in +++ b/src/budb/Makefile.in @@ -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 index 0000000..ce5e234 --- /dev/null +++ b/src/budb/budb_client.h @@ -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 +#ifndef BUDB_MAJORVERSION /* get the installed RPC stuff */ +#include +#include +#include +#endif + +#include + +/* 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 index 9088fec..0000000 --- a/src/budb/budb_client.p.h +++ /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 -#ifndef BUDB_MAJORVERSION /* get the installed RPC stuff */ -#include -#include -#include -#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 -- 1.9.4