1 | ###########################################################################
|
---|
2 | #
|
---|
3 | # Makefile -- parallel-building/src/gdbmcli-src
|
---|
4 | #
|
---|
5 | # Similar to txt2db (GDBM) executable in that you open a pipe to it and
|
---|
6 | # write commands to be applied to a GDBM database. However, unlike txt2db,
|
---|
7 | # this executable allows bidirectional streams (so you need to open the
|
---|
8 | # pipe for both reading and writing). It then supports commands of this
|
---|
9 | # form:
|
---|
10 | #
|
---|
11 | # \[<key>\][+\-\?]
|
---|
12 | # (<value>)?
|
---|
13 | # -{70}
|
---|
14 | #
|
---|
15 | # where: + is for add or update
|
---|
16 | # - is for delete
|
---|
17 | # ? is for lookup
|
---|
18 | #
|
---|
19 | # The aim of this executable is to allow a single, persistent, connection
|
---|
20 | # to a GDBM database, accessed through some kind of queued daemon, so as
|
---|
21 | # to support multiple readers and writers and thus parallel collection
|
---|
22 | # building.
|
---|
23 | #
|
---|
24 | # A component of the Greenstone digital library software
|
---|
25 | # from the New Zealand Digital Library Project at the
|
---|
26 | # University of Waikato, New Zealand.
|
---|
27 | #
|
---|
28 | # Copyright (C) 2011-2020 The New Zealand Digital Library Project
|
---|
29 | #
|
---|
30 | #
|
---|
31 | # This program is free software; you can redistribute it and/or modify
|
---|
32 | # it under the terms of the GNU General Public License as published by
|
---|
33 | # the Free Software Foundation; either version 2 of the License, or
|
---|
34 | # (at your option) any later version.
|
---|
35 | #
|
---|
36 | # This program is distributed in the hope that it will be useful,
|
---|
37 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
38 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
---|
39 | # GNU General Public License for more details.
|
---|
40 | #
|
---|
41 | # You should have received a copy of the GNU General Public License
|
---|
42 | # along with this program; if not, write to the Free Software
|
---|
43 | # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
---|
44 | #
|
---|
45 | ###########################################################################
|
---|
46 |
|
---|
47 | ifndef GSDL3SRCHOME
|
---|
48 | GSDL_DIR = ../../../..
|
---|
49 | else
|
---|
50 | GSDL_DIR = ${GSDL3SRCHOME}/gs2build
|
---|
51 | endif
|
---|
52 | COMMON_DIR = $(GSDL_DIR)/common-src
|
---|
53 | COMMON_PACKAGES_DIR = $(COMMON_DIR)/packages
|
---|
54 |
|
---|
55 | CXX = @CXX@
|
---|
56 | CXXFLAGS = @CXXFLAGS@
|
---|
57 | DEFS = @DEFS@ $(JDBM_DEFINES) $(SQLITE_DEFINES)
|
---|
58 | INCLUDES = -I. -I$(COMMON_PACKAGES_DIR)/gdbm/include -I$(COMMON_DIR)/src/lib -I${GEXTPARALLELBUILDING_INSTALLED}/include
|
---|
59 | INSTALL = @INSTALL@
|
---|
60 | LDFLAGS = @LDFLAGS@ -L${GEXTPARALLELBUILDING_INSTALLED}/lib
|
---|
61 | LIBS = -lm -lg @LIBS@ -L$(COMMON_PACKAGES_DIR)/gdbm/lib -lgdbm $(COMMON_DIR)/src/lib/gsdllib.a
|
---|
62 |
|
---|
63 |
|
---|
64 | CXXCOMPILE = $(CXX) -c $(CXXFLAGS) $(DEFS) $(INCLUDES)
|
---|
65 | CXXLINK = $(CXX) $(LDFLAGS) -o $@
|
---|
66 |
|
---|
67 |
|
---|
68 | .SUFFIXES:
|
---|
69 | .SUFFIXES: .cpp .o
|
---|
70 | .cpp.o:
|
---|
71 | $(CXXCOMPILE) $<
|
---|
72 |
|
---|
73 |
|
---|
74 | SOURCES = \
|
---|
75 | gdbmcli.cpp
|
---|
76 |
|
---|
77 | OBJECTS = \
|
---|
78 | gdbmcli.o
|
---|
79 |
|
---|
80 | EXECUTABLE_OBJECTS = \
|
---|
81 | $(OBJECTS)
|
---|
82 |
|
---|
83 | EXECUTABLE = gdbmcli
|
---|
84 |
|
---|
85 |
|
---|
86 | # Default target: make the executable
|
---|
87 | all: $(EXECUTABLE)
|
---|
88 |
|
---|
89 | gdbmcli: $(EXECUTABLE_OBJECTS)
|
---|
90 | $(CXXLINK) $(EXECUTABLE_OBJECTS) $(LIBS)
|
---|
91 |
|
---|
92 | install: $(EXECUTABLE)
|
---|
93 | $(INSTALL) -d ${GEXTPARALLELBUILDING_INSTALLED}/bin
|
---|
94 | $(INSTALL) -m 755 -s $(EXECUTABLE) ${GEXTPARALLELBUILDING_INSTALLED}/bin
|
---|
95 |
|
---|
96 | clean:
|
---|
97 | rm -f $(OBJECTS) $(EXECUTABLE)
|
---|
98 |
|
---|
99 | distclean:
|
---|
100 | rm -f $(OBJECTS) $(EXECUTABLE) Makefile
|
---|
101 |
|
---|
102 | depend:
|
---|
103 | makedepend -Y -- $(DEFS) $(INCLUDES) $(CXXFLAGS) -- $(SOURCES)
|
---|