source: trunk/debathena/scripts/build-server/build-all/Makefile @ 25794

Revision 25794, 1.0 KB checked in by jdreed, 12 years ago (diff)
- Pick a (slightly) less silly stamps directory (Trac: #727) - Ensure that we don't accidentally end up with parallel builds because of stray .started or .error stamps (Trac: #1230) - Suppress echoing of commands and make output more readable
Line 
1suite := quantal
2psuite := quantal
3STAMPS := /afs/sipb.mit.edu/project/debathena/arch/amd64_deb40/bin/build-server/build-all/stamps/stamps.$(suite)
4
5package = $(STAMPS)/$(1).done
6
7all: build-all
8
9deps.mk: gen-build-deps
10        ./gen-build-deps $(psuite) > $@
11include deps.mk
12
13build/%: $(call package,%)
14        :
15
16$(call package,%):
17        @echo "Starting build of $*"
18        @if [ -e $(STAMPS)/$*.started ]; then echo "Error, remove 'started' stamp and try again."; false; fi
19        @rm -f $(STAMPS)/$*.error
20        @file=$$(mktemp -t 'stupid.XXXXXX') && \
21                echo "screen sh -c '$(CURDIR)/do-build $* $(STAMPS)/$* $(suite) $(psuite)'" > "$$file" && \
22                echo "other" >> "$$file" && \
23                screen -X source "$$file" && \
24                sleep 2 && \
25                rm -f "$$file"
26        @[ -e $(STAMPS)/$*.started ]
27        @echo -n "Building $*..."
28        @while ! [ -e $(STAMPS)/$*.done ] && ! [ -e $(STAMPS)/$*.error ]; do sleep 1; done
29        @if [ -e $(STAMPS)/$*.done ]; then echo "OK"; else echo "FAILED"; fi
30        @rm -f $(STAMPS)/$*.started
31        @rm -f $(STAMPS)/$*.error
32        @[ -e $(STAMPS)/$*.done ]
33
34clean:
35        rm -f deps.mk $(STAMPS)/*.started $(STAMPS)/*.error
Note: See TracBrowser for help on using the repository browser.