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