Skip to content

Commit cec2bd8

Browse files
committed
Basic support for building multiple target architectures in parallel
The builds take place in subdirectories of build/, containing symbolic links to the actual source files.
1 parent 90cf0ed commit cec2bd8

3 files changed

Lines changed: 51 additions & 0 deletions

File tree

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,3 +85,5 @@
8585
.nia.cache
8686
.nra.cache
8787
.csdp.cache
88+
# Build auxiliaries
89+
/build

Makefile

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,12 @@ ifeq ($(INSTALL_COQDEV),true)
245245
$(MAKE) compcert.config
246246
endif
247247

248+
light:
249+
@test -f .depend || $(MAKE) depend
250+
$(MAKE) proof
251+
$(MAKE) extraction
252+
$(MAKE) ccomp
253+
248254
proof: $(FILES:.v=.vo)
249255

250256
extraction: extraction/STAMP
@@ -406,6 +412,7 @@ clean:
406412
rm -f tools/ndfun tools/modorder tools/*.cm? tools/*.o
407413
rm -f $(GENERATED) .depend
408414
rm -f .lia.cache
415+
rm -rf build
409416
$(MAKE) -f Makefile.extr clean
410417
$(MAKE) -C runtime clean
411418

@@ -430,6 +437,28 @@ print-includes:
430437
CoqProject:
431438
@echo $(COQINCLUDES) > _CoqProject
432439

440+
ALL_ARCHES=aarch64 arm ppc rv64 x86_32 x86_64
441+
ALL_BUILDS=$(patsubst %, build/%, $(ALL_ARCHES))
442+
443+
setup-build: FORCE
444+
rm -rf build
445+
@if [ ! -d .git ]; then echo "build-setup is only available for git checkouts"; exit 2; fi
446+
@for a in $(ALL_ARCHES); do \
447+
echo "Setting up build/$$a"; \
448+
tools/linkhier build/$$a; \
449+
(cd build/$$a && ./configure $$a-linux); \
450+
done
451+
452+
$(ALL_BUILDS): FORCE
453+
@if [ ! -d $@ ]; then echo "$@ is missing, please run 'make setup-build'"; exit 2; fi
454+
@echo "$@ started"; \
455+
if output=$$($(MAKE) -C $@ light 2>&1); \
456+
then echo "$@ succeeded" ; \
457+
else echo "$$output"; echo "$@ FAILED"; exit 2; \
458+
fi
459+
460+
build-all: $(ALL_BUILDS)
461+
433462
-include .depend
434463

435464
FORCE:

tools/linkhier

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/bin/sh
2+
# Mirror the hierarchy of source files in the directory given as first argument,
3+
# using fresh directories and symbolic links for files.
4+
# The source files are those listed by git ls-files.
5+
6+
set -e
7+
8+
case $# in
9+
1) dst="$1";;
10+
*) echo "Usage: linkhier <destination directory>" 1>&2; exit 2;;
11+
esac
12+
13+
src=$(pwd)
14+
files=$(git ls-files --recurse-submodules)
15+
mkdir -p "$dst"
16+
cd "$dst"
17+
mkdir -p $(dirname $files | sort -u)
18+
for f in $files; do
19+
ln -sf "$src/$f" "$f"
20+
done

0 commit comments

Comments
 (0)