[16568] | 1 | ###########################################################################
|
---|
| 2 | #
|
---|
| 3 | # Makefile -- Makefile for packages included with Greenstone 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 |
|
---|
| 27 |
|
---|
| 28 | USE_Z3950=@USE_Z3950@
|
---|
| 29 | USE_YAZ=@USE_YAZ@
|
---|
[18483] | 30 | USE_APACHE_HTTPD=@USE_APACHE_HTTPD@
|
---|
[16568] | 31 |
|
---|
| 32 | ifeq ($(USE_Z3950), 1)
|
---|
| 33 | # make sure USE_YAZ is set
|
---|
| 34 | USE_YAZ=1
|
---|
| 35 | D2M=d2m
|
---|
| 36 | else
|
---|
| 37 | D2M=
|
---|
| 38 | endif
|
---|
| 39 |
|
---|
| 40 | ifeq ($(USE_YAZ), 1)
|
---|
| 41 | # we only compile the src and client dirs for now.
|
---|
| 42 | YAZ=yaz/yaz-2.1.4/src yaz/yaz-2.1.4/client
|
---|
| 43 | else
|
---|
| 44 | YAZ=
|
---|
| 45 | endif
|
---|
| 46 |
|
---|
| 47 |
|
---|
| 48 | USE_CORBA=@USE_CORBA@
|
---|
| 49 | MICO_DIR=@MICO_DIR@
|
---|
| 50 | ifeq ($(USE_CORBA), 1)
|
---|
| 51 | ifeq ($(MICO_DIR), default)
|
---|
| 52 | CORBA="mico/mico"
|
---|
| 53 | else
|
---|
| 54 | CORBA=
|
---|
| 55 | endif
|
---|
| 56 | else
|
---|
| 57 | CORBA=
|
---|
| 58 | endif
|
---|
| 59 |
|
---|
[18761] | 60 | GSDLOS = @gsdlos@
|
---|
[18483] | 61 |
|
---|
| 62 | ifeq ($(USE_APACHE_HTTPD), 1)
|
---|
| 63 | HTTPD=apache-httpd/httpd-2.2.11
|
---|
| 64 | else
|
---|
| 65 | HTTPD=
|
---|
| 66 | endif
|
---|
| 67 |
|
---|
| 68 |
|
---|
[16568] | 69 | # PACKAGEDIRS contains the packages that we want to make and install. It
|
---|
| 70 | # is assumed that each package will have at least four rules: all, install,
|
---|
| 71 | # clean, and distclean.
|
---|
[20890] | 72 | INSTALLDIRS = $(YAZ) $(D2M) $(CORBA)
|
---|
| 73 | PACKAGEDIRS = $(INSTALLDIRS) $(HTTPD)
|
---|
[16568] | 74 |
|
---|
[19036] | 75 | REPLACELIST = conf/extra/httpd-dav.conf \
|
---|
| 76 | conf/extra/httpd-manual.conf \
|
---|
| 77 | conf/extra/httpd-autoindex.conf \
|
---|
| 78 | conf/extra/httpd-vhosts.conf \
|
---|
| 79 | conf/extra/httpd-ssl.conf \
|
---|
| 80 | conf/extra/httpd-multilang-errordoc.conf \
|
---|
| 81 | conf/original/extra/httpd-dav.conf \
|
---|
| 82 | conf/original/extra/httpd-manual.conf \
|
---|
| 83 | conf/original/extra/httpd-autoindex.conf \
|
---|
| 84 | conf/original/extra/httpd-vhosts.conf \
|
---|
| 85 | conf/original/extra/httpd-ssl.conf \
|
---|
| 86 | conf/original/extra/httpd-multilang-errordoc.conf \
|
---|
| 87 | conf/original/httpd.conf\
|
---|
| 88 | lib/apr-util-1/apr_dbd_odbc.la \
|
---|
| 89 | lib/apr-util-1/apr_dbd_sqlite3.la \
|
---|
| 90 | lib/pkgconfig/apr-util-1.pc \
|
---|
| 91 | lib/pkgconfig/apr-1.pc \
|
---|
| 92 | lib/libaprutil-1.la \
|
---|
| 93 | lib/libapr-1.la \
|
---|
| 94 | build/config_vars.mk \
|
---|
| 95 | build/config.nice \
|
---|
| 96 | build/apr_rules.mk \
|
---|
[23981] | 97 | bin/dbmmanage \
|
---|
[19036] | 98 | bin/apu-1-config \
|
---|
| 99 | bin/apr-1-config \
|
---|
| 100 | include/ap_config_auto.h \
|
---|
| 101 | include/ap_config_layout.h
|
---|
[16568] | 102 |
|
---|
| 103 | all:
|
---|
| 104 | for odir in $(PACKAGEDIRS); do \
|
---|
| 105 | echo making $@ in $$odir; \
|
---|
| 106 | (cd $$odir && $(MAKE) $(MDEFINES) $@) || exit 1; \
|
---|
| 107 | done
|
---|
[19260] | 108 | ifeq ($(USE_APACHE_HTTPD), 1)
|
---|
[20836] | 109 | # Need to make install here, otherwise src/recpt won't be able
|
---|
| 110 | # to compile mod_gsdl.cpp with installed header files etc.
|
---|
[19260] | 111 | (cd $(HTTPD) && $(MAKE) $(MDEFINES) install) || exit
|
---|
| 112 | endif
|
---|
| 113 |
|
---|
[16568] | 114 | ifeq ($(CORBA), "mico/mico")
|
---|
| 115 | cd mico/mico; $(MAKE) $(MDEFINES) install
|
---|
| 116 | mkdir -p ../bin/linux
|
---|
| 117 | mkdir -p ../lib
|
---|
| 118 | mkdir -p ../include
|
---|
| 119 | mkdir -p ../man
|
---|
| 120 | cp -f mico/bin/* ../bin/linux
|
---|
| 121 | cp -f mico/lib/* ../lib/
|
---|
| 122 | cp -fr mico/include/* ../include
|
---|
| 123 | cp -fr mico/man ../man
|
---|
| 124 | endif
|
---|
| 125 | ifeq ($(USE_YAZ), 1)
|
---|
| 126 | # need to do make install in include and src dirs to get the header files and
|
---|
| 127 | # lib file into the right place
|
---|
| 128 | cd yaz/yaz-2.1.4/include; $(MAKE) $(MDEFINES) install
|
---|
| 129 | cd yaz/yaz-2.1.4/src; $(MAKE) $(MDEFINES) install
|
---|
| 130 | endif
|
---|
| 131 |
|
---|
[20890] | 132 | # now install everything except apache, since that had already been installed during "all"
|
---|
[16568] | 133 | install:
|
---|
[20894] | 134 | for idir in $(INSTALLDIRS); do \
|
---|
[16568] | 135 | echo installing $$idir; \
|
---|
| 136 | (cd $$idir && $(MAKE) install) || exit 1; \
|
---|
| 137 | done
|
---|
[18676] | 138 | ifeq ($(USE_APACHE_HTTPD), 1)
|
---|
[18826] | 139 | mkdir -p ../../apache-httpd/$(GSDLOS)/conf
|
---|
| 140 | cp -f apache-httpd/httpd.conf.in ../../apache-httpd/$(GSDLOS)/conf/.
|
---|
[18724] | 141 | mkdir -p ../../etc/logs-gsi
|
---|
[18721] | 142 | @ echo "*************** INFO ***************"
|
---|
| 143 | @ echo "Run: source setup.bash, to set up the environment for greenstone"
|
---|
[18681] | 144 | @ echo "Type: make configure-admin, to set the admin password"
|
---|
[24562] | 145 | @ echo "Edit: llssite.cfg files to change the port number if necessary"
|
---|
[18681] | 146 | @ echo "Type: make configure-web, to configure the included apache webserver"
|
---|
| 147 | @ echo "EITHER type: make web-start, to launch the webserver from the command-line"
|
---|
| 148 | @ echo "OR run: gs2-server.sh, to launch the GUI version of the included webserver"
|
---|
[18721] | 149 | @ echo "************************************"
|
---|
[18676] | 150 | endif
|
---|
[16568] | 151 |
|
---|
| 152 | clean:
|
---|
| 153 | for subdir in $(PACKAGEDIRS); do \
|
---|
| 154 | echo cleaning $@ in $$subdir; \
|
---|
| 155 | (cd $$subdir && $(MAKE) clean || exit 0) ; \
|
---|
| 156 | done
|
---|
| 157 |
|
---|
| 158 | distclean:
|
---|
[22068] | 159 | rm -f Makefile
|
---|
[20894] | 160 | for subdir in $(PACKAGEDIRS); do \
|
---|
[16568] | 161 | echo cleaning $@ in $$subdir; \
|
---|
| 162 | (cd $$subdir && $(MAKE) distclean || exit 0) ; \
|
---|
| 163 | done
|
---|
[18815] | 164 |
|
---|
| 165 | apache-for-dist:
|
---|
[18826] | 166 | ( httpddir=`cd ./apache-httpd/httpd* ; pwd` ; \
|
---|
| 167 | cp $$httpddir/support/apxs.in ../../apache-httpd/$(GSDLOS)/apxs.in ; \
|
---|
| 168 | cp apache-httpd/install-bindist.sh ../../apache-httpd/$(GSDLOS)/install-bindist.sh ; \
|
---|
| 169 | chmod 755 ../../apache-httpd/$(GSDLOS)/install-bindist.sh ; \
|
---|
| 170 | gsdldir=`cd ../.. ; pwd` ; \
|
---|
[19036] | 171 | pre="$$gsdldir/apache-httpd/$(GSDLOS)" ; \
|
---|
[18826] | 172 | for one_file in apachectl envvars envvars-std; do \
|
---|
[23935] | 173 | sed -e "s%$$pre%*\*\APACHE_HOME_OS\*\*%" "$$pre/bin/$$one_file" > "$$pre/bin/$$one_file.in" ; \
|
---|
| 174 | cp "$$pre/bin/$$one_file.in" "$$pre/bin/$$one_file" ; \
|
---|
[19036] | 175 | done ; \
|
---|
| 176 | for one_file in $(REPLACELIST); do \
|
---|
[23935] | 177 | sed -e "s%$$pre%*\*\APACHE_HOME_OS\*\*%" "$$pre/$$one_file" > "$$pre/$$one_file.in" ; \
|
---|
| 178 | cp "$$pre/$$one_file.in" "$$pre/$$one_file" ; \
|
---|
[19036] | 179 | done ; \
|
---|
| 180 | cat "$$pre/bin/apr-1-config" \
|
---|
| 181 | | sed -e "s%^APR_SOURCE_DIR=.*%APR_SOURCE_DIR=%" \
|
---|
| 182 | | sed -e "s%^APR_BUILD_DIR=.*%APR_BUILD_DIR=%" \
|
---|
[23935] | 183 | > "$$pre/bin/apr-1-config.in" ; \
|
---|
| 184 | cp "$$pre/bin/apr-1-config.in" "$$pre/bin/apr-1-config" ; \
|
---|
[19036] | 185 | cat "$$pre/bin/apu-1-config" \
|
---|
| 186 | | sed -e "s%^APU_SOURCE_DIR=.*%APU_SOURCE_DIR=%" \
|
---|
| 187 | | sed -e "s%^APU_BUILD_DIR=.*%APU_BUILD_DIR=%" \
|
---|
[23935] | 188 | > "$$pre/bin/apu-1-config.in" ; \
|
---|
| 189 | cp "$$pre/bin/apu-1-config.in" "$$pre/bin/apu-1-config" ; \
|
---|
| 190 | sed -e "s%^EXTRA_INCLUDES\s*=.*%EXTRA_INCLUDES=%" "$$pre/build/config_vars.mk" > "$$pre/build/config_vars.mk.in" ; \
|
---|
| 191 | cp "$$pre/build/config_vars.mk.in" "$$pre/build/config_vars.mk" ; ) |
---|