[project @ 1996-06-12 10:18:24 by partain]
[nofib.git] / mkworld / macros-nofib.ljm
1 %************************************************************************
2 %*                                                                      *
3 \section[mkworld-rules-nofib]{Nonsuffix rules for @nofib@ project}
4 %*                                                                      *
5 %************************************************************************
6
7 These are the {\em default} NoFib rules; setups are likely to override
8 them.
9
10 First, we need to ``turn on'' the time command for @RunStdTest@, which
11 is off by default, but obviously should be on for NoFibbery.
12 \begin{code}
13 #ifndef RunStdTestTimeCmd
14 #define RunStdTestTimeCmd -t $(TIME)
15 #endif
16 \end{code}
17
18 Second, we normally don't want too much junk in our ``make'' logs.  So
19 we define @NoFibAt@ to \tr{@}, so make won't echo all the programs it
20 invokes.
21 \begin{code}
22 #ifndef NoFibAt
23 #define NoFibAt @
24 #endif
25 \end{code}
26
27 %************************************************************************
28 %*                                                                      *
29 \subsection[nofib-makevars-to-subdirs]{Passing some make-variables to subdirectories}
30 %*                                                                      *
31 %************************************************************************
32
33 \begin{code}
34 #ifndef ProjectMakeVarsForAllinSubdirs
35 #define ProjectMakeVarsForAllinSubdirs HC="$(HC)" EXTRA_HC_OPTS="$(EXTRA_HC_OPTS)"
36 #endif
37
38 #ifndef ProjectMakeVarsForRunTestsinSubdirs
39 #define ProjectMakeVarsForRunTestsinSubdirs HC="$(HC)" EXTRA_HC_OPTS="$(EXTRA_HC_OPTS)"
40 #endif
41 \end{code}
42
43 %************************************************************************
44 %*                                                                      *
45 \subsection[nofib-rules]{Basic rules to compile/link/run}
46 %*                                                                      *
47 %************************************************************************
48
49 The basic business of the \tr{nofib} suite is to (a)~compile a group
50 of modules, (b)~link them into an executable, (c)~run that executable
51 against prepared input [and {\em measure} what happened!], and
52 (d)~clean up after itself.
53
54 In the simplest case, we want to go through the above process in just
55 one ``way''.  However, in testing, we probably want to compile each
56 module {\em several} different ``ways'' (perhaps using different
57 optimisation options each time), link several binaries accordingly,
58 then run the test for each different ``way''.
59
60 Therefore, these underlying macros support ``ways''.
61
62 \begin{code}
63 #ifndef NoFibHaskellCompile__
64 #define NoFibHaskellCompile__(test,way,way_opts,module,isuf)            @@\
65 CAT3(module,way,.o) : module.isuf                                       @@\
66         NoFibAt $(RM) $@                                                @@\
67         @echo ==nofib== test\: time to compile $@ follows...            @@\
68         NoFibAt $(TIME) $(HC) -c -o $@ way_opts $(HCFLAGS) $(CAT2(HC_OPTS_,test)) $(CAT4(HC_OPTS_,test,_,module)) module.isuf @@\
69         @echo ==nofib== test\: size of $@ follows...                    @@\
70         NoFibAt size $@
71 #endif /* NoFibHaskellCompile__ */
72 \end{code}
73
74 \begin{code}
75 #ifndef NoFibLinkPgm__
76 #define NoFibLinkPgm__(progname,way,way_opts,objlistvar)                     @@\
77 CAT3(all_,progname,way) :: CAT2(progname,way)                                @@\
78 CAT2(all,way) :: CAT2(progname,way)                                          @@\
79                                                                              @@\
80 CAT2(progname,way) :: $(objlistvar)                                          @@\
81         NoFibAt $(RM) CAT2(progname,way)                                     @@\
82         NoFibAt $(HC) -o CAT2(progname,way) way_opts $(HCFLAGS) $(CAT2(HC_OPTS_,progname)) $(objlistvar) @@\
83         NoFibAt $(STRIP) CAT2(progname,way)                                  @@\
84         @echo ==nofib== CAT2(progname,way)\: size of CAT2(progname,way) follows... @@\
85         NoFibAt size CAT2(progname,way)
86 #endif /* NoFibLinkPgm__ */
87 \end{code}
88
89 \begin{code}
90 #ifndef NoFibRunPgm__
91 #define NoFibRunPgm__(test,prog,way,runstdtest_opts)                    @@\
92 CAT3(runtest_,test,way) :: CAT2(prog,way)                               @@\
93         @echo ==nofib== CAT2(prog,way)\: size of CAT2(prog,way) follows... @@\
94         NoFibAt size CAT2(prog,way)                                     @@\
95         @echo ==nofib== CAT2(test,way)\: time to run CAT2(prog,way) follows... @@\
96 runtests:: CAT3(runtest_,test,way)                                      @@\
97 CAT2(runtests,way) :: CAT3(runtest_,test,way)                           @@\
98 CAT3(runtest_,test,way)::                                               @@\
99         @$(RUNSTDTEST) CAT3(./,prog,way)                \               @@\
100                 RunStdTestTimeCmd                       \               @@\
101                 $(RUNSTDTEST_FLAGS) runstdtest_opts     \               @@\
102                 $(CAT2(NOFIB_RUN,way)) $(CAT2(NOFIB_RUN_,test))
103 #endif /* NoFibRunPgm__ */
104 \end{code}
105
106 \begin{code}
107 #ifndef NoFibCleanupPgm__
108 #define NoFibCleanupPgm__(prog,way,objlistvar)                          @@\
109 CAT3(clean_,prog,way) ::                                                @@\
110         $(RM) CAT2(prog,way) $(objlistvar)
111 #endif /* NoFibCleanupPgm__ */
112 \end{code}
113
114 \begin{code}
115 #ifndef NoFibMultiModuleCompileAndRun__
116
117 #define NoFibMultiModuleCompileAndRun__(testname,way,way_opts,runstdtest_opts)  @@\
118                                                                         @@\
119 all :: CAT3(all_,testname,way)                                          @@\
120 CAT2(all,way) :: CAT3(all_,testname,way)                                @@\
121 runtests :: CAT3(runtest_,testname,way)                                 @@\
122 CAT2(runtests,way) :: CAT3(runtest_,testname,way)                       @@\
123 clean :: CAT3(clean_,testname,way)                                      @@\
124                                                                         @@\
125 NoFibLinkPgm__(testname,way,way_opts,CAT2(OBJS_O,way))                  @@\
126 NoFibRunPgm__(testname,testname,way,runstdtest_opts)                    @@\
127 NoFibCleanupPgm__(testname,way,CAT2(OBJS_O,way))
128
129 #endif /* NoFibMultiModuleCompileAndRun__ */
130 \end{code}
131
132
133 @NoFibOneModuleCompileAndRun@: a v common way to compile/run/test a
134 single-module pgm, called \tr{Main.hs}.  Assumed to produce a \tr{.stdout}
135 expected-output file, but other run options may be given.
136
137 \begin{code}
138 #ifndef NoFibOneModuleCompileAndRun__
139 #define NoFibOneModuleCompileAndRun__(testname,runopts,way,way_opts)    @@\
140                                                                         @@\
141 NoFibMultiModuleCompileAndRun__(testname,way,way_opts,-o1 testname.stdout runopts) @@\
142                                                                         @@\
143 NoFibHaskellCompile__(testname,way,way_opts,Main,hs)
144 #endif /* NoFibOneModuleCompileAndRun__ */
145 \end{code}
146
147 %************************************************************************
148 %*                                                                      *
149 \subsection[nofib-rules-interface]{Main interface to rules to compile/link/run}
150 %*                                                                      *
151 %************************************************************************
152
153 By default, we {\em do} use the ``invisible way'' (empty tag) and {\em
154 don't} use ways \tr{_a} to \tr{_g} (with those visible tags).
155 \begin{code}
156 #ifndef NoFib_UserWay_a
157 #define NoFib_UserWay_a NO
158 #endif /* ! NoFib_UserWay_a */
159 #ifndef NoFib_UserWay_b
160 #define NoFib_UserWay_b NO
161 #endif /* ! NoFib_UserWay_b */
162 #ifndef NoFib_UserWay_c
163 #define NoFib_UserWay_c NO
164 #endif /* ! NoFib_UserWay_c */
165 #ifndef NoFib_UserWay_d
166 #define NoFib_UserWay_d NO
167 #endif /* ! NoFib_UserWay_d */
168 #ifndef NoFib_UserWay_e
169 #define NoFib_UserWay_e NO
170 #endif /* ! NoFib_UserWay_e */
171 #ifndef NoFib_UserWay_f
172 #define NoFib_UserWay_f NO
173 #endif /* ! NoFib_UserWay_f */
174 #ifndef NoFib_UserWay_g
175 #define NoFib_UserWay_g NO
176 #endif /* ! NoFib_UserWay_g */
177 #ifndef NoFib_UserWay_h
178 #define NoFib_UserWay_h NO
179 #endif /* ! NoFib_UserWay_h */
180 #ifndef NoFib_UserWay_i
181 #define NoFib_UserWay_i NO
182 #endif /* ! NoFib_UserWay_i */
183 #ifndef NoFib_UserWay_j
184 #define NoFib_UserWay_j NO
185 #endif /* ! NoFib_UserWay_j */
186 #ifndef NoFib_UserWay_k
187 #define NoFib_UserWay_k NO
188 #endif /* ! NoFib_UserWay_k */
189 #ifndef NoFib_UserWay_l
190 #define NoFib_UserWay_l NO
191 #endif /* ! NoFib_UserWay_l */
192 #ifndef NoFib_UserWay_m
193 #define NoFib_UserWay_m NO
194 #endif /* ! NoFib_UserWay_m */
195 #ifndef NoFib_UserWay_n
196 #define NoFib_UserWay_n NO
197 #endif /* ! NoFib_UserWay_n */
198 #ifndef NoFib_UserWay_o
199 #define NoFib_UserWay_o NO
200 #endif /* ! NoFib_UserWay_o */
201 \end{code}
202
203 \begin{code}
204 #if NoFib_UserWay_a == YES
205 #define NoFibHaskellCompile_a(test,module,isuf) \
206         NoFibHaskellCompile__(test,_a,$(HC_OPTS_a),module,isuf)
207 #define NoFibLinkPgm_a(target,progname,objlistvar) \
208         NoFibLinkPgm__(progname,_a,$(HC_OPTS_a),objlistvar)
209 #define NoFibRunPgm_a(test,prog,runstdtest_opts) \
210         NoFibRunPgm__(test,prog,_a,runstdtest_opts)
211 #define NoFibCleanupPgm_a(prog,objlistvar) \
212         NoFibCleanupPgm__(prog,_a,objlistvar)
213 #define NoFibMultiModuleCompileAndRun_a(testname,runstdtest_opts) \
214         NoFibMultiModuleCompileAndRun__(testname,_a,$(HC_OPTS_a),runstdtest_opts)
215 #define NoFibOneModuleCompileAndRun_a(testname,runopts) \
216         NoFibOneModuleCompileAndRun__(testname,runopts,_a,$(HC_OPTS_a))
217 #define NoFibDependWay_a -s_a
218
219 #else  /* ! NoFib_UserWay_a */
220 #define NoFibHaskellCompile_a(test,module,isuf) /*none*/
221 #define NoFibLinkPgm_a(target,progname,objlistvar) /*none*/
222 #define NoFibRunPgm_a(test,prog,runstdtest_opts) /*none*/
223 #define NoFibCleanupPgm_a(prog,objlistvar) /*none*/
224 #define NoFibMultiModuleCompileAndRun_a(testname,runstdtest_opts) /*none*/
225 #define NoFibOneModuleCompileAndRun_a(testname,runopts) /*none*/
226 #define NoFibDependWay_a /*none*/
227 #endif /* ! NoFib_UserWay_a */
228
229 #if NoFib_UserWay_b == YES
230 #define NoFibHaskellCompile_b(test,module,isuf) \
231         NoFibHaskellCompile__(test,_b,$(HC_OPTS_b),module,isuf)
232 #define NoFibLinkPgm_b(target,progname,objlistvar) \
233         NoFibLinkPgm__(progname,_b,$(HC_OPTS_b),objlistvar)
234 #define NoFibRunPgm_b(test,prog,runstdtest_opts) \
235         NoFibRunPgm__(test,prog,_b,runstdtest_opts)
236 #define NoFibCleanupPgm_b(prog,objlistvar) \
237         NoFibCleanupPgm__(prog,_b,objlistvar)
238 #define NoFibMultiModuleCompileAndRun_b(testname,runstdtest_opts) \
239         NoFibMultiModuleCompileAndRun__(testname,_b,$(HC_OPTS_b),runstdtest_opts)
240 #define NoFibOneModuleCompileAndRun_b(testname,runopts) \
241         NoFibOneModuleCompileAndRun__(testname,runopts,_b,$(HC_OPTS_b))
242 #define NoFibDependWay_b -s_b
243
244 #else  /* ! NoFib_UserWay_b */
245 #define NoFibHaskellCompile_b(test,module,isuf) /*none*/
246 #define NoFibLinkPgm_b(target,progname,objlistvar) /*none*/
247 #define NoFibRunPgm_b(test,prog,runstdtest_opts) /*none*/
248 #define NoFibCleanupPgm_b(prog,objlistvar) /*none*/
249 #define NoFibMultiModuleCompileAndRun_b(testname,runstdtest_opts) /*none*/
250 #define NoFibOneModuleCompileAndRun_b(testname,runopts) /*none*/
251 #define NoFibDependWay_b /*none*/
252 #endif /* ! NoFib_UserWay_b */
253
254 #if NoFib_UserWay_c == YES
255 #define NoFibHaskellCompile_c(test,module,isuf) \
256         NoFibHaskellCompile__(test,_c,$(HC_OPTS_c),module,isuf)
257 #define NoFibLinkPgm_c(target,progname,objlistvar) \
258         NoFibLinkPgm__(progname,_c,$(HC_OPTS_c),objlistvar)
259 #define NoFibRunPgm_c(test,prog,runstdtest_opts) \
260         NoFibRunPgm__(test,prog,_c,runstdtest_opts)
261 #define NoFibCleanupPgm_c(prog,objlistvar) \
262         NoFibCleanupPgm__(prog,_c,objlistvar)
263 #define NoFibMultiModuleCompileAndRun_c(testname,runstdtest_opts) \
264         NoFibMultiModuleCompileAndRun__(testname,_c,$(HC_OPTS_c),runstdtest_opts)
265 #define NoFibOneModuleCompileAndRun_c(testname,runopts) \
266         NoFibOneModuleCompileAndRun__(testname,runopts,_c,$(HC_OPTS_c))
267 #define NoFibDependWay_c -s_c
268
269 #else  /* ! NoFib_UserWay_c */
270 #define NoFibHaskellCompile_c(test,module,isuf) /*none*/
271 #define NoFibLinkPgm_c(target,progname,objlistvar) /*none*/
272 #define NoFibRunPgm_c(test,prog,runstdtest_opts) /*none*/
273 #define NoFibCleanupPgm_c(prog,objlistvar) /*none*/
274 #define NoFibMultiModuleCompileAndRun_c(testname,runstdtest_opts) /*none*/
275 #define NoFibOneModuleCompileAndRun_c(testname,runopts) /*none*/
276 #define NoFibDependWay_c /*none*/
277 #endif /* ! NoFib_UserWay_c */
278
279 #if NoFib_UserWay_d == YES
280 #define NoFibHaskellCompile_d(test,module,isuf) \
281         NoFibHaskellCompile__(test,_d,$(HC_OPTS_d),module,isuf)
282 #define NoFibLinkPgm_d(target,progname,objlistvar) \
283         NoFibLinkPgm__(progname,_d,$(HC_OPTS_d),objlistvar)
284 #define NoFibRunPgm_d(test,prog,runstdtest_opts) \
285         NoFibRunPgm__(test,prog,_d,runstdtest_opts)
286 #define NoFibCleanupPgm_d(prog,objlistvar) \
287         NoFibCleanupPgm__(prog,_d,objlistvar)
288 #define NoFibMultiModuleCompileAndRun_d(testname,runstdtest_opts) \
289         NoFibMultiModuleCompileAndRun__(testname,_d,$(HC_OPTS_d),runstdtest_opts)
290 #define NoFibOneModuleCompileAndRun_d(testname,runopts) \
291         NoFibOneModuleCompileAndRun__(testname,runopts,_d,$(HC_OPTS_d))
292 #define NoFibDependWay_d -s_d
293
294 #else  /* ! NoFib_UserWay_d */
295 #define NoFibHaskellCompile_d(test,module,isuf) /*none*/
296 #define NoFibLinkPgm_d(target,progname,objlistvar) /*none*/
297 #define NoFibRunPgm_d(test,prog,runstdtest_opts) /*none*/
298 #define NoFibCleanupPgm_d(prog,objlistvar) /*none*/
299 #define NoFibMultiModuleCompileAndRun_d(testname,runstdtest_opts) /*none*/
300 #define NoFibOneModuleCompileAndRun_d(testname,runopts) /*none*/
301 #define NoFibDependWay_d /*none*/
302 #endif /* ! NoFib_UserWay_d */
303
304 #if NoFib_UserWay_e == YES
305 #define NoFibHaskellCompile_e(test,module,isuf) \
306         NoFibHaskellCompile__(test,_e,$(HC_OPTS_e),module,isuf)
307 #define NoFibLinkPgm_e(target,progname,objlistvar) \
308         NoFibLinkPgm__(progname,_e,$(HC_OPTS_e),objlistvar)
309 #define NoFibRunPgm_e(test,prog,runstdtest_opts) \
310         NoFibRunPgm__(test,prog,_e,runstdtest_opts)
311 #define NoFibCleanupPgm_e(prog,objlistvar) \
312         NoFibCleanupPgm__(prog,_e,objlistvar)
313 #define NoFibMultiModuleCompileAndRun_e(testname,runstdtest_opts) \
314         NoFibMultiModuleCompileAndRun__(testname,_e,$(HC_OPTS_e),runstdtest_opts)
315 #define NoFibOneModuleCompileAndRun_e(testname,runopts) \
316         NoFibOneModuleCompileAndRun__(testname,runopts,_e,$(HC_OPTS_e))
317 #define NoFibDependWay_e -s_e
318
319 #else  /* ! NoFib_UserWay_e */
320 #define NoFibHaskellCompile_e(test,module,isuf) /*none*/
321 #define NoFibLinkPgm_e(target,progname,objlistvar) /*none*/
322 #define NoFibRunPgm_e(test,prog,runstdtest_opts) /*none*/
323 #define NoFibCleanupPgm_e(prog,objlistvar) /*none*/
324 #define NoFibMultiModuleCompileAndRun_e(testname,runstdtest_opts) /*none*/
325 #define NoFibOneModuleCompileAndRun_e(testname,runopts) /*none*/
326 #define NoFibDependWay_e /*none*/
327 #endif /* ! NoFib_UserWay_e */
328
329 #if NoFib_UserWay_f == YES
330 #define NoFibHaskellCompile_f(test,module,isuf) \
331         NoFibHaskellCompile__(test,_f,$(HC_OPTS_f),module,isuf)
332 #define NoFibLinkPgm_f(target,progname,objlistvar) \
333         NoFibLinkPgm__(progname,$(HC_OPTS_f),_f,objlistvar)
334 #define NoFibRunPgm_f(test,prog,runstdtest_opts) \
335         NoFibRunPgm__(test,prog,_f,runstdtest_opts)
336 #define NoFibCleanupPgm_f(prog,objlistvar) \
337         NoFibCleanupPgm__(prog,_f,objlistvar)
338 #define NoFibMultiModuleCompileAndRun_f(testname,runstdtest_opts) \
339         NoFibMultiModuleCompileAndRun__(testname,_f,$(HC_OPTS_f),runstdtest_opts)
340 #define NoFibOneModuleCompileAndRun_f(testname,runopts) \
341         NoFibOneModuleCompileAndRun__(testname,runopts,_f,$(HC_OPTS_f)
342 #define NoFibDependWay_f -s_f
343
344 #else  /* ! NoFib_UserWay_f */
345 #define NoFibHaskellCompile_f(test,module,isuf) /*none*/
346 #define NoFibLinkPgm_f(target,progname,objlistvar) /*none*/
347 #define NoFibRunPgm_f(test,prog,runstdtest_opts) /*none*/
348 #define NoFibCleanupPgm_f(prog,objlistvar) /*none*/
349 #define NoFibMultiModuleCompileAndRun_f(testname,runstdtest_opts) /*none*/
350 #define NoFibOneModuleCompileAndRun_f(testname,runopts) /*none*/
351 #define NoFibDependWay_f /*none*/
352 #endif /* ! NoFib_UserWay_f */
353
354 #if NoFib_UserWay_g == YES
355 #define NoFibHaskellCompile_g(test,module,isuf) \
356         NoFibHaskellCompile__(test,_g,$(HC_OPTS_g),module,isuf)
357 #define NoFibLinkPgm_g(target,progname,objlistvar) \
358         NoFibLinkPgm__(progname,$(HC_OPTS_g),_g,objlistvar)
359 #define NoFibRunPgm_g(test,prog,runstdtest_opts) \
360         NoFibRunPgm__(test,prog,_g,runstdtest_opts)
361 #define NoFibCleanupPgm_g(prog,objlistvar) \
362         NoFibCleanupPgm__(prog,_g,objlistvar)
363 #define NoFibMultiModuleCompileAndRun_g(testname,runstdtest_opts) \
364         NoFibMultiModuleCompileAndRun__(testname,_g,$(HC_OPTS_g),runstdtest_opts)
365 #define NoFibOneModuleCompileAndRun_g(testname,runopts) \
366         NoFibOneModuleCompileAndRun__(testname,runopts,_g,$(HC_OPTS_g))
367 #define NoFibDependWay_g -s_g
368
369 #else  /* ! NoFib_UserWay_g */
370 #define NoFibHaskellCompile_g(test,module,isuf) /*none*/
371 #define NoFibLinkPgm_g(target,progname,objlistvar) /*none*/
372 #define NoFibRunPgm_g(test,prog,runstdtest_opts) /*none*/
373 #define NoFibCleanupPgm_g(prog,objlistvar) /*none*/
374 #define NoFibMultiModuleCompileAndRun_g(testname,runstdtest_opts) /*none*/
375 #define NoFibOneModuleCompileAndRun_g(testname,runopts) /*none*/
376 #define NoFibDependWay_g /*none*/
377 #endif /* ! NoFib_UserWay_g */
378
379 #if NoFib_UserWay_h == YES
380 #define NoFibHaskellCompile_h(test,module,isuf) \
381         NoFibHaskellCompile__(test,_h,$(HC_OPTS_h),module,isuf)
382 #define NoFibLinkPgm_h(target,progname,objlistvar) \
383         NoFibLinkPgm__(progname,_h,$(HC_OPTS_h),objlistvar)
384 #define NoFibRunPgm_h(test,prog,runstdtest_opts) \
385         NoFibRunPgm__(test,prog,_h,runstdtest_opts)
386 #define NoFibCleanupPgm_h(prog,objlistvar) \
387         NoFibCleanupPgm__(prog,_h,objlistvar)
388 #define NoFibMultiModuleCompileAndRun_h(testname,runstdtest_opts) \
389         NoFibMultiModuleCompileAndRun__(testname,_h,$(HC_OPTS_h),runstdtest_opts)
390 #define NoFibOneModuleCompileAndRun_h(testname,runopts) \
391         NoFibOneModuleCompileAndRun__(testname,runopts,_h,$(HC_OPTS_h))
392 #define NoFibDependWay_h -s_h
393
394 #else  /* ! NoFib_UserWay_h */
395 #define NoFibHaskellCompile_h(test,module,isuf) /*none*/
396 #define NoFibLinkPgm_h(target,progname,objlistvar) /*none*/
397 #define NoFibRunPgm_h(test,prog,runstdtest_opts) /*none*/
398 #define NoFibCleanupPgm_h(prog,objlistvar) /*none*/
399 #define NoFibMultiModuleCompileAndRun_h(testname,runstdtest_opts) /*none*/
400 #define NoFibOneModuleCompileAndRun_h(testname,runopts) /*none*/
401 #define NoFibDependWay_h /*none*/
402 #endif /* ! NoFib_UserWay_h */
403
404 #if NoFib_UserWay_i == YES
405 #define NoFibHaskellCompile_i(test,module,isuf) \
406         NoFibHaskellCompile__(test,_i,$(HC_OPTS_i),module,isuf)
407 #define NoFibLinkPgm_i(target,progname,objlistvar) \
408         NoFibLinkPgm__(progname,_i,$(HC_OPTS_i),objlistvar)
409 #define NoFibRunPgm_i(test,prog,runstdtest_opts) \
410         NoFibRunPgm__(test,prog,_i,runstdtest_opts)
411 #define NoFibCleanupPgm_i(prog,objlistvar) \
412         NoFibCleanupPgm__(prog,_i,objlistvar)
413 #define NoFibMultiModuleCompileAndRun_i(testname,runstdtest_opts) \
414         NoFibMultiModuleCompileAndRun__(testname,_i,$(HC_OPTS_i),runstdtest_opts)
415 #define NoFibOneModuleCompileAndRun_i(testname,runopts) \
416         NoFibOneModuleCompileAndRun__(testname,runopts,_i,$(HC_OPTS_i))
417 #define NoFibDependWay_i -s_i
418
419 #else  /* ! NoFib_UserWay_i */
420 #define NoFibHaskellCompile_i(test,module,isuf) /*none*/
421 #define NoFibLinkPgm_i(target,progname,objlistvar) /*none*/
422 #define NoFibRunPgm_i(test,prog,runstdtest_opts) /*none*/
423 #define NoFibCleanupPgm_i(prog,objlistvar) /*none*/
424 #define NoFibMultiModuleCompileAndRun_i(testname,runstdtest_opts) /*none*/
425 #define NoFibOneModuleCompileAndRun_i(testname,runopts) /*none*/
426 #define NoFibDependWay_i /*none*/
427 #endif /* ! NoFib_UserWay_i */
428
429 #if NoFib_UserWay_j == YES
430 #define NoFibHaskellCompile_j(test,module,isuf) \
431         NoFibHaskellCompile__(test,_j,$(HC_OPTS_j),module,isuf)
432 #define NoFibLinkPgm_j(target,progname,objlistvar) \
433         NoFibLinkPgm__(progname,_j,$(HC_OPTS_j),objlistvar)
434 #define NoFibRunPgm_j(test,prog,runstdtest_opts) \
435         NoFibRunPgm__(test,prog,_j,runstdtest_opts)
436 #define NoFibCleanupPgm_j(prog,objlistvar) \
437         NoFibCleanupPgm__(prog,_j,objlistvar)
438 #define NoFibMultiModuleCompileAndRun_j(testname,runstdtest_opts) \
439         NoFibMultiModuleCompileAndRun__(testname,_j,$(HC_OPTS_j),runstdtest_opts)
440 #define NoFibOneModuleCompileAndRun_j(testname,runopts) \
441         NoFibOneModuleCompileAndRun__(testname,runopts,_j,$(HC_OPTS_j))
442 #define NoFibDependWay_j -s_j
443
444 #else  /* ! NoFib_UserWay_j */
445 #define NoFibHaskellCompile_j(test,module,isuf) /*none*/
446 #define NoFibLinkPgm_j(target,progname,objlistvar) /*none*/
447 #define NoFibRunPgm_j(test,prog,runstdtest_opts) /*none*/
448 #define NoFibCleanupPgm_j(prog,objlistvar) /*none*/
449 #define NoFibMultiModuleCompileAndRun_j(testname,runstdtest_opts) /*none*/
450 #define NoFibOneModuleCompileAndRun_j(testname,runopts) /*none*/
451 #define NoFibDependWay_j /*none*/
452 #endif /* ! NoFib_UserWay_j */
453
454 #if NoFib_UserWay_k == YES
455 #define NoFibHaskellCompile_k(test,module,isuf) \
456         NoFibHaskellCompile__(test,_k,$(HC_OPTS_k),module,isuf)
457 #define NoFibLinkPgm_k(target,progname,objlistvar) \
458         NoFibLinkPgm__(progname,_k,$(HC_OPTS_k),objlistvar)
459 #define NoFibRunPgm_k(test,prog,runstdtest_opts) \
460         NoFibRunPgm__(test,prog,_k,runstdtest_opts)
461 #define NoFibCleanupPgm_k(prog,objlistvar) \
462         NoFibCleanupPgm__(prog,_k,objlistvar)
463 #define NoFibMultiModuleCompileAndRun_k(testname,runstdtest_opts) \
464         NoFibMultiModuleCompileAndRun__(testname,_k,$(HC_OPTS_k),runstdtest_opts)
465 #define NoFibOneModuleCompileAndRun_k(testname,runopts) \
466         NoFibOneModuleCompileAndRun__(testname,runopts,_k,$(HC_OPTS_k))
467 #define NoFibDependWay_k -s_k
468
469 #else  /* ! NoFib_UserWay_k */
470 #define NoFibHaskellCompile_k(test,module,isuf) /*none*/
471 #define NoFibLinkPgm_k(target,progname,objlistvar) /*none*/
472 #define NoFibRunPgm_k(test,prog,runstdtest_opts) /*none*/
473 #define NoFibCleanupPgm_k(prog,objlistvar) /*none*/
474 #define NoFibMultiModuleCompileAndRun_k(testname,runstdtest_opts) /*none*/
475 #define NoFibOneModuleCompileAndRun_k(testname,runopts) /*none*/
476 #define NoFibDependWay_k /*none*/
477 #endif /* ! NoFib_UserWay_k */
478
479 #if NoFib_UserWay_l == YES
480 #define NoFibHaskellCompile_l(test,module,isuf) \
481         NoFibHaskellCompile__(test,_l,$(HC_OPTS_l),module,isuf)
482 #define NoFibLinkPgm_l(target,progname,objlistvar) \
483         NoFibLinkPgm__(progname,_l,$(HC_OPTS_l),objlistvar)
484 #define NoFibRunPgm_l(test,prog,runstdtest_opts) \
485         NoFibRunPgm__(test,prog,_l,runstdtest_opts)
486 #define NoFibCleanupPgm_l(prog,objlistvar) \
487         NoFibCleanupPgm__(prog,_l,objlistvar)
488 #define NoFibMultiModuleCompileAndRun_l(testname,runstdtest_opts) \
489         NoFibMultiModuleCompileAndRun__(testname,_l,$(HC_OPTS_l),runstdtest_opts)
490 #define NoFibOneModuleCompileAndRun_l(testname,runopts) \
491         NoFibOneModuleCompileAndRun__(testname,runopts,_l,$(HC_OPTS_l))
492 #define NoFibDependWay_l -s_l
493
494 #else  /* ! NoFib_UserWay_l */
495 #define NoFibHaskellCompile_l(test,module,isuf) /*none*/
496 #define NoFibLinkPgm_l(target,progname,objlistvar) /*none*/
497 #define NoFibRunPgm_l(test,prog,runstdtest_opts) /*none*/
498 #define NoFibCleanupPgm_l(prog,objlistvar) /*none*/
499 #define NoFibMultiModuleCompileAndRun_l(testname,runstdtest_opts) /*none*/
500 #define NoFibOneModuleCompileAndRun_l(testname,runopts) /*none*/
501 #define NoFibDependWay_l /*none*/
502 #endif /* ! NoFib_UserWay_l */
503
504 #if NoFib_UserWay_m == YES
505 #define NoFibHaskellCompile_m(test,module,isuf) \
506         NoFibHaskellCompile__(test,_m,$(HC_OPTS_m),module,isuf)
507 #define NoFibLinkPgm_m(target,progname,objlistvar) \
508         NoFibLinkPgm__(progname,_m,$(HC_OPTS_m),objlistvar)
509 #define NoFibRunPgm_m(test,prog,runstdtest_opts) \
510         NoFibRunPgm__(test,prog,_m,runstdtest_opts)
511 #define NoFibCleanupPgm_m(prog,objlistvar) \
512         NoFibCleanupPgm__(prog,_m,objlistvar)
513 #define NoFibMultiModuleCompileAndRun_m(testname,runstdtest_opts) \
514         NoFibMultiModuleCompileAndRun__(testname,_m,$(HC_OPTS_m),runstdtest_opts)
515 #define NoFibOneModuleCompileAndRun_m(testname,runopts) \
516         NoFibOneModuleCompileAndRun__(testname,runopts,_m,$(HC_OPTS_m))
517 #define NoFibDependWay_m -s_m
518
519 #else  /* ! NoFib_UserWay_m */
520 #define NoFibHaskellCompile_m(test,module,isuf) /*none*/
521 #define NoFibLinkPgm_m(target,progname,objlistvar) /*none*/
522 #define NoFibRunPgm_m(test,prog,runstdtest_opts) /*none*/
523 #define NoFibCleanupPgm_m(prog,objlistvar) /*none*/
524 #define NoFibMultiModuleCompileAndRun_m(testname,runstdtest_opts) /*none*/
525 #define NoFibOneModuleCompileAndRun_m(testname,runopts) /*none*/
526 #define NoFibDependWay_m /*none*/
527 #endif /* ! NoFib_UserWay_m */
528
529 #if NoFib_UserWay_n == YES
530 #define NoFibHaskellCompile_n(test,module,isuf) \
531         NoFibHaskellCompile__(test,_n,$(HC_OPTS_n),module,isuf)
532 #define NoFibLinkPgm_n(target,progname,objlistvar) \
533         NoFibLinkPgm__(progname,_n,$(HC_OPTS_n),objlistvar)
534 #define NoFibRunPgm_n(test,prog,runstdtest_opts) \
535         NoFibRunPgm__(test,prog,_n,runstdtest_opts)
536 #define NoFibCleanupPgm_n(prog,objlistvar) \
537         NoFibCleanupPgm__(prog,_n,objlistvar)
538 #define NoFibMultiModuleCompileAndRun_n(testname,runstdtest_opts) \
539         NoFibMultiModuleCompileAndRun__(testname,_n,$(HC_OPTS_n),runstdtest_opts)
540 #define NoFibOneModuleCompileAndRun_n(testname,runopts) \
541         NoFibOneModuleCompileAndRun__(testname,runopts,_n,$(HC_OPTS_n))
542 #define NoFibDependWay_n -s_n
543
544 #else  /* ! NoFib_UserWay_n */
545 #define NoFibHaskellCompile_n(test,module,isuf) /*none*/
546 #define NoFibLinkPgm_n(target,progname,objlistvar) /*none*/
547 #define NoFibRunPgm_n(test,prog,runstdtest_opts) /*none*/
548 #define NoFibCleanupPgm_n(prog,objlistvar) /*none*/
549 #define NoFibMultiModuleCompileAndRun_n(testname,runstdtest_opts) /*none*/
550 #define NoFibOneModuleCompileAndRun_n(testname,runopts) /*none*/
551 #define NoFibDependWay_n /*none*/
552 #endif /* ! NoFib_UserWay_n */
553
554 #if NoFib_UserWay_o == YES
555 #define NoFibHaskellCompile_o(test,module,isuf) \
556         NoFibHaskellCompile__(test,_o,$(HC_OPTS_o),module,isuf)
557 #define NoFibLinkPgm_o(target,progname,objlistvar) \
558         NoFibLinkPgm__(progname,_o,$(HC_OPTS_o),objlistvar)
559 #define NoFibRunPgm_o(test,prog,runstdtest_opts) \
560         NoFibRunPgm__(test,prog,_o,runstdtest_opts)
561 #define NoFibCleanupPgm_o(prog,objlistvar) \
562         NoFibCleanupPgm__(prog,_o,objlistvar)
563 #define NoFibMultiModuleCompileAndRun_o(testname,runstdtest_opts) \
564         NoFibMultiModuleCompileAndRun__(testname,_o,$(HC_OPTS_o),runstdtest_opts)
565 #define NoFibOneModuleCompileAndRun_o(testname,runopts) \
566         NoFibOneModuleCompileAndRun__(testname,runopts,_o,$(HC_OPTS_o))
567 #define NoFibDependWay_o -s_o
568
569 #else  /* ! NoFib_UserWay_o */
570 #define NoFibHaskellCompile_o(test,module,isuf) /*none*/
571 #define NoFibLinkPgm_o(target,progname,objlistvar) /*none*/
572 #define NoFibRunPgm_o(test,prog,runstdtest_opts) /*none*/
573 #define NoFibCleanupPgm_o(prog,objlistvar) /*none*/
574 #define NoFibMultiModuleCompileAndRun_o(testname,runstdtest_opts) /*none*/
575 #define NoFibOneModuleCompileAndRun_o(testname,runopts) /*none*/
576 #define NoFibDependWay_o /*none*/
577 #endif /* ! NoFib_UserWay_o */
578 \end{code}
579
580 \begin{code}
581 #ifndef NoFibHaskellCompile
582 #define NoFibHaskellCompile(test,module,isuf)   \
583 NoFibHaskellCompile__(test,,$(HC_OPTS_std),module,isuf)         \
584 NoFibHaskellCompile_a(test,module,isuf)         \
585 NoFibHaskellCompile_b(test,module,isuf)         \
586 NoFibHaskellCompile_c(test,module,isuf)         \
587 NoFibHaskellCompile_d(test,module,isuf)         \
588 NoFibHaskellCompile_e(test,module,isuf)         \
589 NoFibHaskellCompile_f(test,module,isuf)         \
590 NoFibHaskellCompile_g(test,module,isuf)         \
591 NoFibHaskellCompile_h(test,module,isuf)         \
592 NoFibHaskellCompile_i(test,module,isuf)         \
593 NoFibHaskellCompile_j(test,module,isuf)         \
594 NoFibHaskellCompile_k(test,module,isuf)         \
595 NoFibHaskellCompile_l(test,module,isuf)         \
596 NoFibHaskellCompile_m(test,module,isuf)         \
597 NoFibHaskellCompile_n(test,module,isuf)         \
598 NoFibHaskellCompile_o(test,module,isuf)
599 #endif /* NoFibHaskellCompile */
600 \end{code}
601
602 \begin{code}
603 #ifndef NoFibLinkPgm
604 #define NoFibLinkPgm(target,progname,objlistvar)        \
605 NoFibLinkPgm__(target,progname,$(HC_OPTS_std),objlistvar)               \
606 NoFibLinkPgm_a(target,progname,objlistvar)              \
607 NoFibLinkPgm_b(target,progname,objlistvar)              \
608 NoFibLinkPgm_c(target,progname,objlistvar)              \
609 NoFibLinkPgm_d(target,progname,objlistvar)              \
610 NoFibLinkPgm_e(target,progname,objlistvar)              \
611 NoFibLinkPgm_f(target,progname,objlistvar)              \
612 NoFibLinkPgm_g(target,progname,objlistvar)              \
613 NoFibLinkPgm_h(target,progname,objlistvar)              \
614 NoFibLinkPgm_i(target,progname,objlistvar)              \
615 NoFibLinkPgm_j(target,progname,objlistvar)              \
616 NoFibLinkPgm_k(target,progname,objlistvar)              \
617 NoFibLinkPgm_l(target,progname,objlistvar)              \
618 NoFibLinkPgm_m(target,progname,objlistvar)              \
619 NoFibLinkPgm_n(target,progname,objlistvar)              \
620 NoFibLinkPgm_o(target,progname,objlistvar)
621 #endif /* NoFibLinkPgm */
622 \end{code}
623
624 \begin{code}
625 #ifndef NoFibRunPgm
626 #define NoFibRunPgm(test,prog,runstdtest_opts)  \
627 NoFibRunPgm__(test,prog,,runstdtest_opts)       \
628 NoFibRunPgm_a(test,prog,runstdtest_opts)        \
629 NoFibRunPgm_b(test,prog,runstdtest_opts)        \
630 NoFibRunPgm_c(test,prog,runstdtest_opts)        \
631 NoFibRunPgm_d(test,prog,runstdtest_opts)        \
632 NoFibRunPgm_e(test,prog,runstdtest_opts)        \
633 NoFibRunPgm_f(test,prog,runstdtest_opts)        \
634 NoFibRunPgm_g(test,prog,runstdtest_opts)        \
635 NoFibRunPgm_h(test,prog,runstdtest_opts)        \
636 NoFibRunPgm_i(test,prog,runstdtest_opts)        \
637 NoFibRunPgm_j(test,prog,runstdtest_opts)        \
638 NoFibRunPgm_k(test,prog,runstdtest_opts)        \
639 NoFibRunPgm_l(test,prog,runstdtest_opts)        \
640 NoFibRunPgm_m(test,prog,runstdtest_opts)        \
641 NoFibRunPgm_n(test,prog,runstdtest_opts)        \
642 NoFibRunPgm_o(test,prog,runstdtest_opts)
643 #endif /* NoFibRunPgm */
644 \end{code}
645
646 \begin{code}
647 #ifndef NoFibCleanupPgm
648 #define NoFibCleanupPgm(prog,objlistvar)        \
649 NoFibCleanupPgm__(prog,,objlistvar)             \
650 NoFibCleanupPgm_a(prog,objlistvar)              \
651 NoFibCleanupPgm_b(prog,objlistvar)              \
652 NoFibCleanupPgm_c(prog,objlistvar)              \
653 NoFibCleanupPgm_d(prog,objlistvar)              \
654 NoFibCleanupPgm_e(prog,objlistvar)              \
655 NoFibCleanupPgm_f(prog,objlistvar)              \
656 NoFibCleanupPgm_g(prog,objlistvar)              \
657 NoFibCleanupPgm_h(prog,objlistvar)              \
658 NoFibCleanupPgm_i(prog,objlistvar)              \
659 NoFibCleanupPgm_j(prog,objlistvar)              \
660 NoFibCleanupPgm_k(prog,objlistvar)              \
661 NoFibCleanupPgm_l(prog,objlistvar)              \
662 NoFibCleanupPgm_m(prog,objlistvar)              \
663 NoFibCleanupPgm_n(prog,objlistvar)              \
664 NoFibCleanupPgm_o(prog,objlistvar)
665 #endif /* NoFibCleanupPgm */
666 \end{code}
667
668 \begin{code}
669 #ifndef NoFibMultiModuleCompileAndRun
670 #define NoFibMultiModuleCompileAndRun(testname,runstdtest_opts) @@\
671                                                                 @@\
672 OBJS_O_a = $(OBJS_O:.o=_a.o)                                    @@\
673 OBJS_O_b = $(OBJS_O:.o=_b.o)                                    @@\
674 OBJS_O_c = $(OBJS_O:.o=_c.o)                                    @@\
675 OBJS_O_d = $(OBJS_O:.o=_d.o)                                    @@\
676 OBJS_O_e = $(OBJS_O:.o=_e.o)                                    @@\
677 OBJS_O_f = $(OBJS_O:.o=_f.o)                                    @@\
678 OBJS_O_g = $(OBJS_O:.o=_g.o)                                    @@\
679 OBJS_O_h = $(OBJS_O:.o=_h.o)                                    @@\
680 OBJS_O_i = $(OBJS_O:.o=_i.o)                                    @@\
681 OBJS_O_j = $(OBJS_O:.o=_j.o)                                    @@\
682 OBJS_O_k = $(OBJS_O:.o=_k.o)                                    @@\
683 OBJS_O_l = $(OBJS_O:.o=_l.o)                                    @@\
684 OBJS_O_m = $(OBJS_O:.o=_m.o)                                    @@\
685 OBJS_O_n = $(OBJS_O:.o=_n.o)                                    @@\
686 OBJS_O_o = $(OBJS_O:.o=_o.o)                                    @@\
687                                                                 @@\
688 SuffixRule_o_hi() /* ToDo: this looks semi-useless */           \
689                                                                 @@\
690 runtests ::                                                     @@\
691         @echo ==nofib== testname\: running in $(CURRENT_DIR)    \
692 NoFibMultiModuleCompileAndRun__(testname,,$(HC_OPTS_std),runstdtest_opts)       \
693 NoFibMultiModuleCompileAndRun_a(testname,runstdtest_opts)       \
694 NoFibMultiModuleCompileAndRun_b(testname,runstdtest_opts)       \
695 NoFibMultiModuleCompileAndRun_c(testname,runstdtest_opts)       \
696 NoFibMultiModuleCompileAndRun_d(testname,runstdtest_opts)       \
697 NoFibMultiModuleCompileAndRun_e(testname,runstdtest_opts)       \
698 NoFibMultiModuleCompileAndRun_f(testname,runstdtest_opts)       \
699 NoFibMultiModuleCompileAndRun_g(testname,runstdtest_opts)       \
700 NoFibMultiModuleCompileAndRun_h(testname,runstdtest_opts)       \
701 NoFibMultiModuleCompileAndRun_i(testname,runstdtest_opts)       \
702 NoFibMultiModuleCompileAndRun_j(testname,runstdtest_opts)       \
703 NoFibMultiModuleCompileAndRun_k(testname,runstdtest_opts)       \
704 NoFibMultiModuleCompileAndRun_l(testname,runstdtest_opts)       \
705 NoFibMultiModuleCompileAndRun_m(testname,runstdtest_opts)       \
706 NoFibMultiModuleCompileAndRun_n(testname,runstdtest_opts)       \
707 NoFibMultiModuleCompileAndRun_o(testname,runstdtest_opts)
708 #endif /* NoFibMultiModuleCompileAndRun */
709 \end{code}
710
711 \begin{code}
712 #ifndef NoFibOneModuleCompileAndRun
713 #define NoFibOneModuleCompileAndRun(testname,runopts) @@\
714 OBJS_O = Main.o                                 @@\
715                                                 @@\
716 OBJS_O_a = $(OBJS_O:.o=_a.o)                    @@\
717 OBJS_O_b = $(OBJS_O:.o=_b.o)                    @@\
718 OBJS_O_c = $(OBJS_O:.o=_c.o)                    @@\
719 OBJS_O_d = $(OBJS_O:.o=_d.o)                    @@\
720 OBJS_O_e = $(OBJS_O:.o=_e.o)                    @@\
721 OBJS_O_f = $(OBJS_O:.o=_f.o)                    @@\
722 OBJS_O_g = $(OBJS_O:.o=_g.o)                    @@\
723 OBJS_O_h = $(OBJS_O:.o=_h.o)                    @@\
724 OBJS_O_i = $(OBJS_O:.o=_i.o)                    @@\
725 OBJS_O_j = $(OBJS_O:.o=_j.o)                    @@\
726 OBJS_O_k = $(OBJS_O:.o=_k.o)                    @@\
727 OBJS_O_l = $(OBJS_O:.o=_l.o)                    @@\
728 OBJS_O_m = $(OBJS_O:.o=_m.o)                    @@\
729 OBJS_O_n = $(OBJS_O:.o=_n.o)                    @@\
730 OBJS_O_o = $(OBJS_O:.o=_o.o)                    \
731                                                 \
732 NoFibOneModuleCompileAndRun__(testname,runopts,,$(HC_OPTS_std)) \
733 NoFibOneModuleCompileAndRun_a(testname,runopts) \
734 NoFibOneModuleCompileAndRun_b(testname,runopts) \
735 NoFibOneModuleCompileAndRun_c(testname,runopts) \
736 NoFibOneModuleCompileAndRun_d(testname,runopts) \
737 NoFibOneModuleCompileAndRun_e(testname,runopts) \
738 NoFibOneModuleCompileAndRun_f(testname,runopts) \
739 NoFibOneModuleCompileAndRun_g(testname,runopts) \
740 NoFibOneModuleCompileAndRun_h(testname,runopts) \
741 NoFibOneModuleCompileAndRun_i(testname,runopts) \
742 NoFibOneModuleCompileAndRun_j(testname,runopts) \
743 NoFibOneModuleCompileAndRun_k(testname,runopts) \
744 NoFibOneModuleCompileAndRun_l(testname,runopts) \
745 NoFibOneModuleCompileAndRun_m(testname,runopts) \
746 NoFibOneModuleCompileAndRun_n(testname,runopts) \
747 NoFibOneModuleCompileAndRun_o(testname,runopts)
748 #endif /* NoFibOneModuleCompileAndRun */
749 \end{code}
750
751 @NoFibDependTarget@: generate rules to compute dependencies for all
752 Haskell files in @deps@.
753 \begin{code}
754 #ifndef NoFibDependWays
755 #define NoFibDependWays \
756 NoFibDependWay_a NoFibDependWay_b NoFibDependWay_c \
757 NoFibDependWay_d NoFibDependWay_e NoFibDependWay_f \
758 NoFibDependWay_g NoFibDependWay_h NoFibDependWay_i \
759 NoFibDependWay_j NoFibDependWay_k NoFibDependWay_l \
760 NoFibDependWay_m NoFibDependWay_n NoFibDependWay_o
761 #endif
762
763 #ifndef NoFibDependTarget
764 #define NoFibDependTarget(test,deps)                            @@\
765 MkDependHSNeededHere(depend)                                    @@\
766                                                                 @@\
767 MKDEPENDWAYFLAGS = NoFibDependWays                              @@\
768                                                                 @@\
769 depend:: deps                                                   @@\
770         $(MKDEPENDHS) $(MKDEPENDWAYFLAGS) $(MKDEPENDHSFLAGS) -- $(HCFLAGS) $(CAT2(HC_OPTS_,test)) -- deps
771 #endif /* NoFibDependTarget */
772 \end{code}
773