This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Makefile bug?


>  > have fixed the build error I kept on getting.  2) How about a make
>  > bootstrap-lean that has the three rm's mentioned above?
>It's been mentioned as desirable by several folks; just waiting
>on someone to implement it :-)

Here's a diff that contains the two rm's that I used for my build.  Basically,
all I did was copy and paste the bootstrap and compare targets and added a
couple of rm's.  (I'm not too hip on makefile syntax... so go with what
works!)

Aaron Jackson		jackson@msrce.howard.edu

 
*** Makefile.in	Fri Sep 19 01:56:16 1997
--- Makefile.in.new	Sun Sep 28 03:46:04 1997
***************
*** 1298,1303 ****
--- 1298,1318 ----
  	@echo "Building runtime libraries"; \
  	$(MAKE) all
  
+ .PHONY: bootstrap-lean
+ bootstrap-lean: all-texinfo all-bison all-byacc all-binutils all-gas all-ld
+ 	@r=`pwd`; export r; \
+ 	s=`cd $(srcdir); pwd`; export s; \
+ 	$(SET_LIB_PATH) \
+ 	echo "Bootstrapping the compiler"; \
+ 	cd gcc; $(MAKE) $(GCC_FLAGS_TO_PASS) $@
+ 	@r=`pwd`; export r; \
+ 	s=`cd $(srcdir); pwd`; export s; \
+ 	$(SET_LIB_PATH) \
+ 	echo "Comparing stage2 and stage3 of the compiler"; \
+ 	cd gcc; $(MAKE) $(GCC_FLAGS_TO_PASS) compare-lean
+ 	@echo "Building runtime libraries"; \
+ 	$(MAKE) all
+ 
  .PHONY: cross
  cross: all-texinfo all-bison all-byacc all-binutils all-gas all-ld
  	@r=`pwd`; export r; \
*** gcc/Makefile.in	Sun Sep 28 03:48:38 1997
--- gcc/Makefile.in.new	Sun Sep 28 03:53:12 1997
***************
*** 2576,2581 ****
--- 2576,2597 ----
  	$(MAKE) stage2
  	$(MAKE) CC="stage2/xgcc -Bstage2/" CFLAGS="$(BOOT_CFLAGS)" LDFLAGS="$(BOOT_LDFLAGS)" libdir=$(libdir) STAGE_PREFIX=stage2/ LANGUAGES="$(LANGUAGES)"
  
+ bootstrap-lean: force
+ # Only build the C compiler for stage1, because that is the only one that
+ # we can guarantee will build with the native compiler, and also it is the
+ # only thing useful for building stage2.
+ 	$(MAKE) CC="$(CC)" libdir=$(libdir) LANGUAGES="$(BOOT_LANGUAGES)"
+ 	$(MAKE) stage1
+ # This used to define ALLOCA as empty, but that would lead to bad results
+ # for a subsequent `make install' since that would not have ALLOCA empty.
+ # To prevent `make install' from compiling alloca.o and then relinking cc1
+ # because alloca.o is newer, we permit these recursive makes to compile
+ # alloca.o.  Then cc1 is newer, so it won't have to be relinked.
+ 	$(MAKE) CC="stage1/xgcc -Bstage1/" CFLAGS="$(BOOT_CFLAGS)" LDFLAGS="$(BOOT_LDFLAGS)" libdir=$(libdir) STAGE_PREFIX=stage1/ LANGUAGES="$(LANGUAGES)"
+ 	$(MAKE) stage2
+ 	rm -rf stage1
+ 	$(MAKE) CC="stage2/xgcc -Bstage2/" CFLAGS="$(BOOT_CFLAGS)" LDFLAGS="$(BOOT_LDFLAGS)" libdir=$(libdir) STAGE_PREFIX=stage2/ LANGUAGES="$(LANGUAGES)"
+ 
  bootstrap2: force
  	$(MAKE) CC="stage1/xgcc -Bstage1/" CFLAGS="$(BOOT_CFLAGS)" LDFLAGS="$(BOOT_LDFLAGS)" libdir=$(libdir) STAGE_PREFIX=stage1/ LANGUAGES="$(LANGUAGES)"
  	$(MAKE) stage2
***************
*** 2610,2615 ****
--- 2626,2656 ----
  	  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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]