From bd03d0bce8fa8c5d4644349ef5d1fb4893df57ec Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Fri, 29 Nov 2002 12:52:54 +0000 Subject: [PATCH] First include is the specification's .h file. --- ChangeLog | 8 ++++++++ src/Makefile.in | 48 ++++++++++++++++++++++++--------------------- src/input.cc | 4 +++- src/keyword-list.cc | 4 +++- src/keyword.cc | 4 +++- src/options.cc | 4 +++- src/output.cc | 4 +++- src/search.cc | 4 +++- src/version.cc | 3 +++ 9 files changed, 55 insertions(+), 28 deletions(-) diff --git a/ChangeLog b/ChangeLog index d4c495b..712988f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,13 @@ 2002-11-02 Bruno Haible + * src/version.cc: Include version.h. + * src/Makefile.in (OBJECTS): Reorder. + (KEYWORD_H, KEYWORD_LIST_H, INPUT_H, SEARCH_H, OUTPUT_H): New + variables. + (HASH_TABLE_H): Update. + (options.o, read-line.o, keyword.o, keyword-list.o, input.o, search.o, + output.o, main.o): Update dependencies. + * src/vectors.h: Remove file. * src/vectors.cc: Remove file. * src/search.h: Don't include vectors.h. diff --git a/src/Makefile.in b/src/Makefile.in index 68be761..fe2da6a 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -61,9 +61,8 @@ SHELL = /bin/sh VPATH = $(srcdir) -OBJECTS = options.o main.o \ - hash-table.o bool-array.o read-line.o version.o \ - keyword.o keyword-list.o output.o input.o search.o +OBJECTS = version.o options.o read-line.o keyword.o keyword-list.o \ + input.o bool-array.o hash-table.o search.o output.o main.o LIBS = ../lib/libgp.a @GPERF_LIBM@ CPPFLAGS = -I. -I$(srcdir)/../lib @@ -86,33 +85,38 @@ $(TARGETPROG): $(OBJECTS) # Dependencies. CONFIG_H = config.h VERSION_H = version.h -READ_LINE_H = read-line.h read-line.icc OPTIONS_H = options.h options.icc -HASH_TABLE_H = hash-table.h +READ_LINE_H = read-line.h read-line.icc +KEYWORD_H = keyword.h +KEYWORD_LIST_H = keyword-list.h $(KEYWORD_H) +INPUT_H = input.h $(READ_LINE_H) $(KEYWORD_LIST_H) BOOL_ARRAY_H = bool-array.h bool-array.icc $(OPTIONS_H) +HASH_TABLE_H = hash-table.h $(KEYWORD_H) +SEARCH_H = search.h $(KEYWORD_LIST_H) $(BOOL_ARRAY_H) +OUTPUT_H = output.h $(KEYWORD_LIST_H) +version.o : version.cc $(VERSION_H) + $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c $(srcdir)/version.cc +options.o : options.cc $(OPTIONS_H) $(VERSION_H) + $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c $(srcdir)/options.cc +read-line.o : read-line.cc $(READ_LINE_H) + $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c $(srcdir)/read-line.cc +keyword.o : keyword.cc $(KEYWORD_H) $(OPTIONS_H) + $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c $(srcdir)/keyword.cc +keyword-list.o : keyword-list.cc $(KEYWORD_LIST_H) + $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c $(srcdir)/keyword-list.cc +input.o : input.cc $(INPUT_H) $(OPTIONS_H) + $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c $(srcdir)/input.cc bool-array.o : bool-array.cc $(BOOL_ARRAY_H) $(OPTIONS_H) $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c $(srcdir)/bool-array.cc hash-table.o : hash-table.cc $(HASH_TABLE_H) $(OPTIONS_H) $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c $(srcdir)/hash-table.cc -main.o : main.cc $(OPTIONS_H) $(GEN_PERF_H) $(CONFIG_H) - $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c $(srcdir)/main.cc -options.o : options.cc $(OPTIONS_H) $(VECTORS_H) $(VERSION_H) - $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c $(srcdir)/options.cc -read-line.o : read-line.cc $(READ_LINE_H) $(OPTIONS_H) - $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c $(srcdir)/read-line.cc -version.o : version.cc $(VERSION_H) - $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c $(srcdir)/version.cc -keyword.o : keyword.cc keyword.h - $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c $(srcdir)/keyword.cc -keyword-list.o : keyword-list.cc keyword-list.h - $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c $(srcdir)/keyword-list.cc -output.o : output.cc output.h - $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c $(srcdir)/output.cc -input.o : input.cc input.h - $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c $(srcdir)/input.cc -search.o : search.cc search.h +search.o : search.cc $(SEARCH_H) $(OPTIONS_H) $(HASH_TABLE_H) $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c $(srcdir)/search.cc +output.o : output.cc $(OUTPUT_H) $(OPTIONS_H) $(VERSION_H) + $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c $(srcdir)/output.cc +main.o : main.cc $(OPTIONS_H) $(INPUT_H) $(SEARCH_H) $(OUTPUT_H) + $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c $(srcdir)/main.cc install : all force $(MKINSTALLDIRS) $(DESTDIR)$(bindir) diff --git a/src/input.cc b/src/input.cc index bfba4c6..bc7d5b8 100644 --- a/src/input.cc +++ b/src/input.cc @@ -20,12 +20,14 @@ If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +/* Specification. */ +#include "input.h" + #include #include /* declares exit() */ #include /* declares strncpy(), strchr() */ #include /* defines UCHAR_MAX etc. */ #include "options.h" -#include "input.h" Input::Input (Keyword_Factory *keyword_factory) : _factory (keyword_factory) diff --git a/src/keyword-list.cc b/src/keyword-list.cc index 01e7569..7be581e 100644 --- a/src/keyword-list.cc +++ b/src/keyword-list.cc @@ -20,9 +20,11 @@ If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include +/* Specification. */ #include "keyword-list.h" +#include + /* Constructor. */ Keyword_List::Keyword_List (Keyword *car) : _cdr (NULL), _car (car) diff --git a/src/keyword.cc b/src/keyword.cc index 948f708..3f6bb9a 100644 --- a/src/keyword.cc +++ b/src/keyword.cc @@ -20,10 +20,12 @@ If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +/* Specification. */ +#include "keyword.h" + #include #include #include -#include "keyword.h" #include "options.h" diff --git a/src/options.cc b/src/options.cc index f792237..992371a 100644 --- a/src/options.cc +++ b/src/options.cc @@ -20,12 +20,14 @@ If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +/* Specification. */ +#include "options.h" + #include #include /* declares atoi(), abs(), exit() */ #include /* declares strcmp() */ #include /* declares isdigit() */ #include "getopt.h" -#include "options.h" #include "version.h" /* Global option coordinator for the entire program. */ diff --git a/src/output.cc b/src/output.cc index 26344c2..2496a23 100644 --- a/src/output.cc +++ b/src/output.cc @@ -20,12 +20,14 @@ If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +/* Specification. */ +#include "output.h" + #include #include /* declares strncpy(), strchr() */ #include /* declares isprint() */ #include /* defines assert() */ #include /* defines SCHAR_MAX etc. */ -#include "output.h" #include "options.h" #include "version.h" diff --git a/src/search.cc b/src/search.cc index 7f70bf3..e760e66 100644 --- a/src/search.cc +++ b/src/search.cc @@ -20,6 +20,9 @@ If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +/* Specification. */ +#include "search.h" + #include #include /* declares exit(), rand(), srand() */ #include /* declares memset(), memcmp() */ @@ -27,7 +30,6 @@ #include /* defines INT_MIN, INT_MAX */ #include "options.h" #include "hash-table.h" -#include "search.h" /* Make the hash table 8 times larger than the number of keyword entries. */ static const int TABLE_MULTIPLE = 10; diff --git a/src/version.cc b/src/version.cc index fbc4af1..bf78acd 100644 --- a/src/version.cc +++ b/src/version.cc @@ -21,4 +21,7 @@ If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +/* Specification. */ +#include "version.h" + const char *version_string = "2.7.2";