# http://code.google.com/p/jing-trang/source/browse/tags/V20030227/Makefile.gcj # http://www.linuxdevcenter.com/pub/a/linux/2002/02/14/makefiles.html program := HTML2XML # source directories htmlparser_src := htmlparser/src htmlparser_test := htmlparser/test-src # java sources htmlparser_sources := $(shell find $(htmlparser_src) -name '*.java' | \ grep -v 'xom') # dependencies chardet := dependencies/mozilla/intl/chardet/java/dist/lib/chardet.jar icu4j := dependencies/icu4j-4_0.jar dependencies:= $(chardet) $(icu4j) classpath := $(chardet):$(icu4j) # output directory build_dir = gcj/build # link main program $(build_dir)/$(program): \ $(build_dir)/htmlparser.o \ $(build_dir)/icu4j.o \ $(build_dir)/chardet.o \ $(build_dir)/$(program).o gcj --main=nu.validator.htmlparser.tools.$(program) \ --classpath=$(classpath) -o $@ $^ # compile main program $(build_dir)/$(program).o: \ htmlparser/test-src/nu/validator/htmlparser/test/SystemErrErrorHandler.java \ htmlparser/test-src/nu/validator/htmlparser/tools/$(program).java @test -d $(dir $@) || mkdir -p $(dir $@) gcj -c -I$(htmlparser_src) -I$(htmlparser_test) \ --classpath=$(classpath) -o $@ $^ # html parser library $(build_dir)/htmlparser.o: $(dependencies) $(htmlparser_sources) @test -d $(dir $@) || mkdir -p $(dir $@) gcj -c --classpath=$(classpath) $(htmlparser_sources) -o $@ # dependencies $(build_dir)/icu4j.o: $(icu4j) @test -d $(dir $@) || mkdir -p $(dir $@) gcj -c -o $@ $< $(build_dir)/chardet.o: $(chardet) @test -d $(dir $@) || mkdir -p $(dir $@) gcj -c -o $@ $< clean: rm -f $(build_dir)/$(program) rm -f $(build_dir)/*.o @test ! -d $(build_dir) || rmdir $(build_dir)