-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
36 lines (28 loc) · 893 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
#
# 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 += Tokens.hs Grammar.hs Eval.hs ListTypes.hs
# When "make" is invoked with no arguments, we build an executable
# after building everything that it depends on
all: $(DEPEND) myinterpreter
# Build an executable for Toy interpreter
myinterpreter: $(DEPEND) Main.hs
ghc -o myinterpreter Main.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
Tokens.hs : Tokens.x
@rm -f Tokens.hs
alex Tokens.x
@chmod -w Tokens.hs
# Clean up the directory
clean::
rm -rf Tokens.hs Greammar.hs *.hi *.o myinterpreter