head	1.2;
access;
symbols
	initial:1.1.1.1 java_apache:1.1.1;
locks; strict;
comment	@# @;


1.2
date	98.05.20.16.22.23;	author ross;	state Exp;
branches;
next	1.1;

1.1
date	98.05.18.23.37.40;	author ross;	state Exp;
branches
	1.1.1.1;
next	;

1.1.1.1
date	98.05.18.23.37.40;	author ross;	state Exp;
branches;
next	;


desc
@@


1.2
log
@Fixed misplaced whitespace
@
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.1
log
@Initial revision
@
text
@d1 386
a386 386
############ 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.1.1.1
log
@
@
text
@@
