-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
76 lines (55 loc) · 2.38 KB
/
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#GHCFLAGS=-debug
#GHCFLAGS=-rtsopts -prof -auto-all +RTS -H2G -RTS
GHCFLAGS=-O3 -rtsopts +RTS -H2G -A1M -RTS -DDEFINE_NFDATA_BYTESTRING
#GHCFLAGS=-prof -auto-all -rtsopts +RTS -H2G -A1M -RTS -DDEFINE_NFDATA_BYTESTRING
#GHCFLAGS=-rtsopts +RTS -H2G -A1M -RTS # GIVES CRASH?
#RTSFLAGS=-xc -k512M
#RTSFLAGS=+RTS -k256M -H3G -A1M -s -RTS
ALEXFLAGS=--ghc --template=alex/
HAPPYFLAGS=--ghc --strict #--decode
#HAPPYFLAGS=--glr
all: executables test_cs
cabal: prepare
cabal configure && cabal build
prepare: Data/STAR/Tokens.hs
test_cs: test/TestChemShifts
test/TestChemShifts smallest.str smallest.cs +RTS -H2G -A6M
test/TestChemShifts: test/TestChemShifts.hs Data/STAR/Parser.hs Data/STAR/Tokens.hs Data/STAR/ChemShifts.hs
ghc $(GHCFLAGS) --make -rtsopts $<
test: test/TestConverter
test/TestConverter +RTS -h -Pa -xc -RTS largest.str largest.test
test2: test/TestParser
test/TestParser +RTS -hy -Pa -xc -RTS test3.str >/dev/null
test_tokens: TestTokens
./TestTokens ${RTSFLAGS} test.str
all_parser_tests: test/TestParser
time test/TestParser $(RTSFLAGS) test.str > /dev/null
time test/TestParser $(RTSFLAGS) shifts.str > /dev/null
time test/TestParser $(RTSFLAGS) input.str > /dev/null
test_parser: test/TestParser
time test/TestParser +RTS ${RTSFLAGS} -RTS test.str
executables: test/TestParser test/TestCoords test/TestTokens test/TestChemShifts test/MergeCoord test/MergeCS
test/TestParser: test/TestParser.hs Data/STAR/Parser.hs Data/STAR/Tokens.hs Data/STAR/Tokens.hi
ghc $(GHCFLAGS) $<
test/MergeCS: test/MergeCS.hs Data/STAR/Parser.hs Data/STAR/Tokens.hs Data/STAR/Tokens.hi Data/STAR/ChemShifts.hs
ghc $(GHCFLAGS) $<
test/TestCoords: test/TestCoords.hs Data/STAR/Parser.hs Data/STAR/Tokens.hs Data/STAR/Tokens.hi
ghc $(GHCFLAGS) $<
test/TestConverter: test/TestConverter.hs Data/STAR/Parser.hs Data/STAR/Tokens.hs Data/STAR/Tokens.hi Data/STAR/Type.hi
ghc $(GHCFLAGS) $<
test/TestTokens: test/TestTokens.hs Data/STAR/Tokens.hi
ghc $(GHCFLAGS) $<
Data/STAR/Parser.hs: Data/STAR/Parser.y
Data/STAR/Tokens.hs: preSrc/Tokens.x
alex $(ALEXFLAGS) $<
cp preSrc/Tokens.hs Data/STAR/Tokens.hs
# We do it because cabal is lame and doesn't allow custom Alex arguments in .cabal.
%.o %.hi: %.hs
ghc $(GHCFLAGS) $<
%.hs: %.y
happy $(HAPPYFLAGS) $<
clean:
-rm -f `cat .gitignore`
-(cd Data/STAR; rm -f `cat .gitignore`)
-(cd test; rm -f `cat .gitignore`)
-rm `find . -iname '*.hi' -or -iname '*.o'`