commit 4506a7ac70b36365f7448c3fe3840550f3230874
parent 67b76eed613de026a4b40fe5ff06aee8834500ed
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date: Sun, 24 Jan 2016 10:03:25 +0100
Fix parallel build of multi support
When we have parallel build we have to serialize in several
points. We cannot clean and build at the same time, and cannot
build several architectures at the same time.
Diffstat:
2 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/Makefile b/Makefile
@@ -4,7 +4,6 @@
include config.mk
SUBDIRS = lib cc1 cc2
-
ARCHS = z80 i386-sysv amd64-sysv
all clean:
@@ -13,15 +12,22 @@ all clean:
(cd $$i; ${MAKE} -$(MAKEFLAGS) $@ || exit); \
done
-multi: $(ARCHS)
+multi:
+ for i in $(ARCHS) ; \
+ do \
+ $(MAKE) -$(MAKEFLAGS) $$i || exit ;\
+ done
lib/libcc.a:
cd lib && $(MAKE) -$(MAKEFLAGS) all
+
$(ARCHS): lib/libcc.a
for i in cc1 cc2; \
do \
- (cd $$i; ARCH=$@ ${MAKE} -e $(MAKEFLAGS) clean $$i || exit); \
+ (cd $$i; \
+ ARCH=$@ ${MAKE} -e -$(MAKEFLAGS) clean ;\
+ ARCH=$@ $(MAKE) -e $$i || exit); \
done
ln -f cc1/cc1 bin/cc1-$@
ln -f cc2/cc2 bin/cc2-$@
diff --git a/cc1/Makefile b/cc1/Makefile
@@ -7,7 +7,6 @@ OBJS = types.o decl.o lex.o error.o symbol.o main.o expr.o \
all: cc1
-
$(OBJS) : cc1.h ../inc/cc.h ../inc/sizes.h arch/$(ARCH)/arch.h
cc1: $(OBJS) ../lib/libcc.a