initial checkin of Makefile.common
authoradam <adam@megacz.com>
Thu, 8 Jul 2004 10:28:52 +0000 (10:28 +0000)
committeradam <adam@megacz.com>
Thu, 8 Jul 2004 10:28:52 +0000 (10:28 +0000)
darcs-hash:20040708102852-5007d-933a78ea489623ea015de01af970d95f7515da43.gz

Makefile.common [new file with mode: 0644]

diff --git a/Makefile.common b/Makefile.common
new file mode 100644 (file)
index 0000000..d7275b8
--- /dev/null
@@ -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