source: gsdl/trunk/src/z3950/Makefile.in@ 15579

Last change on this file since 15579 was 15579, checked in by mdewsnip, 16 years ago

More tidy ups to all the Makefiles, this time to tidy up the targets and add comments about the default target.

File size: 3.7 KB
Line 
1###########################################################################
2#
3# Makefile -- 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 = ../..
28INDEXERS_DIR = $(GSDL_DIR)/indexers
29PACKAGES_DIR = $(GSDL_DIR)/packages
30COLSERVR_DIR = $(GSDL_DIR)/src/colservr
31PROTOCOL_DIR = $(GSDL_DIR)/src/protocol
32
33
34ENABLE_ACCENTFOLD = @ENABLE_ACCENTFOLD@
35ifeq ($(ENABLE_ACCENTFOLD), 1)
36ACCENTFOLD_LIBS = $(INDEXERS_DIR)/packages/unac/libunac.a
37else
38ACCENTFOLD_LIBS =
39endif
40
41USE_Z3950 = @USE_Z3950@
42ifeq ($(USE_Z3950), 1)
43AR = ar
44CC = @CC@
45CPP = @CXX@
46CFLAGS = @CFLAGS@
47CPPFLAGS = @CXXFLAGS@
48DEFS = @DEFS@ -DNZDL -DQUIET -DSHORT_SUFFIX -DPARADOCNUM -DGSDLSERVER
49GSDLOS = @gsdlos@
50# Do NOT add the "recpt" directory here: the z39.50 code should be independent of the receptionist!
51INCLUDES = -I. -I$(GSDL_DIR) -I$(GSDL_DIR)/lib -I$(COLSERVR_DIR) -I$(PROTOCOL_DIR) \
52 -I$(INDEXERS_DIR)/mgpp/text -I$(PACKAGES_DIR)/yaz/yaz-2.1.4/include \
53 -I$(PACKAGES_DIR)/yaz/yaz-2.1.4/client -I$(PACKAGES_DIR)/d2m
54INSTALL = @INSTALL@
55LDFLAGS = @LDFLAGS@
56LIBS = @LIBS@ @GDBM_LIBPATH@ -lgdbm -L$(PACKAGES_DIR)/expat/lib -lexpat $(ACCENTFOLD_LIBS) \
57 $(PACKAGES_DIR)/yaz/lib/libyaz.a $(PACKAGES_DIR)/d2m/libd2m.a -lxml2
58RANLIB = @RANLIB@
59
60
61COMPILE = $(CC) -c $(CFLAGS) $(DEFS) $(INCLUDES)
62CPPCOMPILE = $(CPP) -c $(CPPFLAGS) $(DEFS) $(INCLUDES)
63CPPLINK = $(CPP) $(LDFLAGS) -o $@
64
65
66.SUFFIXES:
67.SUFFIXES: .c .o
68.c.o:
69 $(COMPILE) $<
70
71.SUFFIXES: .cpp .o
72.cpp.o:
73 $(CPPCOMPILE) $<
74
75
76LIBRARY_SOURCES = \
77 yaz_zclient.c \
78 z3950proto.cpp \
79 z3950proxy.cpp \
80 zparse.tab.c \
81 zparse.yy.c
82
83LIBRARY_OBJECTS = \
84 yaz_zclient.o \
85 z3950proto.o \
86 z3950proxy.o \
87 zparse.tab.o \
88 zparse.yy.o
89
90LIBRARY = gsdlz3950.a
91
92SOURCES = \
93 z3950explain.cpp \
94 z3950parser.cpp \
95 z3950server.cpp \
96 z3950_to_gsdl.cpp
97
98OBJECTS = \
99 z3950explain.o \
100 z3950parser.o \
101 z3950server.o \
102 z3950_to_gsdl.o
103
104GSDL_LIBS = \
105 gsdlz3950.a \
106 $(PROTOCOL_DIR)/gsdlprotocol.a \
107 $(COLSERVR_DIR)/gsdlcolservr.a \
108 $(INDEXERS_DIR)/mg/src/text/libmgtext.a \
109 $(INDEXERS_DIR)/mg/lib/libmglib.a \
110 $(INDEXERS_DIR)/mgpp/text/libmgpptext.a \
111 $(INDEXERS_DIR)/mgpp/lib/libmgpplib.a \
112 $(GSDL_DIR)/lib/gsdllib.a
113
114EXECUTABLE_OBJECTS = \
115 $(OBJECTS) \
116 $(GSDL_LIBS)
117
118EXECUTABLE = z3950server
119
120
121# Default target: make both gsdlz3950.a and the z3950server executable
122all: $(LIBRARY) $(EXECUTABLE)
123
124gsdlz3950.a: $(LIBRARY_OBJECTS)
125 rm -f $(LIBRARY)
126 $(AR) cru $(LIBRARY) $(LIBRARY_OBJECTS) $(PACKAGES_DIR)/yaz/yaz-2.1.4/client/tabcomplete.o
127 $(RANLIB) $(LIBRARY)
128
129z3950server: $(EXECUTABLE_OBJECTS)
130 $(CPPLINK) $(EXECUTABLE_OBJECTS) $(LIBS)
131
132install: $(EXECUTABLE)
133 $(INSTALL) -m 755 -s $(EXECUTABLE) $(GSDL_DIR)/bin/$(GSDLOS)
134
135clean:
136 rm -f $(OBJECTS) $(LIBRARY) $(EXECUTABLE)
137
138distclean:
139 rm -f $(OBJECTS) $(LIBRARY) $(EXECUTABLE) Makefile
140
141depend:
142 makedepend -Y -- $(DEFS) $(INCLUDES) $(CPPFLAGS) -- $(SOURCES)
143
144else
145all:
146install:
147clean:
148distclean:
149depend:
150endif
Note: See TracBrowser for help on using the repository browser.