1 ###############################################################################
4 # includes boilerplate stuff and inter-project dependency resolution
9 ### interproject deps #############################################################
11 cmd := find src -name \*.java -exec grep '^import org.ibex.' {} \;
12 cmd += | sed 's_import org\.ibex\.\([a-z]*\).*_ repo/\1.ibex.org/\n_'
13 cmd += | sort | uniq | (while read A; do test -e $$A || echo $$A; done)
14 $(eval upstream := $(shell $(cmd)))
18 repo/%.ibex.org/: repo/
19 test -e $@ && (cd repo/$*.ibex.org; darcs pull -a --verbose http://$*.ibex.org/); true
20 test -e $@ || (cd repo; darcs get --partial --verbose http://$*.ibex.org/); true
21 cd src/org/ibex; ln -sf ../../../repo/$*.ibex.org/src/org/ibex/$*
24 ### cleanup targets ##################################################################
27 dist-clean: ; rm -rf build .compile
30 ### java->class compilation ##########################################################
33 java_sources := $(shell find src/org/ibex/*/ -name \*.java)
35 src/org/ibex/util/Preprocessor.java: repo/util.ibex.org/
36 build/class/org/ibex/util/Preprocessor.class: src/org/ibex/util/Preprocessor.java
38 $(javac) -d build/class/ $<
41 .compile: $(java_sources) build/class/org/ibex/util/Preprocessor.class
43 java -cp build/class org.ibex.util.Preprocessor $(java_sources)
44 $(javac) $(java_sources:src/%.java=build/java/%.java)
48 ### proposing and checkins ##########################################################
51 @darcs send --edit-description -o .darcspatch -T patches@xwt.org http://core.ibex.org/
52 @(echo "To: patches@xwt.org";\
53 SUB=`grep -A10000 New.patches .darcspatch | grep '^\\[' | cut -b 2- | tr \\\n , | sed s_,_,\ _g | sed "s_, *\\$$__"`;\
54 echo "Subject: $$SUB";\
56 cat .darcspatch) | /usr/sbin/sendmail -bm -f $(USER)@xwt.org patches@xwt.org;
60 darcs push xwt@xwt.org:/var/www/org/ibex/core/
63 ### documentation ##########################################################
65 doc/%.pdf: build/class/org/ibex/util/XML.class build/class/org/ibex/doc/Doc.class
66 cd doc/$*; java -cp ../../build/class org.ibex.doc.Doc < $*.xml > $*.tex
67 cd doc/$*; pdflatex $*.tex
68 mv doc/$*/$*.pdf doc/$*.pdf
69 test `uname` == Darwin && open doc/$*.pdf