-
Notifications
You must be signed in to change notification settings - Fork 34
/
Makefile
145 lines (131 loc) · 4.14 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
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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
# These are a few rules to help build the open-source hsthrift. This
# file will hopefully go away in due course.
#
CABAL_BIN := cabal
THRIFT1 := thrift1
CABAL := $(CABAL_BIN) $(GETDEPS_CABAL_FLAGS)
# Targets in this file invoke Cabal and hence can't be built in parallel
.NOTPARALLEL:
all:: compiler thrift-hs thrift-cpp server thrift-http
compiler::
$(CABAL) build thrift-compiler
server::
$(CABAL) build thrift-server
util::
$(CABAL) build fb-util
thrift-http::
$(CABAL) build thrift-http
thrift:: thrift-cpp thrift-hs
thrift-hs:: compiler
( \
THRIFT_COMPILE=$$($(CABAL) -v0 list-bin exe:thrift-compiler); \
(cd lib && $${THRIFT_COMPILE} --hs \
if/RpcOptions.thrift); \
(cd lib && $${THRIFT_COMPILE} --hs \
if/ApplicationException.thrift); \
(cd lib && $${THRIFT_COMPILE} --hs --use-int \
test/if/math.thrift \
-o test); \
mkdir -p cpp-channel/test/if; \
(cd lib && $${THRIFT_COMPILE} --hs --use-int \
test/if/math.thrift \
-o ../cpp-channel/test/if); \
(cd lib && $${THRIFT_COMPILE} --hs --use-int \
test/if/math.thrift \
-o ../server/test); \
(cd lib && $${THRIFT_COMPILE} --hs --use-int \
test/if/math.thrift \
-o ../http/test); \
(cd lib && $${THRIFT_COMPILE} --hs --use-int \
test/if/echoer.thrift \
-o test); \
(cd lib && $${THRIFT_COMPILE} --hs --use-int \
test/if/echoer.thrift \
-o ../server/test); \
(cd lib && $${THRIFT_COMPILE} --hs --use-int \
test/if/echoer.thrift \
-o ../http/test); \
(cd server && $${THRIFT_COMPILE} --hs \
test/if/hash_map.thrift \
-o test); \
(cd tests && $${THRIFT_COMPILE} --hs \
if/hs_prefix.thrift); \
(cd tests && $${THRIFT_COMPILE} --hs \
if/foo.thrift); \
(cd tests && $${THRIFT_COMPILE} --hs \
if/constants.thrift); \
(cd tests && $${THRIFT_COMPILE} --hs \
--duplicate-names \
if/duplicate.thrift); \
(cd tests && $${THRIFT_COMPILE} --hs \
if/EnumConst.thrift); \
(cd tests && $${THRIFT_COMPILE} --hs \
if/enum.thrift); \
(cd tests && $${THRIFT_COMPILE} --hs \
if/exception.thrift); \
(cd tests && $${THRIFT_COMPILE} --hs \
--use-int --use-hash-map --use-hash-set \
if/flags.thrift); \
(cd tests && $${THRIFT_COMPILE} --hs \
--extra-hasfields \
if/hasfield.thrift); \
(cd tests && $${THRIFT_COMPILE} --hs \
if/A.thrift); \
(cd tests && $${THRIFT_COMPILE} --hs \
if/B.thrift); \
(cd tests && $${THRIFT_COMPILE} --hs \
if/C.thrift); \
(cd tests && $${THRIFT_COMPILE} --hs \
if/D.thrift); \
(cd tests && $${THRIFT_COMPILE} --hs \
if/E.thrift); \
(cd tests && $${THRIFT_COMPILE} --hs \
if/versions.thrift); \
(cd tests && $${THRIFT_COMPILE} --hs \
if/monoid.thrift); \
(cd tests && $${THRIFT_COMPILE} --hs \
if/hs_test.thrift); \
(cd tests && $${THRIFT_COMPILE} --hs \
if/hs_test.thrift -o ../lib/test); \
(cd tests && $${THRIFT_COMPILE} --hs \
if/map.thrift); \
(cd tests && $${THRIFT_COMPILE} --hs \
if/messed_up_case.thrift); \
(cd tests && $${THRIFT_COMPILE} --hs \
if/namespace.thrift); \
(cd tests && $${THRIFT_COMPILE} --hs \
if/namespace_included.thrift); \
(cd tests && $${THRIFT_COMPILE} --hs \
if/parens.thrift); \
(cd tests && $${THRIFT_COMPILE} --hs \
--required-symbols "A,B,C,X,weNeedThis" \
if/huge.thrift); \
(cd tests && $${THRIFT_COMPILE} --hs \
if/scoped_enums.thrift); \
(cd tests && $${THRIFT_COMPILE} --hs \
if/service.thrift); \
)
# those files are required for thrift-compiler's tests
mkdir -p compiler/tests/if
cp tests/if/*.thrift compiler/tests/if/
cp tests/if/*.hs compiler/tests/if/
thrift-cpp::
mkdir -p cpp-channel/if cpp-channel/test/if
cd lib && $(THRIFT1) -I . --gen mstch_cpp2 \
-o ../cpp-channel/if \
if/RpcOptions.thrift
cd lib/test/if && $(THRIFT1) -I . --gen mstch_cpp2 \
-o ../../../cpp-channel/test/if \
math.thrift
cd tests/if && $(THRIFT1) -I . --gen mstch_cpp2 \
-o . \
hs_test.thrift
test::
$(CABAL) test mangle fb-util thrift-compiler thrift-lib thrift-server thrift-tests --keep-going
.PHONY: cabal-update
cabal-update::
$(CABAL) update
# Dummy install rule to keep getdeps happy. TODO: actually install things
.PHONY: install
install::
mkdir -p $(PREFIX)