Don't regenerate makefiles if they are already present and correct.
authorChris Hanson <org/chris-hanson/cph>
Sat, 16 Jun 2007 02:14:44 +0000 (02:14 +0000)
committerChris Hanson <org/chris-hanson/cph>
Sat, 16 Jun 2007 02:14:44 +0000 (02:14 +0000)
v7/src/etc/create-makefiles.sh

index fee8d7602de33a919c6de99475a15619abb87fd2..058430e7c63e5dd75c3bc46f6c07205ca83a4b43 100755 (executable)
@@ -1,6 +1,6 @@
 #!/bin/sh
 
-# $Id: create-makefiles.sh,v 1.2 2007/06/15 03:40:16 cph Exp $
+# $Id: create-makefiles.sh,v 1.3 2007/06/16 02:14:44 cph Exp $
 #
 # Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994,
 #     1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
@@ -36,9 +36,16 @@ fi
 
 MDIR=`compiler/choose-machine.sh "${NATIVE_CODE}"`
 
-run_cmd rm -f compiler/machine
+if test -f makefiles_created; then
+    CODE_TYPE=`cat makefiles_created`
+    if test "${CODE_TYPE}" = "${MDIR}"; then
+       echo "Makefiles already created."
+       exit 0
+    fi
+fi
+
+run_cmd rm -f compiler/machine compiler/compiler.pkg
 run_cmd ln -s machines/"${MDIR}" compiler/machine
-run_cmd rm -f compiler/compiler.pkg
 run_cmd ln -s machine/compiler.pkg compiler/.
 
 BUNDLES="6001 compiler cref edwin imail sf sos ssp star-parser xdoc xml"
@@ -49,6 +56,8 @@ run_cmd mit-scheme --heap 4000 <<EOF
   (generate-c-bundles (quote (${BUNDLES})) "${MDIR}"))
 EOF
 
+run_cmd rm -f compiler/machine compiler/compiler.pkg
+
 for SUBDIR in ${BUNDLES} runtime win32; do
     echo "creating ${SUBDIR}/Makefile.in"
     rm -f ${SUBDIR}/Makefile.in
@@ -60,3 +69,7 @@ for SUBDIR in ${BUNDLES} runtime win32; do
     fi
     cat etc/std-makefile-suffix >> ${SUBDIR}/Makefile.in
 done
+
+run_cmd rm -f makefiles_created
+echo "echo ${MDIR} > makefiles_created"
+echo "${MDIR}" > makefiles_created