PACKAGE_LIST = scratchbox-core \ scratchbox-libs \ scratchbox-toolchain-host-gcc VERSION = $(shell head -n1 /scratchbox/etc/scratchbox-version) ARCH = $(shell dpkg-architecture -qDEB_BUILD_ARCH) BUILD_TARGETS = base utils host-gcc tools post-install docs PACKAGE_TARGETS = tarball deb .PHONY: default doc/ChangeLog all $(BUILD_TARGETS) packages $(PACKAGE_TARGETS) clean export SBOX_VERSION default: @echo "Use the ./build script to build Scratchbox!" doc/ChangeLog: doc/ChangeLog.old darcs changes --summary --from-tag darcs > $@ cat $^ >> $@ all: $(BUILD_TARGETS) base: make -C tools/scratchbox-base install utils: make -C tools/scratchbox-utils install host-gcc: make -C compilers/host_gcc install tools: host-gcc utils make -C meta/scratchbox install post-install: base make -C tools/post-install install docs: base make -C doc/sb_docs install packages: $(PACKAGE_TARGETS) tarball: set -e; \ for PACKAGE in $(PACKAGE_LIST); do \ tar cfz ../$$PACKAGE-$(VERSION)-$(ARCH).tar.gz `cat $$PACKAGE.files` \ --owner root --group root; \ done deb: chmod +x debian/rules fakeroot debian/rules binary source-tarball: @(if ! darcs changes -t scratchbox_ --last=2 | grep -q . ; then \ echo "You are trying to build source tarball from untagged revision."; \ echo "This is doomed to fail. please refer to README."; \ exit; \ fi && \ VERSION=`darcs changes -t scratchbox_ --last=2| grep "tagged scratchbox_" | head -1 | sed -r 's/[[:space:]]*tagged [a-z_]+_([0-9\.]+)/\1/'` && \ TMP=$$(mktemp -d tmp.XXXXXX) && \ cd $$TMP && \ darcs get .. && \ cd scratchbox && \ $(MAKE) doc/ChangeLog && \ darcs add doc/ChangeLog && \ darcs record -a -m "kludge" && \ darcs dist --dist-name scratchbox-$$VERSION && \ mv scratchbox-$$VERSION.tar.gz ../.. && \ cd ../.. && \ rm -rf $$TMP && \ md5sum "scratchbox-$$VERSION.tar.gz") clean: find `find . -mindepth 1 -maxdepth 1 -not -name _darcs` -type d -maxdepth 1 -mindepth 1 -exec make -C {} clean \; chmod +x debian/rules fakeroot debian/rules clean