summaryrefslogtreecommitdiff
path: root/ghc/compiler/yaccParser/Jmakefile
blob: 15b12eabab8f1783dd1b7bb1fa8d0d0c40355de2 (plain)
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
#if IncludeTestDirsInBuild == YES
#define IHaveSubdirs
#define __ghc_parser_tests_dir tests
#else
#define __ghc_parser_tests_dir /* nothing */
#endif

SUBDIRS = __ghc_parser_tests_dir

/* only subdir is the test suite */
#define NoAllTargetForSubdirs
#define NoDocsTargetForSubdirs
#define NoInstallTargetForSubdirs
#define NoInstallDocsTargetForSubdirs
#define NoDependTargetForSubdirs
#define NoTagTargetForSubdirs

YACC_OPTS = -d
/* add to this on the command line with, e.g., EXTRA_YACC_OPTS=-v */

#if BuildDataParallelHaskell == YES
D_DPH = -DDPH
#endif

XCOMM D_DEBUG = -DDEBUG

CPP_DEFINES = $(D_DEBUG) $(D_DPH)

HSP_SRCS_C = /*main.c*/ hsparser.tab.c hslexer.c id.c atype.c ttype.c \
	 tree.c literal.c coresyn.c list.c binding.c pbinding.c hpragma.c impidt.c \
	 finfot.c util.c entidt.c syntax.c type2context.c import_dirlist.c infix.c printtree.c

HSP_OBJS_O = /*main.o*/ hsparser.tab.o hslexer.o id.o atype.o ttype.o \
	 tree.o literal.o coresyn.o list.o binding.o pbinding.o hpragma.o impidt.o \
	 finfot.o util.o entidt.o syntax.o type2context.o import_dirlist.o infix.o printtree.o

/* DPH uses some tweaked files; here are the lists again... */

#if BuildDataParallelHaskell == YES
DPH_HSP_SRCS_C = main.c hsparser-DPH.tab.c hslexer-DPH.c id.c atype.c ttype-DPH.c \
	 tree-DPH.c literal.c coresyn.c list.c binding.c pbinding.c hpragma.c impidt.c \
	 finfot.c util.c entidt.c syntax.c type2context.c import_dirlist.c infix.c printtree.c

DPH_HSP_OBJS_O = main.o hsparser-DPH.tab.o hslexer-DPH.o id.o atype.o ttype-DPH.o \
	 tree-DPH.o literal.o coresyn.o list.o binding.o pbinding.o hpragma.o impidt.o \
	 finfot.o util.o entidt.o syntax.o type2context.o import_dirlist.o infix.o printtree.o
#endif

/* this is for etags */
REAL_HSP_SRCS_C = main.c id.c \
	 util.c syntax.c type2context.c import_dirlist.c infix.c printtree.c

UgenNeededHere(all depend)

BuildPgmFromCFiles(hsp,main.o,$(FLEX_LIB),libhsp.a)
#if BuildDataParallelHaskell == YES
BuildPgmFromCFiles(dphsp,$(DPH_HSP_OBJS_O),$(LEX_LIB),)
#endif

/* Most hsp files are in libhsp.a, so we can either make
   a standalone parser, or incorporate the files into
   the hsc compiler directly (WDP 94/10)
*/
NormalLibraryTarget(hsp,$(HSP_OBJS_O))

#if DoInstallGHCSystem == YES
MakeDirectories(install, $(INSTLIBDIR_GHC))
InstallBinaryTarget(hsp,$(INSTLIBDIR_GHC))
#if BuildDataParallelHaskell == YES
InstallBinaryTarget(dphsp,$(INSTLIBDIR_GHC))
#endif
#endif /* DoInstall... */

YaccRunWithExpectMsg(hsparser,13,2)

UgenTarget(atype)
UgenTarget(binding)
UgenTarget(coresyn)
UgenTarget(entidt)
UgenTarget(finfot)
UgenTarget(impidt)
UgenTarget(literal)
UgenTarget(list)
UgenTarget(pbinding)
UgenTarget(hpragma)
UgenTarget(tree)
UgenTarget(ttype)

#if BuildDataParallelHaskell == YES
YaccRunWithExpectMsg(hsparser-DPH,12,4)
UgenTarget(tree-DPH)
UgenTarget(ttype-DPH)
#endif

CDependTarget( $(HSP_SRCS_C) )

ExtraStuffToClean( y.output )
ExtraStuffToBeVeryClean( $(STD_VERY_CLEAN) hsparser.tab.* hsparser-DPH.tab.* hslexer.c hslexer-DPH.c )

EtagsNeededHere(tags) /* need this to do "make tags" */
ClearTagsFile()
CTagsTarget( *.y *.lex *.ugn $(REAL_HSP_SRCS_C) )