From daf276673025f125b85ea2bffe940ef0b829df6d Mon Sep 17 00:00:00 2001 From: favonia Date: Fri, 25 May 2018 11:29:32 -0400 Subject: [PATCH] Make GNUmakefile more customizable. --- GNUmakefile | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/GNUmakefile b/GNUmakefile index abfdb65..5a69fc5 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -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) -- 2.34.1