commit c1d2669bb04c5433c9c6852125fe7b80e7a5d40f
parent 97060982de0a1c387249347ad889f1097b3cb9fb
Author: Quentin Rameau <quinq@fifth.space>
Date: Thu, 12 May 2016 19:16:13 +0200
Fix Makefiles
Move the dependency on libcc.a to the cc1/cc2 Makefile which actually
need it to build.
Correct some indentation and ordering too.
Diffstat:
3 files changed, 21 insertions(+), 16 deletions(-)
diff --git a/Makefile b/Makefile
@@ -8,9 +8,9 @@ DIRS = lib cc1 cc2 driver/$(DRIVER)
ARCHS = z80 i386-sysv amd64-sysv qbe
all:
- for i in $(DIRS) ; \
- do \
- (cd $$i && $(MAKE) -e -$(MAKEFLAGS)) ;\
+ for i in $(DIRS); \
+ do \
+ (cd $$i && $(MAKE) -e -$(MAKEFLAGS)); \
done
cp -f cc1/cc1 bin/cc1
cp -f cc2/cc2 bin/cc2
@@ -18,18 +18,17 @@ all:
strip bin/cc1 bin/cc2 bin/scc
multi:
- cd lib && $(MAKE) -e $(MAKEFLAGS)
- for i in $(ARCHS) ; \
+ for i in $(ARCHS); \
do \
- $(MAKE) -$(MAKEFLAGS) $$i || exit ;\
+ $(MAKE) -$(MAKEFLAGS) $$i || exit; \
done
$(ARCHS):
for i in cc1 cc2; \
do \
(cd $$i; \
- ARCH=$@ ${MAKE} -e -$(MAKEFLAGS) clean ;\
- ARCH=$@ $(MAKE) -e $$i || exit); \
+ ARCH=$@ $(MAKE) -e -$(MAKEFLAGS) clean; \
+ ARCH=$@ $(MAKE) -e $$i || exit); \
done
ln -f cc1/cc1 bin/cc1-$@
ln -f cc2/cc2 bin/cc2-$@
@@ -50,13 +49,13 @@ uninstall:
rm -f $(PREFIX)/bin/cpp
clean:
- for i in ${DIRS};\
+ for i in $(DIRS); \
do \
- (cd $$i; ${MAKE} -$(MAKEFLAGS) $@ || exit); \
+ (cd $$i && $(MAKE) -$(MAKEFLAGS) $@ || exit); \
done
multi-clean:
- for i in $(ARCHS) ; \
+ for i in $(ARCHS); \
do \
ARCH=$$i $(MAKE) -e -$(MAKEFLAGS) clean || exit; \
done
diff --git a/cc1/Makefile b/cc1/Makefile
@@ -13,6 +13,9 @@ all: cc1
$(OBJS): cc1.h ../inc/cc.h ../inc/sizes.h arch/$(ARCH)/arch.h
+../lib/libcc.a:
+ cd ../lib && $(MAKE) -e -$(MAKEFLAGS)
+
cc1: $(OBJS) ../lib/libcc.a
$(CC) $(SCC_LDFLAGS) $(OBJS) ../lib/libcc.a -o $@
diff --git a/cc2/Makefile b/cc2/Makefile
@@ -9,16 +9,19 @@ OBJS = main.o parser.o peep.o symbol.o node.o code.o\
all: cc2
+error.h: cc2.h
+ rm -f $@; trap 'rm -f $$$$.h' EXIT INT QUIT ;\
+ awk -f generror.awk cc2.h > $$$$.h && mv $$$$.h $@
+
+main.o: error.h
+
../inc/sizes.h:
cp ../inc/sizes_$(STD).h $@
$(OBJS): cc2.h ../inc/sizes.h
-main.o: error.h
-
-error.h: cc2.h
- rm -f $@; trap 'rm -f $$$$.h' EXIT INT QUIT ;\
- awk -f generror.awk cc2.h > $$$$.h && mv $$$$.h $@
+../lib/libcc.a:
+ cd ../lib && $(MAKE) -e -$(MAKEFLAGS)
cc2: $(OBJS) ../lib/libcc.a
$(CC) $(SCC_LDFLAGS) $(OBJS) ../lib/libcc.a -o $@