[971016]: Simplification to gcc's Makefile.in: compare targets
Manfred Hollstein
manfred@s-direktnet.de
Thu Oct 23 06:29:00 GMT 1997
The various `compare*' targets contain identical code which only
differs in
a) which stage to compare against
b) and whether it's a `lean' target or not.
The same applies for the `gnucompare*' target. The following patch
- combines the `compare*' targets into one ruleset easily to be
extended if someone needs e.g. a compare5 target.
- combines the `gnucompare*' targets into one ruleset.
- changes the `gnucompare*' targets to also use the `.bad_compare'
file, which helps a build script checking if the compiler
build was successfull.
- adds new targets compare4 and compare{3,4}-lean, and gnucompare4
and gnucompare{,3,4}-lean
Thu Oct 23 15:02:58 1997 Manfred Hollstein <manfred@s-direktnet.de>
* Makefile.in (compare, compare-lean, compare3): Combined to one
ruleset determining actions to be performed via $@.
(compare4, compare4-lean): New targets.
(gnucompare, gnucompare3): Combined to one ruleset determining
actions to be performed via $@. Also, note which files failed
the comparison test in .bad_compare.
(gnucompare-lean, gnucompare3-lean, gnucompare4-lean): New targets.
diff --context --recursive --show-c-function -x *.o -x *.info* -x *.html* -x *.elc -x *.dvi -x *.orig -x *~ -x version.el egcs-971016.orig/gcc/Makefile.in egcs-971016/gcc/Makefile.in
*** egcs-971016.orig/gcc/Makefile.in Sat Oct 18 09:37:37 1997
--- egcs-971016/gcc/Makefile.in Mon Oct 20 12:20:38 1997
*************** bootstrap2: force
*** 2615,2632 ****
# stage2 directory.
# ./ avoids bug in some versions of tail.
! compare: force
-rm -f .bad_compare
for file in *$(objext); do \
tail +16c ./$$file > tmp-foo1; \
! tail +16c stage2/$$file > tmp-foo2 \
&& (cmp tmp-foo1 tmp-foo2 > /dev/null 2>&1 || echo $$file differs >> .bad_compare) || true; \
done
for dir in tmp-foo $(SUBDIRS); do \
if [ "`echo $$dir/*$(objext)`" != "$$dir/*$(objext)" ] ; then \
for file in $$dir/*$(objext); do \
tail +16c ./$$file > tmp-foo1; \
! tail +16c stage2/$$file > tmp-foo2 \
&& (cmp tmp-foo1 tmp-foo2 > /dev/null 2>&1 || echo $$file differs >> .bad_compare) || true; \
done; \
fi; \
--- 2603,2621 ----
# stage2 directory.
# ./ avoids bug in some versions of tail.
! compare compare3 compare4 compare-lean compare3-lean compare4-lean: force
-rm -f .bad_compare
+ case "$@" in compare | compare-lean ) stage=2 ;; * ) stage=`echo $@ | sed -e 's,^compare\([0-9][0-9]*\).*,\1,'` ;; esac; \
for file in *$(objext); do \
tail +16c ./$$file > tmp-foo1; \
! tail +16c stage$$stage/$$file > tmp-foo2 \
&& (cmp tmp-foo1 tmp-foo2 > /dev/null 2>&1 || echo $$file differs >> .bad_compare) || true; \
done
for dir in tmp-foo $(SUBDIRS); do \
if [ "`echo $$dir/*$(objext)`" != "$$dir/*$(objext)" ] ; then \
for file in $$dir/*$(objext); do \
tail +16c ./$$file > tmp-foo1; \
! tail +16c stage$$stage/$$file > tmp-foo2 \
&& (cmp tmp-foo1 tmp-foo2 > /dev/null 2>&1 || echo $$file differs >> .bad_compare) || true; \
done; \
fi; \
*************** compare: force
*** 2636,2715 ****
echo "Bootstrap comparison failure!"; \
cat .bad_compare; \
exit 1; \
! else true; \
fi
! # ./ avoids bug in some versions of tail.
! compare-lean: force
-rm -f .bad_compare
for file in *$(objext); do \
! tail +16c ./$$file > tmp-foo1; \
! tail +16c stage2/$$file > tmp-foo2 \
! && (cmp tmp-foo1 tmp-foo2 > /dev/null 2>&1 || echo $$file differs >> .bad_compare) || true; \
done
for dir in tmp-foo $(SUBDIRS); do \
if [ "`echo $$dir/*$(objext)`" != "$$dir/*$(objext)" ] ; then \
for file in $$dir/*$(objext); do \
! tail +16c ./$$file > tmp-foo1; \
! tail +16c stage2/$$file > tmp-foo2 \
! && (cmp tmp-foo1 tmp-foo2 > /dev/null 2>&1 || echo $$file differs >> .bad_compare) || true; \
done; \
fi; \
done
- -rm -f tmp-foo*
if [ -f .bad_compare ]; then \
echo "Bootstrap comparison failure!"; \
cat .bad_compare; \
exit 1; \
! else rm -rf stage2; \
fi
-
- # Similar, but compare with stage3 directory
- compare3: force
- for file in *$(objext); do \
- tail +16c ./$$file > tmp-foo1; \
- tail +16c stage3/$$file > tmp-foo2 2>/dev/null \
- && (cmp tmp-foo1 tmp-foo2 || echo $$file differs) || true; \
- done
- for dir in tmp-foo $(SUBDIRS); do \
- if [ "`echo $$dir/*$(objext)`" != "$$dir/*$(objext)" ] ; then \
- for file in $$dir/*$(objext); do \
- tail +16c ./$$file > tmp-foo1; \
- tail +16c stage3/$$file > tmp-foo2 2>/dev/null \
- && (cmp tmp-foo1 tmp-foo2 || echo $$file differs) || true; \
- done; \
- fi; \
- done
- -rm -f tmp-foo*
-
- # Compare the object files in the current directory with those in the
- # stage2 directory. Use gnu cmp (diffutils v2.4 or later) to avoid
- # running tail and the overhead of twice copying each object file.
-
- gnucompare: force
- for file in *$(objext); do \
- cmp --ignore-initial=16 $$file stage2/$$file || true ; \
- done
- for dir in tmp-foo $(SUBDIRS); do \
- if [ "`echo $$dir/*$(objext)`" != "$$dir/*$(objext)" ] ; then \
- for file in $$dir/*$(objext); do \
- cmp --ignore-initial=16 $$file stage2/$$file || true ; \
- done; \
- fi; \
- done
-
- # Similar, but compare with stage3 directory
- gnucompare3: force
- for file in *$(objext); do \
- cmp --ignore-initial=16 $$file stage3/$$file || true ; \
- done
- for dir in tmp-foo $(SUBDIRS); do \
- if [ "`echo $$dir/*$(objext)`" != "$$dir/*$(objext)" ] ; then \
- for file in $$dir/*$(objext); do \
- cmp --ignore-initial=16 $$file stage3/$$file || true ; \
- done; \
- fi; \
- done
# Copy the object files from a particular stage into a subdirectory.
stage1-start:
--- 2625,2662 ----
echo "Bootstrap comparison failure!"; \
cat .bad_compare; \
exit 1; \
! else \
! case "$@" in \
! *-lean ) rm -rf stage$$stage ;; \
! esac; true; \
fi
! # Compare the object files in the current directory with those in the
! # stage2 directory. Use gnu cmp (diffutils v2.4 or later) to avoid
! # running tail and the overhead of twice copying each object file.
!
! gnucompare gnucompare3 gnucompare4 gnucompare-lean gnucompare3-lean gnucompare4-lean: force
-rm -f .bad_compare
+ case "$@" in gnucompare | gnucompare-lean ) stage=2 ;; * ) stage=`echo $@ | sed -e 's,^gnucompare\([0-9][0-9]*\).*,\1,'` ;; esac; \
for file in *$(objext); do \
! (cmp --ignore-initial=16 $$file stage$$stage/$$file > /dev/null 2>&1 || echo $$file differs >> .bad_compare) || true; \
done
for dir in tmp-foo $(SUBDIRS); do \
if [ "`echo $$dir/*$(objext)`" != "$$dir/*$(objext)" ] ; then \
for file in $$dir/*$(objext); do \
! (cmp --ignore-initial=16 $$file stage$$stage/$$file > /dev/null 2>&1 || echo $$file differs >> .bad_compare) || true; \
done; \
fi; \
done
if [ -f .bad_compare ]; then \
echo "Bootstrap comparison failure!"; \
cat .bad_compare; \
exit 1; \
! else \
! case "$@" in \
! *-lean ) rm -rf stage$$stage ;; \
! esac; true; \
fi
# Copy the object files from a particular stage into a subdirectory.
stage1-start:
--
Manfred Hollstein If you have any questions about GNU SW:
Hindenburgstr. 13/1 < mailto:manfred@s-direktnet.de >
75446 Wiernsheim or take a look at
FRG < http://www.s-direktnet.de/HomePages/manfred/ >
Public PGP key from
< http://www.s-direktnet.de/HomePages/manfred/manfred.asc >
More information about the Gcc-bugs
mailing list