[559] | 1 | ###########################################################################
|
---|
| 2 | #
|
---|
| 3 | # Makefile -- gsdl
|
---|
| 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 | ###########################################################################
|
---|
[1935] | 26 | srcdir = @srcdir@
|
---|
[559] | 27 |
|
---|
[552] | 28 | PACKAGE = @PACKAGE@
|
---|
| 29 | VERSION = @VERSION@
|
---|
| 30 |
|
---|
| 31 | @SET_MAKE@
|
---|
| 32 | CC = @CC@
|
---|
[2963] | 33 | CXX = @CXX@
|
---|
[552] | 34 | CFLAGS = @CFLAGS@
|
---|
[2963] | 35 | CXXFLAGS = @CXXFLAGS@
|
---|
[552] | 36 | LIBS = @LIBS@
|
---|
[555] | 37 | MDEFINES =
|
---|
[552] | 38 |
|
---|
[704] | 39 | GSDLOS = @gsdlos@
|
---|
| 40 |
|
---|
[552] | 41 | COMPILE = $(CC) -c
|
---|
| 42 |
|
---|
[555] | 43 | SOURCES =
|
---|
[552] | 44 |
|
---|
[555] | 45 | OBJECTS =
|
---|
[552] | 46 |
|
---|
| 47 | ALLFILES = $(OBJECTS)
|
---|
| 48 |
|
---|
[18802] | 49 | SPECIAL_COMPILEDIRS = common-src
|
---|
| 50 | COMPILEDIRS = build-src runtime-src
|
---|
[552] | 51 |
|
---|
[18802] | 52 | SPECIAL_INSTALLDIRS = common-src
|
---|
| 53 | INSTALLDIRS = build-src runtime-src
|
---|
[16563] | 54 |
|
---|
[3064] | 55 | MODULEDIRS = @MODULEDIRS@
|
---|
| 56 |
|
---|
[21366] | 57 | ENABLE_JNI=@ENABLE_JNI@
|
---|
| 58 | ifeq ($(ENABLE_JNI), 1)
|
---|
| 59 | COMPILE_TARGET=with-jni
|
---|
| 60 | else
|
---|
| 61 | COMPILE_TARGET=without-jni
|
---|
| 62 | endif
|
---|
[559] | 63 |
|
---|
[21366] | 64 |
|
---|
| 65 | # with some compilers, just calling another target is insufficient
|
---|
| 66 | # so an extra echo stmt is added after each call to another target
|
---|
| 67 | all: $(COMPILE_TARGET)
|
---|
| 68 | @echo "Compile done"
|
---|
| 69 |
|
---|
[21888] | 70 | # Upon installing, on Linux and Mac need to copy the libiconv library files
|
---|
| 71 | # into apache's lib folder since apache needs the libiconv when running.
|
---|
| 72 | # This is particularly necessary for the release version since its common-src
|
---|
| 73 | # folder (and the libiconv libraries this contains) are not included.
|
---|
| 74 | # If ever the libiconv is used by more than apache, copy libiconv into GS2's lib
|
---|
| 75 | # folder rather than into apache lib folder.
|
---|
[21366] | 76 | install: install-$(COMPILE_TARGET)
|
---|
[21888] | 77 | if test -d apache-httpd; then \
|
---|
[21891] | 78 | cp -r common-src/packages/iconv/lib/lib* apache-httpd/$(GSDLOS)/lib/.; \
|
---|
[21888] | 79 | fi;
|
---|
[21366] | 80 | @echo "Install done"
|
---|
| 81 |
|
---|
| 82 |
|
---|
| 83 | with-jni without-jni:
|
---|
[18802] | 84 | for odir in $(SPECIAL_COMPILEDIRS); do \
|
---|
[21366] | 85 | if test -d $$odir; then \
|
---|
| 86 | echo making $(COMPILE_TARGET) in $$odir; \
|
---|
| 87 | (cd $$odir && $(MAKE) $(MDEFINES) $(COMPILE_TARGET)) || exit 1; \
|
---|
| 88 | fi; \
|
---|
[18802] | 89 | done
|
---|
[13777] | 90 | for odir in $(COMPILEDIRS) $(MODULEDIRS); do \
|
---|
[21366] | 91 | if test -d $$odir; then \
|
---|
| 92 | echo making all in $$odir; \
|
---|
| 93 | (cd $$odir && $(MAKE) $(MDEFINES) all) || exit 1; \
|
---|
| 94 | fi; \
|
---|
[552] | 95 | done
|
---|
| 96 |
|
---|
[21366] | 97 | install-with-jni install-without-jni: all
|
---|
[18802] | 98 | for idir in $(SPECIAL_INSTALLDIRS); do \
|
---|
[21366] | 99 | if test -d $$idir; then \
|
---|
| 100 | echo installing $$idir $(COMPILE_TARGET); \
|
---|
| 101 | (cd $$idir && $(MAKE) install-$(COMPILE_TARGET)) || exit 1; \
|
---|
| 102 | fi; \
|
---|
[18802] | 103 | done
|
---|
[559] | 104 | for idir in $(INSTALLDIRS); do \
|
---|
[21366] | 105 | if test -d $$idir; then \
|
---|
| 106 | echo installing $$idir; \
|
---|
| 107 | (cd $$idir && $(MAKE) install) || exit 1; \
|
---|
| 108 | fi; \
|
---|
[559] | 109 | done
|
---|
| 110 |
|
---|
[18825] | 111 | apache-for-dist:
|
---|
[21366] | 112 | if test -d runtime-src; then \
|
---|
| 113 | (cd runtime-src/packages && $(MAKE) apache-for-dist) || exit 1; \
|
---|
| 114 | fi
|
---|
[18825] | 115 |
|
---|
[2589] | 116 | distclean: clean
|
---|
[1078] | 117 | rm -f Makefile config.cache config.h config.log stamp-h config.status
|
---|
[19262] | 118 | for subdir in $(SPECIAL_COMPILEDIRS) $(COMPILEDIRS); do \
|
---|
[21366] | 119 | if test -d $$subdir; then \
|
---|
| 120 | echo cleaning $@ in $$subdir; \
|
---|
| 121 | (cd $$subdir && $(MAKE) distclean) || exit 1; \
|
---|
| 122 | fi; \
|
---|
[992] | 123 | done
|
---|
| 124 |
|
---|
| 125 | clean:
|
---|
[19262] | 126 | for subdir in $(SPECIAL_COMPILEDIRS) $(COMPILEDIRS); do \
|
---|
[21366] | 127 | if test -d $$subdir; then \
|
---|
| 128 | echo cleaning $@ in $$subdir; \
|
---|
| 129 | (cd $$subdir && $(MAKE) clean) || exit 1; \
|
---|
| 130 | fi; \
|
---|
[555] | 131 | done
|
---|
| 132 |
|
---|
[8769] | 133 | # commented out - jrm21 Dec 2004 - can get confused by cvs timestamps
|
---|
| 134 | # (and might run the wrong version of autoconf)
|
---|
| 135 | #
|
---|
| 136 | ## For an explanation of the following Makefile rules, see node
|
---|
| 137 | ## `Automatic Remaking' in GNU Autoconf documentation.
|
---|
| 138 | #Makefile: Makefile.in config.status
|
---|
| 139 | # CONFIG_FILES=$@ CONFIG_HEADERS= ./config.status
|
---|
| 140 | #config.status: configure
|
---|
| 141 | # ./config.status --recheck
|
---|
| 142 | #configure: configure.in aclocal.m4
|
---|
| 143 | # cd $(srcdir) && autoconf
|
---|
| 144 | #
|
---|
| 145 | #config.h: stamp-h
|
---|
| 146 | #stamp-h: config.h.in config.status
|
---|
| 147 | # CONFIG_FILES= CONFIG_HEADERS=config.h ./config.status
|
---|
| 148 | #config.h.in: stamp-h.in
|
---|
| 149 | #stamp-h.in: configure.in aclocal.m4 acconfig.h
|
---|
| 150 | # cd $(srcdir) && autoheader
|
---|
| 151 | # $(TOUCH) $(srcdir)/stamp-h.in
|
---|
[555] | 152 |
|
---|
| 153 |
|
---|
[691] | 154 |
|
---|