summaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
authorIan Lynagh <igloo@earth.li>2011-12-02 16:55:28 +0000
committerIan Lynagh <igloo@earth.li>2011-12-02 16:55:28 +0000
commit2694bb74158bac7276cded2435bba8e889659f98 (patch)
tree67496c4d879a3589bda9329d7b63e7dcd2a979be /utils
parentb2d3c5576050a69c26a546ba10726618a72d4b67 (diff)
downloadhaskell-2694bb74158bac7276cded2435bba8e889659f98.tar.gz
Use touchy rather than touch when building on Windows
With Windows 7 in a vitrual box VM on OS X, some very odd things happen with dates and time stamps when SSHing into cygwin. e.g. here the "Change" time is in the past: $ date; touch foo; stat foo Fri Dec 2 16:58:07 GMTST 2011 File: `foo' Size: 0 Blocks: 0 IO Block: 65536 regular empty file Device: 540aba0bh/1409989131d Inode: 562949953592977 Links: 1 Access: (0644/-rw-r--r--) Uid: ( 1000/ ian) Gid: ( 513/ None) Access: 2011-12-02 16:58:07.414457900 +0000 Modify: 2011-12-02 16:58:07.414457900 +0000 Change: 2011-12-02 16:58:03.495141800 +0000 Birth: 2011-12-02 16:57:57.731469900 +0000 And if we copy such a file, then the copy is older (as determined by the "Modify" time) than the original: $ date; touch foo; stat foo; cp foo bar; stat bar Fri Dec 2 16:59:10 GMTST 2011 File: `foo' Size: 0 Blocks: 0 IO Block: 65536 regular empty file Device: 540aba0bh/1409989131d Inode: 1407374883725128 Links: 1 Access: (0644/-rw-r--r--) Uid: ( 1000/ ian) Gid: ( 513/ None) Access: 2011-12-02 16:59:10.118457900 +0000 Modify: 2011-12-02 16:59:10.118457900 +0000 Change: 2011-12-02 16:59:06.189477700 +0000 Birth: 2011-12-02 16:57:57.731469900 +0000 File: `bar' Size: 0 Blocks: 0 IO Block: 65536 regular empty file Device: 540aba0bh/1409989131d Inode: 281474976882512 Links: 1 Access: (0644/-rw-r--r--) Uid: ( 1000/ ian) Gid: ( 513/ None) Access: 2011-12-02 16:59:06.394555800 +0000 Modify: 2011-12-02 16:59:06.394555800 +0000 Change: 2011-12-02 16:59:06.395532400 +0000 Birth: 2011-12-02 16:58:40.921899600 +0000 This means that make thinks that things are out of date when it shouldn't, so reinvokes itself repeatedly until the MAKE_RESTARTS infinite-recursion test triggers. The touchy program, like most other programs, creates files with both Modify and Change in the past, which is still a little odd, but is consistent, so doesn't break make.
Diffstat (limited to 'utils')
-rw-r--r--utils/ghc-cabal/ghc.mk4
-rw-r--r--utils/touchy/ghc.mk9
2 files changed, 7 insertions, 6 deletions
diff --git a/utils/ghc-cabal/ghc.mk b/utils/ghc-cabal/ghc.mk
index 9af611c8b9..20d05704d2 100644
--- a/utils/ghc-cabal/ghc.mk
+++ b/utils/ghc-cabal/ghc.mk
@@ -25,7 +25,7 @@ $(GHC_CABAL_DIR)/dist/build/tmp/ghc-cabal$(exeext): $(wildcard libraries/Cabal/C
$(GHC_CABAL_DIR)/dist/build/tmp/ghc-cabal$(exeext): $(wildcard libraries/Cabal/Cabal/Distribution/*/*.hs)
$(GHC_CABAL_DIR)/dist/build/tmp/ghc-cabal$(exeext): $(wildcard libraries/Cabal/Cabal/Distribution/*.hs)
-$(GHC_CABAL_DIR)/dist/build/tmp/ghc-cabal$(exeext): $(GHC_CABAL_DIR)/Main.hs | $$(dir $$@)/. bootstrapping/.
+$(GHC_CABAL_DIR)/dist/build/tmp/ghc-cabal$(exeext): $(GHC_CABAL_DIR)/Main.hs $(TOUCH_DEP) | $$(dir $$@)/. bootstrapping/.
"$(GHC)" $(SRC_HC_OPTS) --make $(GHC_CABAL_DIR)/Main.hs -o $@ \
-no-user-package-conf \
-Wall $(WERROR) \
@@ -36,7 +36,7 @@ $(GHC_CABAL_DIR)/dist/build/tmp/ghc-cabal$(exeext): $(GHC_CABAL_DIR)/Main.hs | $
-ilibraries/filepath \
-ilibraries/hpc \
$(utils/ghc-cabal_dist_EXTRA_HC_OPTS)
- touch $@
+ "$(TOUCH_CMD)" $@
# touch is required, because otherwise if mkdirhier is newer, we
# repeatedly rebuild ghc-cabal.
diff --git a/utils/touchy/ghc.mk b/utils/touchy/ghc.mk
index fc9c845c8d..458f80e5ed 100644
--- a/utils/touchy/ghc.mk
+++ b/utils/touchy/ghc.mk
@@ -10,8 +10,9 @@
#
# -----------------------------------------------------------------------------
-utils/touchy_dist_C_SRCS = touchy.c
-utils/touchy_dist_PROG = $(GHC_TOUCHY_PGM)
-utils/touchy_dist_TOPDIR = YES
-utils/touchy_dist_INSTALL = YES
+utils/touchy_dist_C_SRCS = touchy.c
+utils/touchy_dist_PROG = $(GHC_TOUCHY_PGM)
+utils/touchy_dist_TOPDIR = YES
+utils/touchy_dist_INSTALL = YES
+utils/touchy_dist_INSTALL_INPLACE = YES
$(eval $(call build-prog,utils/touchy,dist,0))