Touch Haskell programs after ghc --makeing them.
If GHC didn't need to do anything (e.g. you've touched one of the source files but not changed the contents), it doesn't update the output file -- so next time you run make, it thinks it needs to run the rule again. Touching the output matches make's expectation of what a compiler should do.
This commit is contained in:
parent
0db99b03c4
commit
97e6031d0c
|
@ -77,23 +77,28 @@ GHC_OPTS += -fglasgow-exts
|
|||
tock$(EXEEXT): $(BUILT_SOURCES) $(tock_SOURCES) $(config_sources)
|
||||
@MKDIR_P@ obj
|
||||
ghc $(GHC_OPTS) -o tock$(EXEEXT) --make Main -odir obj -hidir obj
|
||||
@touch tock$(EXEEXT)
|
||||
|
||||
#The order of the -main-is and --make flags is important here:
|
||||
tocktest$(EXEEXT): $(BUILT_SOURCES) $(tocktest_SOURCES) $(config_sources)
|
||||
@MKDIR_P@ obj
|
||||
ghc $(GHC_OPTS) -o tocktest$(EXEEXT) -main-is TestMain --make TestMain -odir obj -hidir obj
|
||||
@touch tocktest$(EXEEXT)
|
||||
|
||||
GenNavAST$(EXEEXT): $(GenNavAST_SOURCES) data/OrdAST.hs
|
||||
@MKDIR_P@ obj
|
||||
ghc $(GHC_OPTS) -o GenNavAST$(EXEEXT) -main-is GenNavAST --make GenNavAST -odir obj -hidir obj
|
||||
@touch GenNavAST$(EXEEXT)
|
||||
|
||||
GenOrdAST$(EXEEXT): $(GenOrdAST_SOURCES)
|
||||
@MKDIR_P@ obj
|
||||
ghc $(GHC_OPTS) -o GenOrdAST$(EXEEXT) -main-is GenOrdAST --make GenOrdAST -odir obj -hidir obj
|
||||
@touch GenOrdAST$(EXEEXT)
|
||||
|
||||
GenTagAST$(EXEEXT): $(GenTagAST_SOURCES)
|
||||
@MKDIR_P@ obj
|
||||
ghc $(GHC_OPTS) -o GenTagAST$(EXEEXT) -main-is GenTagAST --make GenTagAST -odir obj -hidir obj
|
||||
@touch GenTagAST$(EXEEXT)
|
||||
|
||||
# Both these results are near-identical. The -g flag to alex tells it to generate
|
||||
# a lexer optimised for GHC. The other part of the rule inserts the
|
||||
|
|
Loading…
Reference in New Issue
Block a user