Add a versions haddock binary for Windows
authorIan Lynagh <igloo@earth.li>
Sun, 1 Aug 2010 18:09:17 +0000 (18:09 +0000)
committerIan Lynagh <igloo@earth.li>
Sun, 1 Aug 2010 18:09:17 +0000 (18:09 +0000)
driver/haddock/Makefile [new file with mode: 0644]
driver/haddock/ghc.mk [new file with mode: 0644]
driver/haddock/haddock.c [new file with mode: 0644]
ghc.mk

diff --git a/driver/haddock/Makefile b/driver/haddock/Makefile
new file mode 100644 (file)
index 0000000..3d5a330
--- /dev/null
@@ -0,0 +1,3 @@
+dir=driver/haddock
+TOP=../..
+include $(TOP)/mk/sub-makefile.mk
diff --git a/driver/haddock/ghc.mk b/driver/haddock/ghc.mk
new file mode 100644 (file)
index 0000000..f95559c
--- /dev/null
@@ -0,0 +1,24 @@
+# -----------------------------------------------------------------------------
+#
+# (c) 2009 The University of Glasgow
+#
+# This file is part of the GHC build system.
+#
+# To understand how the build system works and how to modify it, see
+#      http://hackage.haskell.org/trac/ghc/wiki/Building/Architecture
+#      http://hackage.haskell.org/trac/ghc/wiki/Building/Modifying
+#
+# -----------------------------------------------------------------------------
+
+ifeq "$(Windows)" "YES"
+
+driver/haddock_dist_C_SRCS   = haddock.c ../utils/cwrapper.c ../utils/getLocation.c
+driver/haddock_dist_CC_OPTS += -I driver/utils
+driver/haddock_dist_PROG     = haddock-$(ProjectVersion)
+driver/haddock_dist_INSTALL  = YES
+driver/haddock_dist_INSTALL_INPLACE = NO
+
+$(eval $(call build-prog,driver/haddock,dist,0))
+
+endif
+
diff --git a/driver/haddock/haddock.c b/driver/haddock/haddock.c
new file mode 100644 (file)
index 0000000..e43d33f
--- /dev/null
@@ -0,0 +1,14 @@
+
+#include "cwrapper.h"
+#include "getLocation.h"
+#include <stddef.h>
+
+int main(int argc, char** argv) {
+    char *binDir;
+    char *exePath;
+
+    binDir = getExecutablePath();
+    exePath = mkString("%s/haddock.exe", binDir);
+
+    run(exePath, 0, NULL, argc - 1, argv + 1);
+}
diff --git a/ghc.mk b/ghc.mk
index 5a1864e..5df9e89 100644 (file)
--- a/ghc.mk
+++ b/ghc.mk
@@ -520,6 +520,7 @@ BUILD_DIRS += \
    driver \
    driver/ghci \
    driver/ghc \
+   driver/haddock \
    libffi \
    includes \
    rts