source: gsdl/trunk/Makefile.in@ 18695

Last change on this file since 18695 was 18677, checked in by ak19, 15 years ago

Dr Bainbridge made some corrections and added the new targets configure-apache and configure-web.

  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 5.6 KB
Line 
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###########################################################################
26srcdir = @srcdir@
27
28PACKAGE = @PACKAGE@
29VERSION = @VERSION@
30
31@SET_MAKE@
32CC = @CC@
33CXX = @CXX@
34CFLAGS = @CFLAGS@
35CXXFLAGS = @CXXFLAGS@
36LIBS = @LIBS@
37MDEFINES =
38
39GSDLOS = @gsdlos@
40
41COMPILE = $(CC) -c
42
43SOURCES =
44
45OBJECTS =
46
47ALLFILES = $(OBJECTS)
48
49
50COMPILEDIRS = common-src build-src runtime-src
51
52INSTALLDIRS = common-src build-src runtime-src
53
54MODULEDIRS = @MODULEDIRS@
55
56
57# we don't want to compile the jni stuff in indexers for gs2
58all:
59 for odir in $(COMPILEDIRS) $(MODULEDIRS); do \
60 echo making $@ in $$odir; \
61 (cd $$odir && $(MAKE) $(MDEFINES) $@) || exit 1; \
62 done
63
64install: all
65 for idir in $(INSTALLDIRS); do \
66 echo installing $$idir; \
67 (cd $$idir && $(MAKE) install) || exit 1; \
68 done
69
70
71
72test-gsdlhome:
73 @ if test -z "${GSDLHOME}" ; then \
74 echo "" ; \
75 echo "Environment variable GSDLHOME not set." ; \
76 echo " This needs to be set to run this Makefile target." ; \
77 echo " Have you run 'source setup.bash'?" ; \
78 echo "" ; \
79 exit 1; \
80 else \
81 echo "Using: " ; \
82 echo " GSDLHOME = ${GSDLHOME}" ; \
83 echo " GSDLOS = ${GSDLOS}" ; \
84 fi
85
86configure-cgi: test-gsdlhome
87 @ echo "Configuring cgi-bin/gsdlsite.cfg" ;
88 @ sed "s@\*\*GSDLHOME\*\*@${GSDLHOME}@g" cgi-bin/gsdlsite.cfg.in > cgi-bin/gsdlsite.cfg ;
89
90
91
92configure-admin: test-gsdlhome
93 @echo "" ;
94 @echo "Configuring admin user password:" ;
95 encrypted_password=`getpw` ;
96 if [ $$? = "0" ] ; then \
97 echo -e "[admin]\n<enabled>true\n<groups>administrator,colbuilder,all-collections-editor\n<password>$$encrypted_password\n<username>admin" \
98 | txt2db -append "${GSDLHOME}/etc/users.db" ; \
99 fi
100 @echo ""
101
102configure-port: test-gsdlhome
103 @ echo "Enter port number to use:"
104 @ ( read port ; \
105 if test ! -z $$port ; then \
106 echo "Stopping web server (if running)" ; \
107 make web-stop-tested ; \
108 echo "Setting config file to use port $$port"; \
109 cat "${GSDLHOME}/apache-httpd/conf/httpd.conf.in" \
110 | sed "s@\*\*PORT\*\*@$$port@g" \
111 | sed "s@\*\*GSDLHOME\*\*@${GSDLHOME}@g" \
112 > "${GSDLHOME}/apache-httpd/conf/httpd.conf" ; \
113 echo "Type 'make web-start' to start the web server running on port $$port" ; \
114 fi ; \
115 echo "Done" ; )
116
117MONITOR_SUCCESS="MAKE SUCCESSFUL"
118MONITOR_FAILED="MAKE FAILED"
119MONITOR_FINISHED="MAKE DONE"
120
121configure-apache: test-gsdlhome
122 @ echo "Configuring the apache webserver..." ;
123 @ ( port=`egrep "^apache.port" lib/java/build.properties | awk -F= '{print $$2}'` ; \
124 echo $$port | make configure-port ; )
125 @ echo $(MONITOR_SUCCESS)
126 @ echo $(MONITOR_FINISHED)
127
128
129configure-web: configure-cgi configure-apache
130
131web-status: test-gsdlhome
132 ${GSDLHOME}/apache-httpd/${GSDLOS}/bin/apachectl status
133
134web-start: test-gsdlhome
135 ${GSDLHOME}/apache-httpd/${GSDLOS}/bin/apachectl start
136 @ echo $(MONITOR_SUCCESS)
137 @ echo $(MONITOR_FINISHED)
138
139web-restart: test-gsdlhome
140 ${GSDLHOME}/apache-httpd/${GSDLOS}/bin/apachectl restart
141 @ echo $(MONITOR_SUCCESS)
142 @ echo $(MONITOR_FINISHED)
143
144web-graceful: test-gsdlhome
145 ${GSDLHOME}/apache-httpd/${GSDLOS}/bin/apachectl graceful
146 @ echo $(MONITOR_SUCCESS)
147 @ echo $(MONITOR_FINISHED)
148
149web-stop-tested:
150 @# This version runs without testing for GSDLHOME
151 @# Useful to be run as a target when we know test-gsdlhome has already
152 @# been done. This avoids a unnecessary repetition of printing
153 @# out the values of GSDLHOME and GSDLOS
154 @ if test -e "${GSDLHOME}/apache-httpd/conf/httpd.conf" ; then \
155 ${GSDLHOME}/apache-httpd/${GSDLOS}/bin/apachectl stop ; \
156 fi
157 @ echo $(MONITOR_SUCCESS)
158 @ echo $(MONITOR_FINISHED)
159
160web-stop: test-gsdlhome web-stop-tested
161
162
163distclean: clean
164 rm -f Makefile config.cache config.h config.log stamp-h config.status
165 for subdir in $(COMPILEDIRS); do \
166 echo cleaning $@ in $$subdir; \
167 (cd $$subdir && $(MAKE) distclean) || exit 1; \
168 done
169
170clean:
171 for subdir in $(COMPILEDIRS); do \
172 echo cleaning $@ in $$subdir; \
173 (cd $$subdir && $(MAKE) clean) || exit 1; \
174 done
175
176# commented out - jrm21 Dec 2004 - can get confused by cvs timestamps
177# (and might run the wrong version of autoconf)
178#
179## For an explanation of the following Makefile rules, see node
180## `Automatic Remaking' in GNU Autoconf documentation.
181#Makefile: Makefile.in config.status
182# CONFIG_FILES=$@ CONFIG_HEADERS= ./config.status
183#config.status: configure
184# ./config.status --recheck
185#configure: configure.in aclocal.m4
186# cd $(srcdir) && autoconf
187#
188#config.h: stamp-h
189#stamp-h: config.h.in config.status
190# CONFIG_FILES= CONFIG_HEADERS=config.h ./config.status
191#config.h.in: stamp-h.in
192#stamp-h.in: configure.in aclocal.m4 acconfig.h
193# cd $(srcdir) && autoheader
194# $(TOUCH) $(srcdir)/stamp-h.in
195
196
197
Note: See TracBrowser for help on using the repository browser.