-
Notifications
You must be signed in to change notification settings - Fork 0
/
GNUmakefile
47 lines (43 loc) · 1.42 KB
/
GNUmakefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
##---------------------------------------------------------------------
# GNUmakefile for tcl (to build partially parallel)
##---------------------------------------------------------------------
DSTROOT ?= /tmp/tcl/Release
OBJROOT ?= /tmp/tcl/Objects
SYMROOT ?= /tmp/tcl/Symbols
export DSTROOT OBJROOT SYMROOT
PARTS = 1 2
TESTOK := -f $(shell echo $(foreach p,$(PARTS),"$(OBJROOT)/.ok$(p)") | sed 's/ / -a -f /g')
install::
mkdir -p "$(DSTROOT)" "$(SYMROOT)"
@set -x && \
for p in $(PARTS); do \
mkdir -p "$(OBJROOT)/DSTROOT$$p" && \
mkdir -p "$(OBJROOT)/OBJROOT$$p" || exit 1; \
(echo "######## Building part $$p:" `date` '########' > "$(SYMROOT)/LOG$$p" 2>&1 && \
$(MAKE) -f Makefile install$$p \
DSTROOT="$(OBJROOT)/DSTROOT$$p" \
OBJROOT="$(OBJROOT)/OBJROOT$$p" \
>> "$(SYMROOT)/LOG$$p" 2>&1 && \
touch "$(OBJROOT)/.ok$$p" && \
echo "######## Finished part $$p:" `date` '########' >> "$(SYMROOT)/LOG$$p" 2>&1 \
) & \
done && \
wait && \
for p in $(PARTS); do \
cat "$(SYMROOT)/LOG$$p" && \
rm -f "$(SYMROOT)/LOG$$p" || exit 1; \
done && \
if [ $(TESTOK) ]; then \
$(MAKE) merge; \
else \
echo '#### error detected, not merging'; \
exit 1; \
fi
merge:
@set -x && \
for p in $(PARTS); do \
ditto "$(OBJROOT)/DSTROOT$$p" "$(DSTROOT)" || exit 1; \
done
ln -sf Versions/Current/Modules $(DSTROOT)/System/Library/Frameworks/Tcl.framework/Modules
.DEFAULT:
@$(MAKE) -f Makefile $@