SRCS:=$(shell find . -name "*.java")

OBJS:=${SRCS:.java=.class}

CXX=javac
CURDIR:=$(shell pwd | sed 's/.*\///')

# SEP is to use ';' on windows and ':' on unix because windows is mentally deficient
SEP:=$(shell if [ "`uname`" = "CYGWIN" -o "`uname`" \> "CYGWIN" -a "`uname`" \< "CYGWIO" ] ; then echo ";" ; else echo ":" ; fi )
CXXFLAGS=-deprecation -classpath ".$(SEP)./ftp.jar$(SEP)../aibo3d"

.PHONY: all clean msg

all: msg $(OBJS)

msg:
	@echo " **     These tools require the JDK 1.4 or higher.  These files         **"
	@echo " **     are _not_ necessary for development.  If errors occur, you      **"
	@echo " **     can remove the tools/mon/Makefile and continue without it.      **"

%.class: %.java
	$(if $(shell which $(CXX)), \
		@echo "Compiling $< into $@..."; $(CXX) $(CXXFLAGS) $<, \
		@printf "  ***** WARNING: You don't have java... skipping TekkotsuMon *****\n" \
	)

clean:
	rm -f $(OBJS) *~ 
