From d2b5fe92a4755ce67f2dd6050955782b4fd6b3f3 Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Tue, 6 Jun 2000 02:01:41 +0000 Subject: [PATCH] Generate dependancies for dot 'h' files made by gen. --- lib/dns/Makefile.in | 3 +++ lib/dns/gen.c | 26 +++++++++++++++++++++++--- make/rules.in | 3 +++ 3 files changed, 29 insertions(+), 3 deletions(-) diff --git a/lib/dns/Makefile.in b/lib/dns/Makefile.in index 99c8bb4746..18213ca3da 100644 --- a/lib/dns/Makefile.in +++ b/lib/dns/Makefile.in @@ -148,6 +148,9 @@ SUBDIRS = include sec config TARGETS = include/dns/enumtype.h include/dns/enumclass.h \ include/dns/rdatastruct.h timestamp +DEPENDEXTRA = ./gen -F include/dns/rdatastruct.h \ + -s ${srcdir} -d >> Makefile ; + @BIND9_MAKE_RULES@ version.@O@: version.c diff --git a/lib/dns/gen.c b/lib/dns/gen.c index b7dd9e0b42..240f5f5285 100644 --- a/lib/dns/gen.c +++ b/lib/dns/gen.c @@ -15,7 +15,7 @@ * SOFTWARE. */ -/* $Id: gen.c,v 1.50 2000/06/02 03:26:17 tale Exp $ */ +/* $Id: gen.c,v 1.51 2000/06/06 02:01:40 marka Exp $ */ #include @@ -459,29 +459,41 @@ main(int argc, char **argv) { int class_enum = 0; int type_enum = 0; int structs = 0; + int depend = 0; int c, i, j; char buf1[11]; char filetype = 'c'; FILE *fd; char *prefix = NULL; char *suffix = NULL; + char *file = NULL; isc_dir_t dir; for (i = 0 ; i <= 255 ; i++) memset(&typenames[i], 0, sizeof(typenames[i])); strcpy(srcdir, ""); - while ((c = isc_commandline_parse(argc, argv, "cits:P:S:")) != -1) + while ((c = isc_commandline_parse(argc, argv, "cdits:F:P:S:")) != -1) switch (c) { case 'c': code = 0; + depend = 0; type_enum = 0; class_enum = 1; filetype = 'c'; structs = 0; break; + case 'd': + code = 0; + depend = 1; + class_enum = 0; + type_enum = 0; + structs = 0; + filetype = 'h'; + break; case 't': code = 0; + depend = 0; class_enum = 0; type_enum = 1; filetype = 'c'; @@ -489,6 +501,7 @@ main(int argc, char **argv) { break; case 'i': code = 0; + depend = 0; class_enum = 0; type_enum = 0; structs = 1; @@ -497,6 +510,9 @@ main(int argc, char **argv) { case 's': sprintf(srcdir, "%s/", isc_commandline_argument); break; + case 'F': + file = isc_commandline_argument; + break; case 'P': prefix = isc_commandline_argument; break; @@ -536,7 +552,7 @@ main(int argc, char **argv) { } else year[0] = 0; - fprintf(stdout, copyright, year); + if (!depend) fprintf(stdout, copyright, year); if (code) { fputs("#ifndef DNS_CODE_H\n", stdout); @@ -820,6 +836,10 @@ main(int argc, char **argv) { fclose(fd); } } + } else if (depend) { + for (tt = types; tt != NULL ; tt = tt->next) + fprintf(stdout, "%s:\t%s/%s_%d.h\n", file, + tt->dirname, tt->typename, tt->type); } if (ferror(stdout) != 0) diff --git a/make/rules.in b/make/rules.in index 62a3c4b208..88f58e1266 100644 --- a/make/rules.in +++ b/make/rules.in @@ -136,12 +136,15 @@ depend: ${MKDEP} ${ALL_CPPFLAGS} ${SRCS}; \ echo ${MKDEP} -ap ${ALL_CPPFLAGS} ${PSRCS}; \ ${MKDEP} -ap ${ALL_CPPFLAGS} ${PSRCS}; \ + ${DEPENDEXTRA} \ elif [ X"${SRCS}" != X ] ; then \ echo ${MKDEP} ${ALL_CPPFLAGS} ${SRCS}; \ ${MKDEP} ${ALL_CPPFLAGS} ${SRCS}; \ + ${DEPENDEXTRA} \ elif [ X"${PSRCS}" != X ] ; then \ echo ${MKDEP} ${ALL_CPPFLAGS} ${PSRCS}; \ ${MKDEP} -p ${ALL_CPPFLAGS} ${PSRCS}; \ + ${DEPENDEXTRA} \ fi FORCE: