include Makefile.config

#
# This Makefile may need GNU make.
#

# e.g. on linux using -classpath will prohibit
# classes.zip/rt.zip from being used. So
# if your make accepts the following I would prefer
# that. What make do you use, if it is not working? (alph)
#COMPILE_FLAGS = -classpath ../../..:$(CLASSPATH)
CLASSPATH := ../../..:$(CLASSPATH)
JAVAC = $(JC) $(COMPILE_FLAGS)

OBJ =  \
	Pos.class \
	JspConfig.class \
	JspMsg.class \
	CompileException.class \
	Emitter.class \
	HttpJspPageUtil.class \
	HttpJspPageImpl.class \
	JspClassLoader.class \
	JspServlet.class \
	JavaEmitter.class \
	JspFactoryImpl.class \
	JspNode.class \
	JspParser.class \
	JspWriterImpl.class \
	PageContextImpl.class \
	ParseException.class \
	StackedReader.class 

default	: $(OBJ)
	@cd jsdk20 \
	&& make \
	&& cd .. \
	&& cd test \
	&& make

release: $(OBJ)
	@cd jsdk20 \
	&& make \
	&& cd ..

jar: default
	@cd ../../.. \
	&& jar -c0f gnujsp10.jar \
		org/gjt/jsp/*.class \
		org/gjt/jsp/test/*.class \
		org/gjt/jsp/jsdk20/*.class \
		org/gjt/jsp/prop/*.properties

jar_release: release
	@cd ../../.. \
	&& jar -c0f gnujsp10.jar \
		org/gjt/jsp/*.class \
		org/gjt/jsp/jsdk20/*.class \
		org/gjt/jsp/prop/*.properties
 
.SUFFIXES: .class .java

.java.class :
	$(JAVAC) $<

.PHONY	: clean

clean:
	@rm -f *.class \
	&& cd jsdk20 \
	&& make clean \
	&& cd .. \
	&& cd test \
	&& make clean
