-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
40 lines (31 loc) · 921 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#
# Rules for compiling and linking the typechecker/evaluator
#
# Type
# make to rebuild the executable files
# make clean to remove all intermediate and temporary files
#
# Files that need to be generated from other files
DEPEND += Lexer.hs Grammar.hs Typing.hs Evaluator.hs
# When "make" is invoked with no arguments, we build an executable
# after building everything that it depends on
all: $(DEPEND) a3term a3
# Build an executable for interpreter
a3 : $(DEPEND)
ghc a3.hs
# Build an executable for interactive mode
a3term: $(DEPEND) a3term.hs
ghc a3term.hs
# Generate ML files from a parser definition file
Grammar.hs : Grammar.y
@rm -f Grammar.hs
happy Grammar.y
@chmod -w Grammar.hs
# Generate ML files from a lexer definition file
Lexer.hs : Lexer.x
@rm -f Lexer.hs
alex Lexer.x
@chmod -w Lexer.hs
# Clean up the directory
clean::
rm -rf Lexer.hs Grammar.hs *.hi *.o *.info