Build system: cabalise deriveConstants + genprimopcode
authorThomas Miedema <thomasmiedema@gmail.com>
Mon, 26 Oct 2015 12:30:07 +0000 (13:30 +0100)
committerThomas Miedema <thomasmiedema@gmail.com>
Fri, 30 Oct 2015 16:43:24 +0000 (17:43 +0100)
This is needed for #10374 (but doesn't fix it yet).

Also rename DeriveConstants.hs to Main.hs, because the build
system has trouble with Main modules not called Main.hs.

Differential Revision: https://phabricator.haskell.org/D1380

utils/deriveConstants/Main.hs [moved from utils/deriveConstants/DeriveConstants.hs with 100% similarity]
utils/deriveConstants/deriveConstants.cabal [new file with mode: 0644]
utils/deriveConstants/ghc.mk
utils/genprimopcode/genprimopcode.cabal [new file with mode: 0644]
utils/genprimopcode/ghc.mk

diff --git a/utils/deriveConstants/deriveConstants.cabal b/utils/deriveConstants/deriveConstants.cabal
new file mode 100644 (file)
index 0000000..72afb72
--- /dev/null
@@ -0,0 +1,20 @@
+Name: deriveConstants
+Version: 0.1
+Copyright: XXX
+License: BSD3
+-- XXX License-File: LICENSE
+Author: XXX
+Maintainer: XXX
+Synopsis: XXX
+Description: XXX
+Category: Development
+build-type: Simple
+cabal-version: >=1.10
+
+Executable deriveConstants
+    Default-Language: Haskell2010
+    Main-Is: Main.hs
+    Build-Depends: base       >= 4   && < 5,
+                   containers,
+                   process,
+                   filepath
index 968282e..e278999 100644 (file)
 #
 # -----------------------------------------------------------------------------
 
-utils/deriveConstants_dist_MODULES = DeriveConstants
-utils/deriveConstants_dist_PROGNAME = deriveConstants
+utils/deriveConstants_USES_CABAL           = YES
+utils/deriveConstants_PACKAGE              = deriveConstants
+utils/deriveConstants_dist_PROGNAME        = deriveConstants
+utils/deriveConstants_dist_INSTALL         = NO
 utils/deriveConstants_dist_INSTALL_INPLACE = YES
-utils/deriveConstants_HC_OPTS += -package process -package containers
 
 $(eval $(call build-prog,utils/deriveConstants,dist,0))
 
diff --git a/utils/genprimopcode/genprimopcode.cabal b/utils/genprimopcode/genprimopcode.cabal
new file mode 100644 (file)
index 0000000..adc5230
--- /dev/null
@@ -0,0 +1,22 @@
+Name: genprimopcode
+Version: 0.1
+Copyright: XXX
+License: BSD3
+-- XXX License-File: LICENSE
+Author: XXX
+Maintainer: XXX
+Synopsis: XXX
+Description: XXX
+Category: Development
+build-type: Simple
+cabal-version: >=1.10
+
+Executable genprimopcode
+    Default-Language: Haskell2010
+    Main-Is: Main.hs
+    Other-Modules: Lexer
+                   Parser
+                   ParserM
+                   Syntax
+    Build-Depends: base       >= 4   && < 5,
+                   array
index 4b9ebef..790c75d 100644 (file)
 #
 # -----------------------------------------------------------------------------
 
-utils/genprimopcode_dist_MODULES = Lexer Main ParserM Parser Syntax
-utils/genprimopcode_dist_PROGNAME = genprimopcode
-utils/genprimopcode_dist_HC_OPTS = -package array
+utils/genprimopcode_USES_CABAL           = YES
+utils/genprimopcode_PACKAGE              = genprimopcode
+utils/genprimopcode_dist_PROGNAME        = genprimopcode
+utils/genprimopcode_dist_INSTALL         = NO
 utils/genprimopcode_dist_INSTALL_INPLACE = YES
 
 $(eval $(call build-prog,utils/genprimopcode,dist,0))