1 | ###########################################################################
|
---|
2 | #
|
---|
3 | # Makefile -- common code between gsdl runtime and buildtime
|
---|
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 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 | srcdir = @srcdir@
|
---|
27 |
|
---|
28 | PACKAGE = @PACKAGE@
|
---|
29 | VERSION = @VERSION@
|
---|
30 |
|
---|
31 | @SET_MAKE@
|
---|
32 | CC = @CC@
|
---|
33 | CXX = @CXX@
|
---|
34 | CFLAGS = @CFLAGS@
|
---|
35 | CXXFLAGS = @CXXFLAGS@
|
---|
36 | LIBS = @LIBS@
|
---|
37 | MDEFINES =
|
---|
38 |
|
---|
39 | GSDLOS = @gsdlos@
|
---|
40 | GSDLARCH = @gsdlarch@
|
---|
41 |
|
---|
42 | COMPILE = $(CC) -c $(CFLAGS)
|
---|
43 | CXXCOMPILE = $(CXX) -c $(CXXFLAGS)
|
---|
44 |
|
---|
45 | SOURCES =
|
---|
46 |
|
---|
47 | OBJECTS =
|
---|
48 |
|
---|
49 | ALLFILES = $(OBJECTS)
|
---|
50 |
|
---|
51 | # indexers are treated slightly differently as we don't want to do make all/install for gs2
|
---|
52 | INDEXERSDIR = indexers
|
---|
53 |
|
---|
54 | # all directories should be compiled
|
---|
55 | COMPILEDIRS = cgi-bin packages src/lib src/getpw
|
---|
56 |
|
---|
57 | # a subset of the directories get installed
|
---|
58 | INSTALLDIRS = cgi-bin packages src/getpw
|
---|
59 |
|
---|
60 |
|
---|
61 | USE_GDBM=@USE_GDBM@
|
---|
62 | ifeq ($(USE_GDBM), 1)
|
---|
63 | COMPILEDIRS += src/gdbmedit/txt2db src/gdbmedit/db2txt \
|
---|
64 | src/gdbmedit/gdbmget src/gdbmedit/gdbmset \
|
---|
65 | src/gdbmedit/gdbmkeys src/gdbmedit/gdbmdel
|
---|
66 | INSTALLDIRS += src/gdbmedit/db2txt src/gdbmedit/txt2db \
|
---|
67 | src/gdbmedit/gdbmget src/gdbmedit/gdbmset \
|
---|
68 | src/gdbmedit/gdbmkeys src/gdbmedit/gdbmdel
|
---|
69 | GDBM_DEFINES = -DUSE_GDBM
|
---|
70 | else
|
---|
71 | GDBM_DEFINES =
|
---|
72 | endif
|
---|
73 |
|
---|
74 | USE_JDBM=@USE_JDBM@
|
---|
75 | ifeq ($(USE_JDBM), 1)
|
---|
76 | COMPILEDIRS += src/jdbmedit
|
---|
77 | INSTALLDIRS += src/jdbmedit
|
---|
78 | JDBM_DEFINES = -DUSE_JDBM
|
---|
79 | else
|
---|
80 | JDBM_DEFINES =
|
---|
81 | endif
|
---|
82 |
|
---|
83 | USE_SQLITE = @USE_SQLITE@
|
---|
84 | ifeq ($(USE_SQLITE), 1)
|
---|
85 | SQLITE_DEFINES = -DUSE_SQLITE
|
---|
86 | else
|
---|
87 | SQLITE_DEFINES =
|
---|
88 | endif
|
---|
89 |
|
---|
90 | MODULEDIRS = @MODULEDIRS@
|
---|
91 | DEFS = @DEFS@ $(GDBM_DEFINES) $(JDBM_DEFINES) $(SQLITE_DEFINES)
|
---|
92 |
|
---|
93 | with-jni without-jni:
|
---|
94 | for odir in $(INDEXERSDIR); do \
|
---|
95 | echo making $@ in $$odir; \
|
---|
96 | (cd $$odir && $(MAKE) $(MDEFINES) $@) || exit 1; \
|
---|
97 | done
|
---|
98 | for odir in $(COMPILEDIRS) $(MODULEDIRS); do \
|
---|
99 | echo making all in $$odir; \
|
---|
100 | (cd $$odir && $(MAKE) $(MDEFINES) all) || exit 1; \
|
---|
101 | done
|
---|
102 |
|
---|
103 | install-with-jni:
|
---|
104 | for odir in $(INDEXERSDIR); do \
|
---|
105 | echo making $@ in $$odir; \
|
---|
106 | (cd $$odir && $(MAKE) $(MDEFINES) $@) || exit 1; \
|
---|
107 | done
|
---|
108 | if test -e $(INDEXERSDIR)/lucene-gs/LuceneWrapper.jar; then \
|
---|
109 | cp $(INDEXERSDIR)/lucene-gs/LuceneWrapper.jar ../bin/java/.; \
|
---|
110 | fi
|
---|
111 | for idir in $(INSTALLDIRS); do \
|
---|
112 | echo installing $$idir; \
|
---|
113 | (cd $$idir && $(MAKE) install) || exit 1; \
|
---|
114 | done
|
---|
115 |
|
---|
116 | install-without-jni:
|
---|
117 | for odir in $(INDEXERSDIR); do \
|
---|
118 | echo making $@ in $$odir; \
|
---|
119 | (cd $$odir && $(MAKE) $(MDEFINES) $@) || exit 1; \
|
---|
120 | done
|
---|
121 | if test -e $(INDEXERSDIR)/lucene-gs/LuceneWrapper.jar; then \
|
---|
122 | cp $(INDEXERSDIR)/lucene-gs/LuceneWrapper.jar ../bin/java/.; \
|
---|
123 | fi
|
---|
124 | for odir in $(COMPILEDIRS) $(MODULEDIRS); do \
|
---|
125 | echo making install in $$odir; \
|
---|
126 | (cd $$odir && $(MAKE) $(MDEFINES) install) || exit 1; \
|
---|
127 | done
|
---|
128 |
|
---|
129 | distclean: clean
|
---|
130 | rm -f Makefile config.cache config.h config.log stamp-h config.status
|
---|
131 | for subdir in $(COMPILEDIRS) $(INDEXERSDIR); do \
|
---|
132 | echo cleaning $@ in $$subdir; \
|
---|
133 | (cd $$subdir && $(MAKE) distclean) || exit 1; \
|
---|
134 | done
|
---|
135 |
|
---|
136 | clean:
|
---|
137 | for subdir in $(COMPILEDIRS) $(INDEXERSDIR); do \
|
---|
138 | echo cleaning $@ in $$subdir; \
|
---|
139 | (cd $$subdir && $(MAKE) clean) || exit 1; \
|
---|
140 | done
|
---|
141 |
|
---|
142 |
|
---|
143 | # commented out - jrm21 Dec 2004 - can get confused by cvs timestamps
|
---|
144 | # (and might run the wrong version of autoconf)
|
---|
145 | #
|
---|
146 | ## For an explanation of the following Makefile rules, see node
|
---|
147 | ## `Automatic Remaking' in GNU Autoconf documentation.
|
---|
148 | #Makefile: Makefile.in config.status
|
---|
149 | # CONFIG_FILES=$@ CONFIG_HEADERS= ./config.status
|
---|
150 | #config.status: configure
|
---|
151 | # ./config.status --recheck
|
---|
152 | #configure: configure.in aclocal.m4
|
---|
153 | # cd $(srcdir) && autoconf
|
---|
154 | #
|
---|
155 | #config.h: stamp-h
|
---|
156 | #stamp-h: config.h.in config.status
|
---|
157 | # CONFIG_FILES= CONFIG_HEADERS=config.h ./config.status
|
---|
158 | #config.h.in: stamp-h.in
|
---|
159 | #stamp-h.in: configure.in aclocal.m4 acconfig.h
|
---|
160 | # cd $(srcdir) && autoheader
|
---|
161 | # $(TOUCH) $(srcdir)/stamp-h.in
|
---|
162 |
|
---|
163 |
|
---|
164 |
|
---|