#
# Makefile for build IC Compiler.  
#
# To build the source files, simply type "make" on the command line.
#
# It supports the following modes, via commands like "make javadoc".
#
#   - java:    run JFlex on ic.flex and then build java files
#   - javadoc: build javadoc files in doc sub-directory
#   - clean:   removes all class files, javadoc files and ~ files
#   - all:     all of the above.
#

java:
	java -jar tools/JFlex.jar ic/lex/ic.flex
	javac ic/Compiler.java

javadoc:
	javadoc -link  http://download.oracle.com/javase/6/docs/api/ \
	        -d doc  `find ic -name "*.java"`

clean:
	rm -f ic/lex/Lexer.java
	find . -name "*.class" | xargs rm
	find . -name "*~" | xargs rm
	rm -rf doc/*

all:	clean java javadoc
