source: main/trunk/greenstone2/runtime-src/src/z3950/Makefile.in@ 30967

Last change on this file since 30967 was 30967, checked in by ak19, 5 years ago

Correction to regex expression used in sed in z3950 Makefile: what worked on linux breaks on mac, so simplifying regex.

File size: 5.3 KB
Line 
1###########################################################################
2#
3# Makefile -- runtime-src/src/z3950
4# A component of the Greenstone digital library software
5# from the New Zealand Digital Library Project at the
6# University of Waikato, New Zealand.
7#
8# Copyright (C) 1999-2008 The New Zealand Digital Library Project
9#
10#
11# This program is free software; you can redistribute it and/or modify
12# it under the terms of the GNU General Public License as published by
13# the Free Software Foundation; either version 2 of the License, or
14# (at your option) any later version.
15#
16# This program is distributed in the hope that it will be useful,
17# but WITHOUT ANY WARRANTY; without even the implied warranty of
18# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19# GNU General Public License for more details.
20#
21# You should have received a copy of the GNU General Public License
22# along with this program; if not, write to the Free Software
23# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
24#
25###########################################################################
26
27GSDL_DIR = ../../..
28COMMON_DIR = $(GSDL_DIR)/common-src
29RUNTIME_DIR = $(GSDL_DIR)/runtime-src
30
31GSDLOS = @gsdlos@
32GSDLARCH = @gsdlarch@
33
34INDEXERS_DIR = $(COMMON_DIR)/indexers
35COMMON_PACKAGES_DIR = $(COMMON_DIR)/packages
36RUNTIME_PACKAGES_DIR = $(RUNTIME_DIR)/packages
37COLSERVR_DIR = $(RUNTIME_DIR)/src/colservr
38PROTOCOL_DIR = $(RUNTIME_DIR)/src/protocol
39
40
41ENABLE_ACCENTFOLD = @ENABLE_ACCENTFOLD@
42ifeq ($(ENABLE_ACCENTFOLD), 1)
43ifeq ($(GSDLOS),darwin)
44ACCENTFOLD_LIBS = $(INDEXERS_DIR)/packages/unac/libunac.a -liconv
45else
46ACCENTFOLD_LIBS = $(INDEXERS_DIR)/packages/unac/libunac.a $(COMMON_PACKAGES_DIR)/iconv/lib/libiconv.a
47endif
48else
49ACCENTFOLD_LIBS =
50endif
51
52
53ENABLE_MG = @ENABLE_MG@
54ifeq ($(ENABLE_MG), 1)
55MG_INDEXERS_LIBS = $(INDEXERS_DIR)/mg/src/text/libmgtext.a \
56 $(INDEXERS_DIR)/mg/lib/libmglib.a
57else
58MG_INDEXERS_LIBS =
59endif
60
61ENABLE_MGPP = @ENABLE_MGPP@
62ifeq ($(ENABLE_MGPP), 1)
63MGPP_INDEXERS_LIBS = $(INDEXERS_DIR)/mgpp/text/libmgpptext.a \
64 $(INDEXERS_DIR)/mgpp/lib/libmgpplib.a
65MGPP_INCLUDES = -I$(INDEXERS_DIR)/mgpp/text -I$(INDEXERS_DIR)/mgpp/lib
66else
67MGPP_INDEXERS_LIBS =
68MGPP_INCLUDES =
69endif
70
71USE_GDBM = @USE_GDBM@
72ifeq ($(USE_GDBM), 1)
73GDBM_LIBS = $(COMMON_PACKAGES_DIR)/gdbm/lib/libgdbm.a
74GDBM_DEFINES = -DUSE_GDBM
75else
76GDBM_LIBS =
77GDBM_DEFINES =
78endif
79
80USE_JDBM = @USE_JDBM@
81ifeq ($(USE_JDBM), 1)
82JDBM_DEFINES = -DUSE_JDBM
83else
84JDBM_DEFINES =
85endif
86
87USE_SQLITE = @USE_SQLITE@
88ifeq ($(USE_SQLITE), 1)
89SQLITE_LIBS = $(COMMON_PACKAGES_DIR)/sqlite/lib/libsqlite3.a -ldl -lpthread
90SQLITE_DEFINES = -DUSE_SQLITE
91else
92SQLITE_LIBS =
93SQLITE_DEFINES =
94endif
95
96USE_Z3950 = @USE_Z3950@
97ifeq ($(USE_Z3950), 1)
98AR = ar
99CC = @CC@
100CPP = @CXX@
101CFLAGS = @CFLAGS@
102CPPFLAGS = @CXXFLAGS@
103DEFS = @DEFS@ -DNZDL -DQUIET -DSHORT_SUFFIX -DPARADOCNUM -DGSDLSERVER $(GDBM_DEFINES) $(JDBM_DEFINES) $(SQLITE_DEFINES)
104GSDLOS = @gsdlos@
105# Do NOT add the "recpt" directory here: the z39.50 code should be independent of the receptionist!
106INCLUDES = -I. -I$(GSDL_DIR) -I$(COMMON_DIR)/src/lib -I$(COLSERVR_DIR) -I$(PROTOCOL_DIR) \
107 $(MGPP_INCLUDES) -I$(RUNTIME_PACKAGES_DIR)/yaz/yaz-2.1.56/include \
108 -I$(RUNTIME_PACKAGES_DIR)/yaz/yaz-2.1.56/client -I$(RUNTIME_PACKAGES_DIR)/d2m
109INSTALL = @INSTALL@
110LDFLAGS = @LDFLAGS@
111# Use GNU specific shell command to capture output.
112# Need LIBS to contain all the dependencies for libyaz that yaz had worked out (from yaz's Makefile)
113# http://stackoverflow.com/questions/2019989/how-to-assign-the-output-of-a-command-to-a-makefile-variable
114YAZ_LIBS = $(shell egrep "^LIBS\s?=" $(RUNTIME_PACKAGES_DIR)/yaz/yaz-2.1.56/Makefile | sed 's/^LIBS = //')
115LIBS = @LIBS@ $(GDBM_LIBS) -L$(COMMON_PACKAGES_DIR)/expat/lib -lexpat \
116 $(ACCENTFOLD_LIBS) $(SQLITE_LIBS) \
117 $(RUNTIME_PACKAGES_DIR)/yaz/lib/libyaz.a $(RUNTIME_PACKAGES_DIR)/d2m/libd2m.a $(YAZ_LIBS) -lz
118RANLIB = @RANLIB@
119
120
121COMPILE = $(CC) -c $(CFLAGS) $(DEFS) $(INCLUDES)
122CPPCOMPILE = $(CPP) -c $(CPPFLAGS) $(DEFS) $(INCLUDES)
123CPPLINK = $(CPP) $(LDFLAGS) -o $@
124
125
126.SUFFIXES:
127.SUFFIXES: .c .o
128.c.o:
129 $(COMPILE) $<
130
131.SUFFIXES: .cpp .o
132.cpp.o:
133 $(CPPCOMPILE) $<
134
135
136LIBRARY_SOURCES = \
137 yaz_zclient.c \
138 z3950proto.cpp \
139 z3950proxy.cpp \
140 zparse.tab.c \
141 zparse.yy.c
142
143LIBRARY_OBJECTS = \
144 yaz_zclient.o \
145 z3950proto.o \
146 z3950proxy.o \
147 zparse.tab.o \
148 zparse.yy.o
149
150LIBRARY = gsdlz3950.a
151
152SOURCES = \
153 z3950explain.cpp \
154 z3950parser.cpp \
155 z3950server.cpp \
156 z3950_to_gsdl.cpp
157
158OBJECTS = \
159 z3950explain.o \
160 z3950parser.o \
161 z3950server.o \
162 z3950_to_gsdl.o
163
164GSDL_LIBS = \
165 gsdlz3950.a \
166 $(PROTOCOL_DIR)/gsdlprotocol.a \
167 $(COLSERVR_DIR)/gsdlcolservr.a \
168 $(MG_INDEXERS_LIBS) \
169 $(MGPP_INDEXERS_LIBS) \
170 $(COMMON_DIR)/src/lib/gsdllib.a
171
172EXECUTABLE_OBJECTS = \
173 $(OBJECTS) \
174 $(GSDL_LIBS)
175
176EXECUTABLE = z3950server
177
178
179# Default target: make both gsdlz3950.a and the z3950server executable
180all: $(LIBRARY) $(EXECUTABLE)
181
182gsdlz3950.a: $(LIBRARY_OBJECTS)
183 rm -f $(LIBRARY)
184 $(AR) cru $(LIBRARY) $(LIBRARY_OBJECTS) $(RUNTIME_PACKAGES_DIR)/yaz/yaz-2.1.56/client/tabcomplete.o
185 $(RANLIB) $(LIBRARY)
186
187z3950server: $(EXECUTABLE_OBJECTS)
188 $(CPPLINK) $(EXECUTABLE_OBJECTS) $(LIBS)
189
190install: $(EXECUTABLE)
191 $(INSTALL) -m 755 -s $(EXECUTABLE) $(GSDL_DIR)/bin/$(GSDLOS)
192
193clean:
194 rm -f $(OBJECTS) $(LIBRARY) $(EXECUTABLE)
195
196depend:
197 makedepend -Y -- $(DEFS) $(INCLUDES) $(CPPFLAGS) -- $(SOURCES)
198
199else
200all:
201install:
202clean:
203depend:
204endif
205
206distclean: clean
207 rm -f Makefile
208
Note: See TracBrowser for help on using the repository browser.