[16566] | 1 | ###########################################################################
|
---|
| 2 | #
|
---|
| 3 | # Makefile -- Makefile for packages shared between Greenstone build and runtime
|
---|
| 4 | #
|
---|
| 5 | # A component of the Greenstone digital library software
|
---|
| 6 | # from the New Zealand Digital Library Project at the
|
---|
| 7 | # University of Waikato, New Zealand.
|
---|
| 8 | #
|
---|
| 9 | # Copyright (C) 2000 New Zealand Digital Library Project
|
---|
| 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 |
|
---|
[22058] | 27 | USE_GDBM=@USE_GDBM@
|
---|
| 28 | ifeq ($(USE_GDBM), 1)
|
---|
| 29 | GDBM_DEFINES = -DUSE_GDBM
|
---|
| 30 | else
|
---|
| 31 | GDBM_DEFINES =
|
---|
| 32 | endif
|
---|
[16566] | 33 |
|
---|
[22058] | 34 | USE_JDBM=@USE_JDBM@
|
---|
| 35 | ifeq ($(USE_JDBM), 1)
|
---|
[21409] | 36 | JDBM_DIR = jdbm/jdbm-1.0
|
---|
[22058] | 37 | JDBM_DEFINES = -DUSE_JDBM
|
---|
[21409] | 38 | else
|
---|
[22058] | 39 | JDBM_DIR =
|
---|
| 40 | JDBM_DEFINES =
|
---|
[21409] | 41 | endif
|
---|
| 42 |
|
---|
[16566] | 43 | USE_SQLITE=@USE_SQLITE@
|
---|
| 44 | ifeq ($(USE_SQLITE), 1)
|
---|
[21869] | 45 | SQLITE_DIR = sqlite/sqlite-amalgamation-3.6.23.1
|
---|
[22058] | 46 | SQLITE_DEFINES = -DUSE_SQLITE
|
---|
[16566] | 47 | else
|
---|
| 48 | SQLITE_DIR =
|
---|
[22058] | 49 | SQLITE_DEFINES =
|
---|
[16566] | 50 | endif
|
---|
| 51 |
|
---|
[22058] | 52 | DEFS = @DEFS@ $(GDBM_DEFINES) $(JDBM_DEFINES) $(SQLITE_DEFINES)
|
---|
| 53 |
|
---|
[20832] | 54 | # COMPILEDIRS contains the packages that we want to make and install. It
|
---|
[16566] | 55 | # is assumed that each package will have at least four rules: all, install,
|
---|
| 56 | # clean, and distclean.
|
---|
[20832] | 57 | # CLEANDIRS is COMPILEDIRS and iconv and expat. Iconv and expat get compiled
|
---|
| 58 | # up during the configure stage itself.
|
---|
[21409] | 59 | COMPILEDIRS = gdbm $(SQLITE_DIR) $(JDBM_DIR) search4j
|
---|
[20832] | 60 | CLEANDIRS = iconv expat $(COMPILEDIRS)
|
---|
[16566] | 61 |
|
---|
| 62 |
|
---|
| 63 | all:
|
---|
[20832] | 64 | for odir in $(COMPILEDIRS); do \
|
---|
[16566] | 65 | echo making $@ in $$odir; \
|
---|
| 66 | (cd $$odir && $(MAKE) $(MDEFINES) $@) || exit 1; \
|
---|
| 67 | done
|
---|
[22058] | 68 | ifeq ($(USE_JDBM), 1)
|
---|
[21409] | 69 | # do 'make install' in jdbm directory to get the jar file into the right place
|
---|
| 70 | cd $(JDBM_DIR) && $(MAKE) $(MDEFINES) install
|
---|
| 71 | endif
|
---|
[16566] | 72 | ifeq ($(USE_SQLITE), 1)
|
---|
| 73 | # need to do make install in sqlite to get the header files and library into the right place
|
---|
| 74 | cd $(SQLITE_DIR) && $(MAKE) $(MDEFINES) install
|
---|
| 75 | endif
|
---|
| 76 |
|
---|
| 77 |
|
---|
| 78 | install:
|
---|
[20832] | 79 | for idir in $(COMPILEDIRS); do \
|
---|
[16566] | 80 | echo installing $$idir; \
|
---|
| 81 | (cd $$idir && $(MAKE) install) || exit 1; \
|
---|
| 82 | done
|
---|
| 83 |
|
---|
| 84 | clean:
|
---|
[20832] | 85 | for subdir in $(COMPILEDIRS); do \
|
---|
[16566] | 86 | echo cleaning $@ in $$subdir; \
|
---|
| 87 | (cd $$subdir && $(MAKE) clean || exit 0) ; \
|
---|
| 88 | done
|
---|
| 89 |
|
---|
| 90 | distclean:
|
---|
[20832] | 91 | for subdir in $(CLEANDIRS); do \
|
---|
[16566] | 92 | echo cleaning $@ in $$subdir; \
|
---|
| 93 | (cd $$subdir && $(MAKE) distclean || exit 0) ; \
|
---|
| 94 | done
|
---|
[21423] | 95 | (cd iconv && /bin/rm -rf bin include lib share)
|
---|