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 | GSDL_DIR = ../../../..
|
---|
48 | COMMON_DIR = $(GSDL_DIR)/common-src
|
---|
49 |
|
---|
50 | COMMON_PACKAGES_DIR = $(COMMON_DIR)/packages
|
---|
51 |
|
---|
52 | CXX = @CXX@
|
---|
53 | CXXFLAGS = @CXXFLAGS@
|
---|
54 | DEFS = @DEFS@ $(GDBM_DEFINES) $(JDBM_DEFINES) $(SQLITE_DEFINES)
|
---|
55 | INCLUDES = -I. @GDBM_CFLAGS@ -I$(COMMON_DIR)/src/lib -I${GEXTPARALLELBUILDING_INSTALLED}/include
|
---|
56 | INSTALL = @INSTALL@
|
---|
57 | LDFLAGS = @LDFLAGS@ -L${GEXTPARALLELBUILDING_INSTALLED}/lib
|
---|
58 | LIBS = -lm -lg @LIBS@ @GDBM_LIBS@ $(COMMON_DIR)/src/lib/gsdllib.a
|
---|
59 |
|
---|
60 |
|
---|
61 | CXXCOMPILE = $(CXX) -c $(CXXFLAGS) $(DEFS) $(INCLUDES)
|
---|
62 | CXXLINK = $(CXX) $(LDFLAGS) -o $@
|
---|
63 |
|
---|
64 |
|
---|
65 | .SUFFIXES:
|
---|
66 | .SUFFIXES: .cpp .o
|
---|
67 | .cpp.o:
|
---|
68 | $(CXXCOMPILE) $<
|
---|
69 |
|
---|
70 |
|
---|
71 | SOURCES = \
|
---|
72 | gdbmcli.cpp
|
---|
73 |
|
---|
74 | OBJECTS = \
|
---|
75 | gdbmcli.o
|
---|
76 |
|
---|
77 | EXECUTABLE_OBJECTS = \
|
---|
78 | $(OBJECTS)
|
---|
79 |
|
---|
80 | EXECUTABLE = gdbmcli
|
---|
81 |
|
---|
82 |
|
---|
83 | # Default target: make the executable
|
---|
84 | all: $(EXECUTABLE)
|
---|
85 |
|
---|
86 | gdbmcli: $(EXECUTABLE_OBJECTS)
|
---|
87 | $(CXXLINK) $(EXECUTABLE_OBJECTS) $(LIBS)
|
---|
88 |
|
---|
89 | install: $(EXECUTABLE)
|
---|
90 | $(INSTALL) -d ${GEXTPARALLELBUILDING_INSTALLED}/bin
|
---|
91 | $(INSTALL) -m 755 -s $(EXECUTABLE) ${GEXTPARALLELBUILDING_INSTALLED}/bin
|
---|
92 |
|
---|
93 | clean:
|
---|
94 | rm -f $(OBJECTS) $(EXECUTABLE)
|
---|
95 |
|
---|
96 | distclean:
|
---|
97 | rm -f $(OBJECTS) $(EXECUTABLE) Makefile
|
---|
98 |
|
---|
99 | depend:
|
---|
100 | makedepend -Y -- $(DEFS) $(INCLUDES) $(CXXFLAGS) -- $(SOURCES)
|
---|