From: adam Date: Thu, 8 Jul 2004 10:28:52 +0000 (+0000) Subject: initial checkin of Makefile.common X-Git-Url: http://git.megacz.com/?p=org.ibex.core.git;a=commitdiff_plain;h=b745128f20b0405cff433a66ccb44445b3feb9c8 initial checkin of Makefile.common darcs-hash:20040708102852-5007d-933a78ea489623ea015de01af970d95f7515da43.gz --- diff --git a/Makefile.common b/Makefile.common new file mode 100644 index 0000000..d7275b8 --- /dev/null +++ b/Makefile.common @@ -0,0 +1,64 @@ +############################################################################### +# Ibex common Makefile +# +# includes boilerplate stuff and inter-project dependency resolution +# + +realdefault: default + +### interproject deps ############################################################# + +cmd := find src -name \*.java -exec grep '^import org.ibex.' {} \; +cmd += | sed 's_import org\.ibex\.\([a-z]*\).*_ src/org/ibex/\1\n_' +cmd += | sort | uniq | (while read A; do test -e $$A || echo $$A; done) +$(eval upstream := $(shell $(cmd))) + +repos: $(upstream) +repo/: ; mkdir repo +repo/%.ibex.org/: repo/ + cd repo; darcs get --partial --verbose http://$*.ibex.org/ +src/org/ibex/%/: repo/%.ibex.org/ + cd repo/$*.ibex.org; darcs pull -a --verbose http://$*.ibex.org/ + cd src/org/ibex; ln -sf ../../../repo/$*.ibex.org/src $* + + +### cleanup targets ################################################################## + +clean: ; rm -rf build +dist-clean: ; rm -rf build .compile + + +### java->class compilation ########################################################## + +javac := javac +java_sources := $(shell find src/org/ibex/*/ -name \*.java) + +compile: .compile +.compile: $(sources) + make -s repos + $(javac) $(java_sources) + touch $@ + + +### proposing and checkins ########################################################## + +propose-patch: + @darcs send --edit-description -o .darcspatch -T patches@xwt.org http://core.ibex.org/ + @(echo "To: patches@xwt.org";\ + SUB=`grep -A10000 New.patches .darcspatch | grep '^\\[' | cut -b 2- | tr \\\n , | sed s_,_,\ _g | sed "s_, *\\$$__"`;\ + echo "Subject: $$SUB";\ + echo;\ + cat .darcspatch) | /usr/sbin/sendmail -bm -f $(USER)@xwt.org patches@xwt.org; + @rm .darcspatch + +commit: propose-patch + darcs push xwt@xwt.org:/var/www/org/ibex/core/ + + +### documentation ########################################################## + +doc/%.pdf: build/class/org/ibex/util/XML.class build/class/org/ibex/doc/Doc.class + cd doc/$*; java -cp ../../build/class org.ibex.doc.Doc < $*.xml > $*.tex + cd doc/$*; pdflatex $*.tex + mv doc/$*/$*.pdf doc/$*.pdf + test `uname` == Darwin && open doc/$*.pdf