[hackers] [scc] Fix Makefiles || Quentin Rameau
commit c1d2669bb04c5433c9c6852125fe7b80e7a5d40f
Author: Quentin Rameau <quinq_AT_fifth.space>
AuthorDate: Thu May 12 19:16:13 2016 +0200
Commit: Quentin Rameau <quinq_AT_fifth.space>
CommitDate: Wed May 18 18:21:46 2016 +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.
diff --git a/Makefile b/Makefile
index e31a613..4e024d5 100644
--- a/Makefile
+++ b/Makefile
_AT_@ -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
_AT_@ -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=$_AT_ ${MAKE} -e -$(MAKEFLAGS) clean ;\
- ARCH=$_AT_ $(MAKE) -e $$i || exit); \
+ ARCH=$_AT_ $(MAKE) -e -$(MAKEFLAGS) clean; \
+ ARCH=$_AT_ $(MAKE) -e $$i || exit); \
done
ln -f cc1/cc1 bin/cc1-$_AT_
ln -f cc2/cc2 bin/cc2-$_AT_
_AT_@ -50,13 +49,13 @@ uninstall:
rm -f $(PREFIX)/bin/cpp
clean:
- for i in ${DIRS};\
+ for i in $(DIRS); \
do \
- (cd $$i; ${MAKE} -$(MAKEFLAGS) $_AT_ || exit); \
+ (cd $$i && $(MAKE) -$(MAKEFLAGS) $_AT_ || 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
index fb85874..1cfc5c3 100644
--- a/cc1/Makefile
+++ b/cc1/Makefile
_AT_@ -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 $_AT_
diff --git a/cc2/Makefile b/cc2/Makefile
index 12cea53..5bf33eb 100644
--- a/cc2/Makefile
+++ b/cc2/Makefile
_AT_@ -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 $_AT_; trap 'rm -f $$$$.h' EXIT INT QUIT ;\
+ awk -f generror.awk cc2.h > $$$$.h && mv $$$$.h $_AT_
+
+main.o: error.h
+
../inc/sizes.h:
cp ../inc/sizes_$(STD).h $_AT_
$(OBJS): cc2.h ../inc/sizes.h
-main.o: error.h
-
-error.h: cc2.h
- rm -f $_AT_; trap 'rm -f $$$$.h' EXIT INT QUIT ;\
- awk -f generror.awk cc2.h > $$$$.h && mv $$$$.h $_AT_
+../lib/libcc.a:
+ cd ../lib && $(MAKE) -e -$(MAKEFLAGS)
cc2: $(OBJS) ../lib/libcc.a
$(CC) $(SCC_LDFLAGS) $(OBJS) ../lib/libcc.a -o $_AT_
Received on Wed May 18 2016 - 18:22:55 CEST
This archive was generated by hypermail 2.3.0
: Wed May 18 2016 - 18:24:14 CEST