From cfa051116c97dc97e02fcdde9887c2e455dead81 Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Thu, 11 Dec 2008 11:58:45 -0800 Subject: fix race with fresh perforce checkouts R=r DELTA=15 (9 added, 0 deleted, 6 changed) OCL=20977 CL=20981 --- src/cmd/gc/Makefile | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) (limited to 'src/cmd/gc/Makefile') diff --git a/src/cmd/gc/Makefile b/src/cmd/gc/Makefile index 744460bd8..10afbc5d9 100644 --- a/src/cmd/gc/Makefile +++ b/src/cmd/gc/Makefile @@ -39,13 +39,22 @@ y.tab.h: $(YFILES) y.tab.c: y.tab.h test -f y.tab.c && touch y.tab.c +# the test here checks whether we have 6g at all. +# if so, use it. if not, just use the sysimport.c we have. +# this happens on fresh perforce checkouts where +# sysimport.c ends up with an older time stamp +# than sys.go (or unsafe.go or mksys.c). sysimport.c: sys.go unsafe.go mksys.c - gcc -o mksys mksys.c - 6g sys.go - 6g unsafe.go - ./mksys sys >_sysimport.c &&\ - ./mksys unsafe >>_sysimport.c &&\ - mv _sysimport.c sysimport.c + if test -x $(BIN)/6g; then \ + gcc -o mksys mksys.c; \ + 6g sys.go; \ + 6g unsafe.go; \ + ./mksys sys >_sysimport.c && \ + ./mksys unsafe >>_sysimport.c && \ + mv _sysimport.c sysimport.c; \ + elif test -f sysimport.c; then \ + touch sysimport.c; \ + fi clean: rm -f $(OFILES) *.6 enam.c 6.out a.out y.tab.h y.tab.c $(LIB) _sysimport.c -- cgit v1.2.3