head	1.23;
access;
symbols
	JSERV_0_10_PREVIEW:1.22.0.2
	JSERV_0_9_11:1.20.0.4
	JSERV_0_9_12:1.20.0.2
	JSERV0_9_10:1.19
	JSERV0_9_10_DEV_199802091315:1.15
	JSERV_00_09_09:1.9;
locks; strict;
comment	@# @;


1.23
date	98.12.21.05.23.21;	author ed;	state dead;
branches;
next	1.22;

1.22
date	98.05.11.17.25.36;	author ross;	state Exp;
branches;
next	1.21;

1.21
date	98.05.10.18.31.11;	author ed;	state Exp;
branches;
next	1.20;

1.20
date	98.03.02.20.20.07;	author tim;	state Exp;
branches
	1.20.2.1;
next	1.19;

1.19
date	98.02.12.07.48.11;	author ian;	state Exp;
branches;
next	1.18;

1.18
date	98.02.11.23.46.02;	author francis;	state Exp;
branches;
next	1.17;

1.17
date	98.02.11.04.58.09;	author ian;	state Exp;
branches;
next	1.16;

1.16
date	98.02.10.00.34.33;	author francis;	state Exp;
branches;
next	1.15;

1.15
date	98.02.08.09.08.41;	author ian;	state Exp;
branches;
next	1.14;

1.14
date	98.01.25.12.12.27;	author ian;	state Exp;
branches;
next	1.13;

1.13
date	98.01.25.12.10.29;	author ian;	state Exp;
branches;
next	1.12;

1.12
date	98.01.23.23.31.50;	author zeng;	state Exp;
branches;
next	1.11;

1.11
date	98.01.23.22.55.13;	author zeng;	state Exp;
branches;
next	1.10;

1.10
date	98.01.22.23.51.26;	author zeng;	state Exp;
branches;
next	1.9;

1.9
date	98.01.20.19.32.56;	author jonbolt;	state Exp;
branches;
next	1.8;

1.8
date	98.01.20.08.06.31;	author jonbolt;	state Exp;
branches;
next	1.7;

1.7
date	98.01.20.07.00.48;	author jonbolt;	state Exp;
branches;
next	1.6;

1.6
date	98.01.20.05.07.30;	author ian;	state Exp;
branches;
next	1.5;

1.5
date	98.01.20.03.26.41;	author ian;	state Exp;
branches;
next	1.4;

1.4
date	98.01.17.09.55.05;	author ian;	state Exp;
branches;
next	1.3;

1.3
date	98.01.17.04.56.12;	author francis;	state Exp;
branches;
next	1.2;

1.2
date	98.01.17.04.55.11;	author francis;	state Exp;
branches;
next	1.1;

1.1
date	98.01.17.03.05.50;	author francis;	state Exp;
branches;
next	;

1.20.2.1
date	98.05.07.10.36.56;	author ross;	state Exp;
branches;
next	;


desc
@@


1.23
log
@set CHANGES and INSTALL back to the 0.9.11 versions; remove the contents
of the doc/ directory (they mostly concern 0.10, not 0.9.x).
@
text
@############ START of System Configuration ###############

###### Installation Tree
## General installation tree
PREFIX=/usr/local/java-lib/jserv

## Where is the site CLASSPATH
CLASSES_DIR=$(PREFIX)/classes

## Where the supporting library, i.e. Sun's classes in this case
## will be installed
LIBRARY_DIR=$(PREFIX)/lib

## Where servlets should be installed
## This must be the same as the ServletAlias directory defined
## in your Apache server configuration file.
SERVLETS_DIR=$(PREFIX)/servlets

## Where are Java wrapper executable
BIN_DIR=$(PREFIX)/bin

## Where site documentation is stored.
DOC_DIR=$(PREFIX)/api

## If you want to set the classpath manually, uncoment next line
## and make sure that it includes the jdk and jsdk classes
#CLASSPATH=/usr/local/java-lib/JSDK1.0.1/lib/classes.zip:/usr/local/jdk/lib/classes.zip

##### Program Configuration
JAVAC=javac
JCFLAGS=-deprecation
OPTIM=-O
JAVACC=javacc
JCCFLAGS=
JJTREE=jjtree
JTTFLAGS=
JAVADOC=javadoc
JDFLAGS=-author -version #-noindex -notree
ZIP=zip

## Solaris: Make sure your path is using /usr/ucb/install
INSTALL=install

### END of System configuration ####

################## Start of Package Configuration ###########
## This is where the Application Developper 
## configures the the dependencies required to build the 
## package.

## To comply with JLS this should be the reverse FQDN  
## of the organization responsiable for the package.
PACKAGE_PREFIX := org.apache

## This is the top package that contains all others.
PACKAGE := jserv

## A list of subpackages.
SUB_PACKAGES := test
#SUB_PACKAGES := test servlets

###### Classes Configuration
## List of classes to compile. You can only list the classes that aren't 
## referenced from anywhere for javac compiles automatically depending
## classes.
CLASSES=JServConnection.class JServServletManager.class JServ.class   \
	JServClassLoader.class JServContext.class JServLock.class \
	JServSendError.class JServUtils.class JServSignals.class \
	JServDebug.class JServSession.class SGMLTag.class \
	BadClassTest.class ClassLoaderTest.class ServletMonitor.class \
	LoadClassTest.class

## Classes that are servlets and that shouldn't be installed in
## in the classpath.
SERVLETS= JServSSI.class EnvDumpServlet.class GodotServlet.class

###### Resource Configuration
## List of resource files that should be installed in the 
## classpath.
RESOURCES=

###### Templates configuration
## The name of the templates package
TEMPLATES_NAME=

## List of resource files that should be installed with 
## the servlet.
SERVLET_RESOURCES=

##### Classes library configuration
## A colon separated list of classes library that should be
## included in the compile
LIBRARY = servclasses.zip

###### Grammar Configuration
## List source files that are generated by JavaCC
PARSER=

## List grammar file that are generated by JJTree
GRAMMARS=

###### Distribution Configuration
## If this variable is set, it will produce a zip file containing all
## the classes. This file can be placed in a classpath.
CLASSES_ZIP=

## If this variable is set, it will produce a zip containing all
## the servlets. This file could then be in a servlet repository.
SERVLET_ZIP=

## Name of the Tar file distribution to make.
TAR_DIST=$(PACKAGE).tar.gz

## Name of the Zip file distribution to make.
ZIP_DIST=$(PACKAGE).zip

###### Scripts Configuration
## List of script that wraps around java exectuable classes.
SCRIPTS=

############# END of Package configuration #######################

## Set required flags on compilers.
ifneq "$(strip $(SERVLETS))" ""
JCFLAGS += -classpath servlets:src:$(LIBRARY):$(CLASSPATH)
JDFLAGS += -d doc -classpath classes:servlets:src:$(LIBRARY):$(CLASSPATH)
else
JCFLAGS += $(OPTIM) -classpath src:$(LIBRARY):$(CLASSPATH)
JDFLAGS += -d doc -classpath classes:src:$(LIBRARY):$(CLASSPATH)
endif

## Compute the FQDN of all included packages.
ifneq "$(strip $(PACKAGE_PREFIX) )" ""
  fqdn = $(PACKAGE_PREFIX).$(PACKAGE)
else
  fqdn = $(PACKAGE)
endif

fqdn_name = $(fqdn).$(package)
fqdn_packages := $(fqdn) $(foreach package,$(SUB_PACKAGES),$(fqdn_name))

## Compute the path of all package relative to classes/ and src/
packages_path := $(foreach path,$(fqdn_packages),$(subst .,/,$(path)))

## Compute the list of directory to search
ifneq "$(strip $(SERVLETS))" ""
VPATH := $(addprefix src/,$(packages_path)) \
	 $(addprefix classes/,$(packages_path)) \
	 $(addprefix servlets/,$(packages_path)) \
	bin
else
VPATH := $(addprefix src/,$(packages_path)) \
	 $(addprefix classes/,$(packages_path)) \
	bin
endif 

## Function that find various files
compiled_classes=$(subst $$,\$$,$(shell find classes -name \*.class -print))

resources=$(subst $$,\$$,$(shell find classes -name \*.properties -print))

javadoc_files=$(subst $$,\$$,$(shell find doc -name \*$(fqdn)\*.html -print)) \
	$(shell find doc -name packages.html -o -name Index.html -o \
		-name tree.html -o -name AllNames.html -print)

template_files=$(shell find templates -name \*tmpl -print)

installed_doc=$(subst $$,\$$,$(shell find $(DOC_DIR) -name \*$(fqdn)\*.html -print)) \
	$(shell find $(DOC_DIR) -name packages.html -o -name Index.html -o \
		-name tree.html -o -name AllNames.html -print)

source_files=$(subst $$,\$$,$(shell find src -path CVS -prune -o -print) ) 

everything=$(subst $$,\$$,$(shell find . -name CVS -prune -o -print) ) 

ifneq "$(strip $(SERVLETS))" ""
compiled_servlets=$(subst $$,\$$,$(shell find servlets -name \*.class -print))

servlet_resources=$(subst $$,\$$,$(shell find servlets -name \*.properties -print))

SERVLETS_DEP=$(SERVLETS) $(SERVLETS_ZIP) $(SERVLET_RESOURCES)
else 
SERVLETS_DEP=
endif

## Name of the working directory
dir_name := $(notdir $(shell pwd))

## Start of rules.
all :	classes servlets $(CLASSES) $(RESOURCES) $(CLASSES_ZIP) $(SERVLETS_DEP) mod-jserv

classes :
	mkdir classes

servlets:
ifneq ($(strip $(SERVLETS_DEP)),)
	mkdir servlets
endif

mod-jserv : 
	@@echo "To make mod_jserv, copy mod_jserv.c to your Apache src "
	@@echo "directory. Add the following line to the Configuration file"
	@@echo
	@@echo "Module jserv_module mod_jserv.o"
	@@echo
	@@echo "Run Configure to create a new Makefile, then recompile Apache."

## Generic rule to make everything
$(CLASSES) : %.class : %.java
	$(JAVAC) $(JCFLAGS) -d classes $<

$(SERVLETS) : %.class : %.java
	$(JAVAC) $(JCFLAGS) -d servlets $<

$(PARSER) : %.java : %.jj
	cd $(dir $<); $(JAVACC) $(JCCFLAG) $(notdir $<)

$(GRAMMARS) : %.jj : %.jjt
	cd $(dir $<); $(JJTREE) $(JTTFLAGS) $(notdir $<)

$(RESOURCES) : %.properties : %.rsrc
	$(INSTALL) -d classes/`expr $(dir $<) : 'src/\(.*\)'`
	$(INSTALL) $< classes/`expr $(dir $<) : 'src/\(.*\)'`$(notdir $(basename $<)).properties

$(SERVLET_RESOURCES) : %.properties : %.rsrc
	$(INSTALL) -d servlets/`expr $(dir $<) : 'src/\(.*\)'`
	$(INSTALL) $< servlets/`expr $(dir $<) : 'src/\(.*\)'`$(notdir $(basename $<)).properties

$(SERVLETS_ZIP) : $(SERVLETS) $(SERVLET_RESOURCES)
	cd servlets; zip -0 ../bin/$(@@F) \
	$(foreach file,$(compiled_servlets) $(SERVLET_RESOURCES),\
		$(patsubst servlets/%, %, $(file)))

$(CLASSES_ZIP) : $(CLASSES) $(RESOURCES)
	cd classes; zip -0 ../bin/$(@@F) \
	$(foreach file,$(compiled_classes) $(RESOURCES),\
		$(patsubst classes/%, %, $(file)))

.PHONY: doc \
	dist dist-clean dist-tar dist-zip \
	install install-doc install-classes install-servlets \
	install-lib install-templates install-zip \
	uninstall clean

## Creates JavaDoc documentation
doc:
	if [ ! -d doc ]; then mkdir doc; fi
	$(JAVADOC) $(JDFLAGS) $(fqdn_packages)

## Install classes in site classpath
install: all install-bin install-doc install-classes \
	install-servlets install-templates install-lib

install-bin: $(SCRIPTS) $(CLASSES_ZIP)
ifneq "$(strip $(SCRIPTS))" ""
	[ -d $(BIN_DIR) ] || mkdir $(BIN_DIR)
	$(INSTALL) $^ $(BIN_DIR)
else
	@@echo Nothing to be done for bin
endif
ifneq "$(strip $(CLASSES_ZIP))" ""
	[ -d $(BIN_DIR) ] || mkdir $(BIN_DIR)
	$(INSTALL) -m 644 $^ $(BIN_DIR)
endif

install-classes: $(CLASSES)
ifneq "$(strip $(CLASSES))" ""
	[ -d $(CLASSES_DIR) ] || mkdir $(CLASSES_DIR)
	for p in $(packages_path); do \
		tmpdir=$(CLASSES_DIR); \
		for i in `echo $$p | sed 's/\// /g'`; \
		do \
			tmpdir=$$tmpdir/$$i; \
			[ -d $$tmpdir ] || mkdir $$tmpdir || exit $$?; \
		done; \
		$(INSTALL) -d $(CLASSES_DIR)/$$p; \
	done
	for f in $(compiled_classes) $(resources); do\
		d=`dirname $$f`;\
		cdir=`expr $$d : 'classes/\(.*\)'`; \
		tmpdir=$(CLASSES_DIR); \
		for i in `echo $$cdir | sed 's/\// /g'`; \
		do \
			tmpdir=$$tmpdir/$$i; \
			[ -d $$tmpdir ] || mkdir $$tmpdir || exit $$?; \
		done; \
		$(INSTALL) -m 644 $$f $(CLASSES_DIR)/$$cdir; \
	done
else
	@@echo Nothing to be done for classes
endif

install-lib: 
ifneq "$(strip $(LIBRARY))" ""
	[ -d $(LIBRARY_DIR) ] || mkdir $(LIBRARY_DIR)
	for f in $(LIBRARY); do\
		$(INSTALL) -m 644 $$f $(LIBRARY_DIR); \
	done
else
	@@echo Nothing to be done for library
endif

install-servlets: $(SERVLETS)
ifneq "$(strip $(SERVLETS))" ""
	[ -d $(SERVLETS_DIR) ] || mkdir $(SERVLETS_DIR)
	for p in $(packages_path); do \
		[ -d $(SERVLETS_DIR)/$$p ] || mkdir $(SERVLETS_DIR)/$$p; \
		$(INSTALL) -d $(SERVLETS_DIR)/$$p ; \
	done
	for f in $(compiled_servlets) $(servlet_resources); do\
		d=`dirname $$f`;\
		$(INSTALL) -m 644 $$f $(SERVLETS_DIR)/`expr $$d : 'servlets/\(.*\)'`;\
	done
else
	@@echo Nothing to be done for servlets
endif

install-templates: 
ifneq "$(strip $(TEMPLATES_NAME))" ""
	[ -d $(TEMPLATES_DIR) ] || mkdir $(TEMPLATES_DIR)
	for d in $(TEMPLATES_NAME); do\
		[ -d $(TEMPLATES_DIR)/$$d ] || mkdir $(TEMPLATES_DIR)/$$d; \
		$(INSTALL) -d $(TEMPLATES_DIR)/$$d;\
	done
	for f in $(template_files); do\
		d=`dirname $$f`;\
		$(INSTALL) -m 644 $$f $(TEMPLATES_DIR)/`expr $$d : 'templates/\(.*\)'`;\
	done
endif

## Install documentation in site documentation tree.
install-doc:
ifneq "$(javadoc_files)" ""
	[ -d $(DOC_DIR) ] || mkdir $(DOC_DIR)
	$(INSTALL) -m 644 $(javadoc_files) $(DOC_DIR)
endif

## Make distribution
dist : dist-clean dist-tar dist-zip

dist-tar: 
	cd ..; \
	files=`find $(dir_name) -name CVS -prune -o -type f -print`; \
	tar -czvf $(TAR_DIST) $${files}

dist-zip: 
	cd ..; \
	files=`find $(dir_name) -name CVS -prune -o -type f -print`; \
	zip $(ZIP_DIST) $${files}

## Uninstall
uninstall:
	rm -fr $(CLASSES_DIR)/$(subst .,/,$(fqdn))
	rm -fr $(installed_doc)
ifneq "$(strip $(SCRIPTS))" ""
	for p in $(SCRIPTS); do\
	rm -fr $(BIN_DIR)/$$p;\
	done
endif
ifneq "$(strip $(CLASSES_ZIP))" ""
	rm -fr $(BIN_DIR)/$(CLASSES_ZIP)
endif
ifneq "$(strip $(SERVLETS))" ""
	rm -fr $(SERVLETS_DIR)/$(subst .,/,$(fqdn))
endif
ifneq "$(strip $(TEMPLATES_NAME))" ""
	for d in $(TEMPLATES_NAME); do\
		rm -fr $(TEMPLATES_DIR)/$$d;\
	done
endif

## Clean directory
dist-clean:
	rm -fr $(TAR_DIST) $(ZIP_DIST)
	find . -name \*.orig -exec rm -f {} \;
	find . -name \*~ -exec rm -f {} \;

clean: dist-clean
	rm -f $(compiled_classes)
	rm -f $(resources)
	rm -f $(javadoc_files)
ifneq "$(strip $(SERVLETS))" ""
	rm -f $(compiled_servlets)
	rm -f $(servlet_resources)
endif

@


1.22
log
@Now uses JServ instead of JServHandler
@
text
@@


1.21
log
@bring changes for 0.9.12 into the head of the tree
@
text
@d66 1
a66 1
CLASSES=JServConnection.class JServServletManager.class JServHandler.class   \
@


1.20
log
@Adding reference to SGMLTag to makefile so it will be automatically
compiled with the rest of jserv when needed.
@
text
@d60 1
@


1.20.2.1
log
@Merged Stefanos' new version into a branch for easier developer access. Still needs a little more work (esp. on the Makefile).
@
text
@a59 1
#SUB_PACKAGES := test servlets
@


1.19
log
@JDK 1.2 Javadoc uses Index.html in place of AllFiles.html so this change
should make JServ's Makefile compatible with both.
@
text
@d68 1
a68 1
	JServDebug.class JServSession.class \
@


1.18
log
@- Added locking methods with timeout values in JServLock.
- Added InterruptedException to method signature of locking method to
  allows for interrupt.
- Don't wait more that jserv.timeout for the write lock when destroying a
  servlet.
- Added properties to control autoreload in JServServletManager.
@
text
@d162 2
a163 1
	doc/AllNames.html doc/packages.html doc/tree.html
d168 2
a169 1
	$(DOC_DIR)/AllNames.html $(DOC_DIR)/packages.html $(DOC_DIR)/tree.html
@


1.17
log
@remove classes from JCFLAGS for JDK 1.2 compatibility
@
text
@d74 1
a74 1
SERVLETS= JServSSI.class EnvDumpServlet.class
@


1.16
log
@Merged in JSDK 1.1 implementation with cookies and session handling.
@
text
@d124 1
a124 1
JCFLAGS += -classpath classes:servlets:src:$(LIBRARY):$(CLASSPATH)
@


1.15
log
@add 3 generated files that were missing from javadoc_files, needed for
proper using of make install-doc, which also ends up on java.apache.org/doc/
@
text
@d10 4
d67 2
a68 1
	JServSendError.class JServSignals.class \
d89 5
d124 2
a125 2
JCFLAGS += -classpath classes:servlets:src:$(CLASSPATH)
JDFLAGS += -d doc -classpath classes:servlets:src:$(CLASSPATH)
d127 2
a128 2
JCFLAGS += $(OPTIM) -classpath src:$(CLASSPATH)
JDFLAGS += -d doc -classpath classes:src:$(CLASSPATH)
d239 1
a239 1
	install-templates install-zip \
d249 1
a249 1
	install-servlets install-templates
d288 10
@


1.14
log
@oops... remove my environment from the Makefile
@
text
@d151 2
a152 1
javadoc_files=$(subst $$,\$$,$(shell find doc -name \*$(fqdn)\*.html -print))
d156 2
a157 1
installed_doc=$(subst $$,\$$,$(shell find $(DOC_DIR) -name \*$(fqdn)\*.html -print))
@


1.13
log
@add EnvDumpServlet to demonstrate environment information available to
servlet authors
@
text
@d5 1
a5 2
#PREFIX=/usr/local/java-lib/jserv
PREFIX=/nfs/cscic/srcmgmt-web/lib/jserv
@


1.12
log
@More documentation about the <servlet> tag support.
@
text
@d5 2
a6 1
PREFIX=/usr/local/java-lib/jserv
d70 1
a70 1
SERVLETS= JServSSI.class
@


1.11
log
@Fixed a typo in the "install-doc" section.
@
text
@d11 2
@


1.10
log
@Made JServSSI install as a servlet and fixed some servlet installation bugs.
@
text
@d306 1
a306 1
ifneq "$(javadoc_file)" ""
@


1.9
log
@added a comment for installing as /usr/ucb/install for solaris
@
text
@d11 1
a11 1
SERVLETS_DIR=$(CLASSES_DIR)
a61 1
	SSIServlet.class  \
d67 1
a67 1
SERVLETS=
d173 1
a173 1
all :	classes $(CLASSES) $(RESOURCES) $(CLASSES_ZIP) $(SERVLETS_DEP) mod-jserv
d178 5
d280 1
a280 1
		[ -d $(SERVLETS_DIR)/$$p ] || mkdir $(SERVLETS_DIR)/$$p \
@


1.8
log
@added ability to javac -O...improved JDFLAGS to be cleaner...
@
text
@a32 1
INSTALL=/usr/ucb/install
d34 3
@


1.7
log
@Added full path to /usr/ucb/install
@
text
@d26 1
d32 1
a32 1
JDFLAGS=-author -version
d112 1
a112 1
JDFLAGS += -d doc -classpath classes:servlets:src:$(CLASSPATH) -noindex -notree
d114 2
a115 2
JCFLAGS += -classpath classes:src:$(CLASSPATH)
JDFLAGS += -d doc -classpath classes:src:$(CLASSPATH) -noindex -notree
d178 1
a178 1
	@@echo "To make mod_jserv, copy mod_jserv.c to your apache src "
@


1.6
log
@fix "find" command line in "make clean"
@
text
@d32 1
a32 1
INSTALL=install
@


1.5
log
@Fix: "install" needed a dependency on "all"
@
text
@d341 2
a342 2
	find -name \*.orig -exec rm -f {} \;
	find -name \*~ -exec rm -f {} \;
@


1.4
log
@Another shot at getting a clean "make install".  This creates subdirectories
if they're not already there.
@
text
@d227 1
a227 1
install: install-bin install-doc install-classes \
@


1.3
log
@Turn-off setting of classpath in Makefile.
@
text
@d232 1
d238 1
d244 1
d246 6
d256 8
a263 1
		$(INSTALL) -m 644 $$f $(CLASSES_DIR)/`expr $$d : 'classes/\(.*\)'`;\
d271 1
d273 1
d286 1
d288 1
d300 1
@


1.2
log
@JServContext now delegates servlets related method to JServServletManager
\-> this means that we don't need to synchronize on the Hashtable anymore,
but can
rely on synchronization at the method level in JServServletManager.

JServServletManager now also restarts itself when its property configuration
file is changed.
@
text
@d21 1
a21 1
CLASSPATH=/usr/local/java-lib/JSDK1.0.1/lib/classes.zip:/usr/local/jdk/lib/classes.zip
@


1.1
log
@Moved Makefile to top of module and made more generic and useful:
- Make doc and install
- Make all classes
@
text
@d21 1
a21 1
#CLASSPATH=/usr/local/java-lib/JSDK1.0.1/lib/classes.zip:/usr/local/jdk/lib/classes.zip
@


