Make GNUmakefile more customizable.
authorfavonia <favonia@gmail.com>
Fri, 25 May 2018 15:29:32 +0000 (11:29 -0400)
committerAnders Mörtberg <andersmortberg@gmail.com>
Fri, 25 May 2018 17:58:18 +0000 (13:58 -0400)
GNUmakefile

index abfdb65bc540ddc6a4f0dd5a34830fc4e8a2995f..5a69fc5e2c09d4b4294551207fb7457daf16c831 100644 (file)
@@ -3,9 +3,12 @@
 # files, so this is a poor match.  (By contrast, alex and happy do update their
 # output files.)  To defeat that, we touch the output files when trying to make them.
 
-GHC = ghc
+GHC ?= ghc
+ALEX ?= alex
+HAPPY ?= happy
+BNFC ?= bnfc
 # or:
-# GHC = cabal exec ghc -- 
+# GHC = cabal exec ghc --
 INPUT = CTT.hs Connections.hs Eval.hs Main.hs Resolver.hs TypeChecker.hs
 GRAMMAR = Exp.cf
 GRAMMAR_X_FILES = Exp/Lex.x
@@ -40,12 +43,12 @@ include Makefile
        $(GHC) $(GHCOPTIONS) $<
        @ touch $*.hi $*.o
 %.hs: %.y
-       happy -gca $<
+       $(HAPPY) -gca $<
 %.hs: %.x
-       alex -g $<
+       $(ALEX) -g $<
 
 bnfc $(GRAMMAR_FILES): Exp.cf
-       bnfc --haskell -d Exp.cf
+       $(BNFC) --haskell -d Exp.cf
        @ touch $(GRAMMAR_FILES)
 
 TAGS:; hasktags --etags $(INPUT) $(GRAMMAR)