# Makefile for IsaViz
# Designed for GNUmake   - CYGWIN (Win32) version

# Compiles Java sources, builds JAR archives, generates docs.

# Author: Emmanuel PIETRIGA  (emmanuel@w3.org)
# Version: 02/10/2003

# SHELL USED TO EXECUTE COMMANDS
SHELL		:= /usr/bin/tcsh

# DIRECTORIES
ISV_DIR		:= /circus/WWW/2001/10/IsaViz
SRC_DIR        	:= $(ISV_DIR)/src
OBJ_DIR		:= $(ISV_DIR)/classes
DOC_DIR		:= $(ISV_DIR)/apidocs
LIB_DIR		:= $(ISV_DIR)/lib
XML_UTILS	:= $(LIB_DIR)/xerces.jar
RDF_UTILS	:= $(LIB_DIR)/jena.jar;$(LIB_DIR)/icu4j.jar;$(LIB_DIR)/antlr.debug.jar
VTM             := $(LIB_DIR)/zvtm.jar

# FILES
SRCS 		:= $(shell find $(SRC_DIR) -name '*.java')
OBJS 		:= $(SRCS:$(SRC_DIR)/%.java=$(OBJ_DIR)/%.class)

# Java Development Kit
JDK	    	:= /tools/jdk1.4.1
JAVAC          	:= $(JDK)/bin/javac.exe 
JAVAC_OPT	:= -O -classpath "$(OBJ_DIR);$(SRC_DIR);$(VTM);$(XML_UTILS);$(RDF_UTILS)" -d $(OBJ_DIR)
COMPILE		:= $(JAVAC) $(JAVAC_OPT)
JAR 		:= $(JDK)/bin/jar
JAR_OPT		:= -cvf
ARCHIVE		:= $(JAR) $(JAR_OPT)

# RULES

# Default: makes all object targets
all : $(OBJS)

# Phony targets
.PHONY : all archive doc clean realclean test

isvjar : 
	cd $(ISV_DIR) ; $(JDK)/bin/jar cv0f lib/isaviz.jar -C classes org/w3c/IsaViz images

# Clean (removes all the emacs autosaves)
clean : 
	rm -rf `find $(SRC_DIR)/org/w3c/IsaViz \( -name "*~" -o -name "#*#" \) -print`

realclean :
	rm -rf `find $(OBJ_DIR)/org/w3c/IsaViz -name "*.class" -print`

# Test (used to display variable values, test commands, etc.)
test :
	echo 'Welcome to the ISV makefile'

# Implicit rule for Java compiling
$(OBJ_DIR)/%.class : $(SRC_DIR)/%.java
	$(COMPILE) $<



