[project @ 2001-10-23 14:45:32 by rrt]
[ghc-hetmet.git] / mk / config.mk.in
1 #                                                                -*-makefile-*-
2 # @configure_input@
3 #
4 ################################################################################
5 #
6 #                       config.mk.in-template
7 #
8 #       This file defines all the variables that set the configuration of
9 #       a particular build.
10 #
11 #
12 ################################################################################
13
14 # The configuration is defined in two steps:
15 #
16 #       1. The builder (i.e. the person doing the build)
17 #          copies this file, config.mk.in-template
18 #          to config.mk.in
19 #
20 #       2. S/he then edits it manually (gasp) to reflect any configuration
21 #          options s/he wants.
22 #
23 #       3. Then s/he runs "configure", which generates config.mk from
24 #          config.mk.in, substituting for system/platform-dependent things
25 #          enclosed in @at-signs@.
26 #
27 # This is one of only two files that configure generates (the other is config.h)
28 #
29 # Note that after subsequent edits of config.mk.in for a build, the configure script
30 # will have to be re-run manually to have the change reflected in config.mk. 
31 #
32
33 # There is a section below for each project within the fptools suite
34 #
35 #       PLUS
36 #
37 # a section corresponding to each of the main .mk files 
38 # included by boilerplate.mk (see boilerplate.mk for a list).
39
40
41 ################################################################################
42 #
43 #               Project-wide platform variables
44 #
45 ################################################################################
46
47 # A "platform" is the GNU cpu-type/manufacturer/operating-system target machine
48 # specifier.  E.g. sparc-sun-solaris2
49
50 HOSTPLATFORM                    = @HostPlatform@
51 TARGETPLATFORM                  = @TargetPlatform@
52 BUILDPLATFORM                   = @HostPlatform@
53
54 # Hack alert:
55 # in one or two places, we need to get at the OS version (major and perhaps even minor),
56 # HostOS_Full is the OS name reported by AC_CANONICAL_SYSTEM.
57 #
58 HostPlatform_CPP                = @HostPlatform_CPP@
59 HostArch_CPP                    = @HostArch_CPP@
60 HostOS_CPP                      = @HostOS_CPP@
61 HostOS_Full                     = @HostOS_Full@
62 HostVendor_CPP                  = @HostVendor_CPP@
63
64 #
65 # ToDo: check if these can be purged now. -- sof
66 #
67
68 @HostPlatform_CPP@_HOST        = 1
69 @HostPlatform_CPP@_TARGET      = 1
70 @HostPlatform_CPP@_BUILD       = 1
71
72 @HostArch_CPP@_HOST_ARCH       = 1
73 @HostArch_CPP@_TARGET_ARCH      = 1
74 @HostArch_CPP@_BUILD_ARCH      = 1
75
76 @HostOS_CPP@_HOST_OS           = 1
77 @HostOS_CPP@_TARGET_OS         = 1
78 @HostOS_CPP@_BUILD_OS          = 1
79
80 @HostVendor_CPP@_HOST_VENDOR    = 1
81 @HostVendor_CPP@_TARGET_VENDOR  = 1
82 @HostVendor_CPP@_BUILD_VENDOR   = 1
83
84 # Leading underscores on symbol names in object files
85 # Valid options: YES/NO
86 #
87 LeadingUnderscore=@LeadingUnderscore@
88
89 # Pin a suffix on executables? If so, what (Windows only).
90 exeext=@exeext@
91
92 ################################################################################
93 #
94 #               project-wide flags
95 #
96 #       Set of options applicable to all fptools projects
97 #
98 ################################################################################
99
100 # BootingFromHc - build GHC and the libraries from .hc files?
101 BootingFromHc = @BootingFromHc@
102
103 # BootingFromUnregisterisedHc - treat .hc files as containing unregisterised
104 # rather than registerised code, i.e., disable the mangler?
105 BootingFromUnregisterisedHc = @BootingFromUnregisterisedHc@
106
107 # build the libs first if we're bootstrapping from .hc files
108 ifeq "$(BootingFromHc)" "YES"
109 AllProjects = glafp-utils hslibs ghc green-card happy hdirect hood nofib
110 else
111 AllProjects = glafp-utils ghc hslibs green-card happy hdirect hood nofib
112 endif
113
114 #
115 # (OPTIONAL) set ProjectsToBuild to a list of projects to be built.  If this
116 # list is empty, then all projects present in the source tree will be built.
117 #
118 ProjectsToBuild =
119
120 #
121 # set ProjectsDontInstall to a list of projects which are normally built but
122 # not installed.
123 #
124 ProjectsDontInstall = glafp-utils nofib
125
126 #
127 # Should the various project tests directories be built?
128 #
129 IncludeTestDirsInBuild=NO
130
131 #
132 # Which ways should SGML documents be built?
133 # options are: dvi ps pdf html rtf
134 #
135 SGMLDocWays=
136
137 ################################################################################
138 #
139 #               GHC project
140
141 #       Set of (configurable) options needed by the ghc tree
142 #       plus their default options (if any).
143 #
144 ################################################################################
145
146 #---------------------------------------------------------------
147 #
148 # Variables that control how the compiler itself is built
149 #
150 #---------------------------------------------------------------
151
152 # The compiler used to build GHC is $(GHC).  To change the actual compiler
153 # used, re-configure with --with-ghc=<path-to-ghc>.
154
155 # Extra ways in which to build the compiler (for example, you might want to
156 # build a profiled compiler so you can see where it spends its time)
157 GhcCompilerWays=
158
159 # Extra option flags to pass to the compiler that compiles the compiler
160 # (Ones that are essential are wired into ghc/compiler/Makefile)
161 # Typical options to use here:
162 #
163 #       -DDEBUG         include debugging code and assertions (will make the
164 #                       compiler slower and produce debugging output, but useful
165 #                       for development)
166 #
167 #       -dcore-lint     check the types after every pass of the compiler;
168 #                       a pretty strong internal check of the compiler being
169 #                       used to compile GHC.  Useful when bootstrapping.
170 GhcHcOpts=-Rghc-timing
171
172 # Extra Haskell compiler options to use when compiling all Haskell
173 # *programs* (not libraries), including GHC itself.
174 # Typical options to use here:
175 #
176 #       -H25m           use a bigger heap (to speed up compilation)
177 #
178 #       -O              compile an optimised compiler
179 #
180 FptoolsHcOpts=-O
181
182 # Build a compiler that will build *unregisterised* libraries and
183 # binaries by default.  Unregisterised code is supposed to compile and
184 # run without any support for architecture-specific assembly mangling,
185 # register assignment or tail-calls, and is therefore a good way to get
186 # started when porting GHC to new architectures.
187 #
188 # If this is set to NO, you can still use the unregisterised way
189 # (way 'u') to get unregisterised code, but the default way will be
190 # registerised.
191 #
192 # NOTE: this is not the same as building the compiler itself
193 # unregisterised.  That's done by either (a) bootstrapping with a
194 # compiler that was built with GhcUnregisterized=YES, or (b)
195 # bootstrapping with a compiler that has way 'u' libraries, and the
196 # flag '-unreg' is added to GhcHcOpts above.
197 #
198 GhcUnregisterised=NO
199
200 # Build a compiler with a native code generator backend
201 # (as well as a C backend)
202 #
203 # Target platforms supported:
204 #   i386 & sparc
205 ifneq "$(findstring $(HostArch_CPP), i386 sparc)" ""
206 GhcWithNativeCodeGen=YES
207 else
208 GhcWithNativeCodeGen=NO
209 endif
210
211 HaveLibDL = @HaveLibDL@
212
213 # Include GHCi in the compiler.  Default to NO for the time being.
214
215 ifneq "$(findstring $(HostOS_CPP), mingw32 linux solaris2 freebsd netbsd openbsd)" ""
216 GhcWithInterpreter=YES
217 ifeq "$(HaveLibDL)" "YES"
218 SRC_HC_OPTS += -ldl
219 endif
220 else 
221 GhcWithInterpreter=NO
222 endif
223
224 #
225 # Building various ways?
226 # (right now, empty if not).
227 BuildingParallel=$(subst mp,YES,$(filter mp,$(WAYS)))
228 BuildingGranSim=$(subst mg,YES,$(filter mg,$(WAYS)))
229
230 #------------------------------------------------------------------------------
231 # Options for GHC's Prelude
232
233 # What extra ways to build the libraries in
234 # In addition to the normal sequential way, the default is to also build
235 # profiled prelude libraries.
236 # When booting from .hc files, turn this off.
237 ifeq "$(BootingFromHc)" "YES"
238 GhcLibWays=
239 else
240 GhcLibWays=p
241 endif
242
243 # Option flags to pass to GHC when it's compiling prelude modules
244 # *and* standard library modules (std) *and* modules in hslibs
245 # Typically these are things like -O or -dcore-lint
246 # The ones that are *essential* are wired into ghc/lib/Makefile
247 #
248 #       -O is pretty desirable, otherwise no inlining of prelude
249 #               things (incl "+") happens when compiling with this compiler
250
251 GhcLibHcOpts=-O -Rghc-timing
252
253 # Win32 only: Enable the RTS and libraries to be built as DLLs
254 DLLized=@EnableWin32DLLs@
255
256 # Win32 only: are we building a compiler that tries to reduce external
257 # dependencies? i.e., one that doesn't assume that the user has got
258 # the cygwin toolchain installed on his/her Win32 box.
259 #
260 # GHC is still dependent on GNU tools in the backend (gcc to further process
261 # .c/.hc/.s/.o files + 'perl' to mangle and split), but using this
262 # option a GHC distribution can be put together which includes a minimal
263 # set of these open source tools. 
264 #
265 MinimalUnixDeps=@MinimalUnixDeps@
266
267 # Don't split object files for libs if we're building DLLs, or booting from
268 # .hc files.
269 SplitObjs=YES
270
271 ifeq "$(DLLized)" "YES"
272 SplitObjs=NO
273 endif
274 ifeq "$(BootingFromHc)" "YES"
275 SplitObjs=NO
276 endif
277 ifeq "$(GhcUnregisterised)" "YES"
278 SplitObjs=NO
279 endif
280
281 # Strip local symbols from libraries?  This can make the libraries smaller,
282 # but makes debugging somewhat more difficult.  Doesn't work with all ld's.
283 #
284 StripLibraries=NO
285
286 # ----------------------------------------------------------------------------
287 # Options for GHC's RTS
288
289 # This is a good way to set things like -optc-g and -optc-DDEBUG for the RTS.
290 # GhcRtsHcOpts is used when compiling .hc files and .c files.
291 # GhcRtsCcOpts is used when compiling .c  files only.
292
293 # For a debugging RTS:
294 # GhcRtsHcOpts = -optc-DDEBUG
295 # GhcRtsCcOpts = -g
296
297 # For an optimised RTS:
298 GhcRtsHcOpts=-O2
299 GhcRtsCcOpts=-O2 -fomit-frame-pointer
300
301 # Include the front panel code?  Needs GTK+.
302 GhcRtsWithFrontPanel = NO
303
304 ################################################################################
305 #
306 #               hslibs project
307 #
308 ################################################################################
309
310 # Build HsLibs for which compiler?  
311
312 # If $(HsLibsFor) == hugs or ghc, we assume we're building for the
313 # compiler/interpreter in the same source tree.
314
315 # HsLibsFor = ghc | hugs | nhc | hbc
316 HsLibsFor       = ghc
317
318 # hslibs for GHC also uses the following variables (defined above):
319 #   GhcLibWays, GhcLibHcOpts, GhcLibToolsHcOpts, DLLized, StripLibraries
320
321 # Build the Haskell Readline bindings?
322 #
323 GhcLibsWithReadline=@HaveReadlineHeaders@
324
325 # Libraries needed for linking with readline
326 LibsReadline=@LibsReadline@
327
328 # Include path to readline.h
329 # (no path == in standard include path)
330 #
331 ReadlineIncludePath=
332
333 # Math library
334 LIBM=@LIBM@
335
336 # Build the Haskell OpenGL/GLUT binding?
337 #
338 GhcLibsWithHOpenGL=@GhcLibsWithHOpenGL@
339
340 X_CFLAGS=@X_CFLAGS@
341 X_LIBS=@X_LIBS@
342
343 ################################################################################
344 #
345 #               happy project
346 #
347 #       Happy specific options
348 #
349 ################################################################################
350
351 # The compiler you'd like to use to compile Happy
352 WithHappyHc = @WithHc@
353
354 # HappyHcOpts gives the flags to pass to the Haskell compiler used
355 #             to compile the Happy sources with.
356 #
357 HappyHcOpts = -O
358
359 ################################################################################
360 #
361 #               haggis project
362 #
363 #       Haggis specific options
364 #
365 ################################################################################
366
367 ################################################################################
368 #
369 #               green-card project
370 #
371 #       Green-card specific options
372 #
373 ################################################################################
374
375 ################################################################################
376 #
377 #               nofib project
378 #
379 #       nofib specific options
380 #
381 ################################################################################
382
383 WithNofibHc = $(GHC_INPLACE)
384
385 # NoFibSubDirs controls which set of tests should be run
386 # You can run one or more of
387 #       imaginary 
388 #       spectral
389 #       real
390 #       parallel
391 #       PRIVATE
392 #       PENDING
393 #       UNUSED
394 NoFibSubDirs = imaginary spectral real
395
396 # The different ways to build nofib. Default is just to mirror
397 # what is done for the ghc prelude libraries.
398 #
399 NoFibWays = $(GhcLibWays)
400
401 # Haskell compiler options for nofib
402 NoFibHcOpts = -O
403
404 # ==============================================================================
405 #
406 #                       END OF PROJECT-SPECIFIC STUFF
407 #
408 #               Now come the generic configuration options
409 #
410 # ==============================================================================
411
412 ################################################################################
413 #
414 #               Paths (see paths.mk)
415 #
416 ################################################################################
417
418 # Directory used by GHC (and possibly other tools) for storing
419 # temporary files.  If your TMPDIR isn't big enough, either override
420 # this in build.mk or set your environment variable "TMPDIR" to point
421 # to somewhere with more space.  (TMPDIR=. is a good choice).
422
423 # DEFAULT_TMPDIR isn't called TMPDIR because GNU make tends to
424 # override an environment variable with the value of the make variable
425 # of the same name (if it exists) when executing sub-processes, so
426 # setting the TMPDIR env var would have no effect in the build tree.
427
428 DEFAULT_TMPDIR          = /tmp
429 ifeq "$(TARGETPLATFORM)" "i386-unknown-cygwin32"
430 DEFAULT_TMPDIR          = C:/TEMP
431 endif
432 ifeq "$(TARGETPLATFORM)" "i386-unknown-mingw32"
433 DEFAULT_TMPDIR          = C:/TEMP
434 endif
435
436 # FPTOOLS_TOP: the top of the fptools hierarchy, absolute path.
437
438 ifeq "$(findstring $(TARGETPLATFORM), i386-unknown-cygwin32 i386-unknown-mingw32)" ""
439 FPTOOLS_TOP_ABS         = @hardtop@
440 else
441 FPTOOLS_TOP_ABS         = $(subst \,/,$(shell cygpath -w @hardtop@))
442 endif
443 # Keep the Unix-style path to use with Unix tools (e.g. in ghc-inplace script)
444 FPTOOLS_TOP_ABS_UNIX    = @hardtop@
445
446 #
447 # Installation directories, we don't use half of these,
448 # but since the configure script has them on offer while
449 # passing through, we might as well set them.
450
451 prefix                  = @prefix@
452 exec_prefix             = @exec_prefix@
453 bindir                  = @bindir@
454 datadir                 = @datadir@
455
456 #sysconfdir             = @datadir@
457 #sharedstatedir         = @sharedstatedir@
458 #localstatedir          = @localstatedir@
459 libdir                  = @libdir@
460 includedir              = @includedir@
461 oldincludedir           = @oldincludedir@
462 mandir                  = @mandir@
463
464 #UNUSED:infodir         = @infodir@
465 #UNUSED:srcdir          = @srcdir@
466
467 #
468 # override libdir and datadir to put project-specific stuff in
469 # a subdirectory with the version number included.
470 #
471 libdir     := $(if $(ProjectNameShort),$(libdir)/$(ProjectNameShort)-$(ProjectVersion),$(libdir))
472 datadir    := $(if $(ProjectNameShort),$(datadir)/$(ProjectNameShort)-$(ProjectVersion),$(datadir))
473
474
475 # Default values for most of the above are only set if
476 # they weren't configured to anything in particular
477 # via the configure script. (i.e., we make no assumption
478 # that the autoconf-generated script will assign defaults
479 # to all of the above).
480 #
481 ifeq "$(strip $(exec_prefix))" ""
482 exec_prefix             = $(prefix)
483 endif
484 ifeq "$(strip $(bindir))" ""
485 bindir                  = $(exec_prefix)/bin
486 endif
487
488 #
489 # NOTE: by intention, libexecdir and libdir point to 
490 # the same place.
491 #  => Only way to override this is to set libexecdir= on the command line.
492 #     (NOTE: configure script setting is ignored).
493 libexecdir              = $(libdir)
494
495 ifeq "$(strip $(datadir))" ""
496 datadir         = $(prefix)/share
497 endif
498 ifeq "$(strip $(libdir))" ""
499 libdir          = $(exec_prefix)/lib
500 endif
501 ifeq "$(strip $(includedir))" ""
502 includedir      = $(prefix)/include
503 endif
504 ifeq "$(strip $(oldincludedir))" ""
505 oldincludedir   = /usr/include
506 endif
507 ifeq "$(strip $(mandir))" ""
508 mandir          = $(prefix)/man
509 endif
510
511
512 ################################################################################
513 #
514 #               Utilities programs: flags
515 #
516 ################################################################################
517
518 # If you want to give any standard flags to pretty much any utility
519 # (see utils.mk for a complete list), by adding a line here
520 #
521 #       SRC_P_OPTS += ...
522 #
523 # where P is the utility. For example, to add -O to all Haskell
524 # compilations, 
525 #
526 #       SRC_HC_OPTS += -O
527
528 # These flags make flex 8-bit
529 SRC_FLEX_OPTS   += -8
530
531 SRC_INSTALL_BIN_OPTS    += -s
532
533 # lint gets all CPP's flags too
534 SRC_LINT_OPTS           += -axz -DLINT $(SRC_CPP_OPTS)
535 WAY$(_way)_LINT_OPTS    += WAY$(_way)_CPP_OPTS
536
537 # Default fptools options for dllwrap.
538 SRC_BLD_DLL_OPTS += -mno-cygwin --target=i386-mingw32
539
540 # Flags for CPP when running GreenCard on .pgc files
541 GC_CPP_OPTS += -P -E -x c -traditional -D__GLASGOW_HASKELL__
542
543
544 ################################################################################
545 #
546 #               Utilities programs: where to find them
547 #
548 ################################################################################
549
550 #-----------------------------------------------------------------------------
551 # FPtools Utility locations
552
553 # By default, the various utils needed to be build ghc and chums
554 # is set up to point to the utils/ directory. Define here the
555 # path prefix for the utilities. Notice that it's a prefix with
556 # a trailing slash, so that it can be concatenated directly on
557 # front of a program name; if it's not set then we just look
558 # along the shell's $(PATH)
559 #
560 # If instead you want to use installed or your own versions of these,
561 # override the various *_PREFIX in build.mk, i.e., having the following
562 # in build.mk:
563 #
564 #   MKDEPENDC_PREFIX=
565 #
566 # will force `make' to rummage around in your PATH to find `mkdependC' (not
567 # sure it would need it in the first place, but still).
568 #
569 GLAFP_UTILS             = $(FPTOOLS_TOP)/glafp-utils
570
571 SCRIPT_PREFIX           = $(GLAFP_UTILS)/scripts/
572 MKDEPENDC_PREFIX        = $(GLAFP_UTILS)/mkdependC/
573 LTX_PREFIX              = $(GLAFP_UTILS)/ltx/
574 RUNTEST_PREFIX          = $(GLAFP_UTILS)/runstdtest/
575 VERBATIM_PREFIX         = $(GLAFP_UTILS)/verbatim/
576 SGMLVERB_PREFIX         = $(GLAFP_UTILS)/sgmlverb/
577 ETAGS_PREFIX            = $(GLAFP_UTILS)/etags/
578 MSUB_PREFIX             = $(GLAFP_UTILS)/msub/
579 LNDIR_PREFIX            = $(GLAFP_UTILS)/lndir/
580 MKDIRHIER_PREFIX        = $(GLAFP_UTILS)/mkdirhier/
581 DOCBOOK_PREFIX          = $(GLAFP_UTILS)/docbook/
582
583 LITERATE_PREFIX         = $(FPTOOLS_TOP)/literate/
584
585 HAPPY_PREFIX            = $(FPTOOLS_TOP)/happy/src/
586 GREENCARD_PREFIX        = $(FPTOOLS_TOP)/green-card/src/
587
588 UNLIT_PREFIX            = $(FPTOOLS_TOP)/ghc/utils/unlit/
589 HP2PS_PREFIX            = $(FPTOOLS_TOP)/ghc/utils/hp2ps/
590 HSTAGS_PREFIX           = $(FPTOOLS_TOP)/ghc/utils/hstags/
591 HSC2HS_PREFIX           = $(FPTOOLS_TOP)/ghc/utils/hsc2hs/
592
593 #-----------------------------------------------------------------------------
594 # Haskell compilers and mkdependHS
595
596 # $(GHC), $(HBC) and $(NHC) point to installed versions of the relevant
597 # compilers, if available.
598 #
599 # $(HC) is a generic Haskell 98 compiler, set to $(GHC) by default.
600 # $(MKDEPENDHS) is the Haskell dependency generator (ghc -M).
601 #
602 # NOTE: Don't override $(GHC) in build.mk, use configure --with-ghc instead
603 # (because the version numbers have to be calculated).
604
605 GHC             = @WithGhc@
606 GhcVersion      = @GhcVersion@
607 GhcMajVersion   = @GhcMajVersion@
608 GhcMinVersion   = @GhcMinVersion@
609 GhcPatchLevel   = @GhcPatchLevel@
610
611 HBC             = @HBC@
612 NHC             = @NHC@
613
614 HC              = @WithHc@
615 MKDEPENDHS      = $(GHC)
616
617 # Sometimes we want to invoke ghc from the build tree in different
618 # projects (eg. it's handy to have a nofib & a ghc build in the same
619 # tree).  We can refer to "this ghc" as $(GHC_INPLACE):
620
621 GHC_INPLACE     = $(FPTOOLS_TOP)/ghc/compiler/ghc-inplace
622
623 #-----------------------------------------------------------------------------
624 # C compiler
625 #
626 # NB. Don't override $(WhatGccIsCalled) using build.mk,  re-configure using
627 # the flag --with-gcc=<blah> instead.  The reason is that the configure script
628 # needs to know which gcc you're using in order to perform its tests.
629
630 HaveGcc         = @HaveGcc@
631 UseGcc          = YES
632 WhatGccIsCalled = @WhatGccIsCalled@
633 ifeq "$(strip $(HaveGcc))" "YES"
634 ifneq "$(strip $(UseGcc))"  "YES"
635   CC    = cc
636 else
637   CC    = $(WhatGccIsCalled)
638 endif
639 endif
640
641 # default C compiler flags
642 SRC_CC_OPTS = @SRC_CC_OPTS@
643
644 #-----------------------------------------------------------------------------
645 # GMP Library (version 2.0.x or above)
646 #
647 HaveLibGmp      = @HaveLibGmp@
648 LibGmp          = @LibGmp@
649
650 #-----------------------------------------------------------------------------
651 # Regex library 
652 # (if present in libc use that one, otherwise use the one in the tree)
653 #
654 HaveRegex       = @HaveRegex@
655
656 #-----------------------------------------------------------------------------
657 # GTK+
658
659 GTK_CONFIG              = @GTK_CONFIG@
660 GTK_VERSION             = @GTK_VERSION@
661
662 #-----------------------------------------------------------------------------
663 # Flex
664
665 FLEX                    = @LEX@
666 # Don't bother with -lfl, we define our own yywrap()s anyway.
667 FLEX_LIB                = 
668 #WAS:FLEX_LIB           = @LEXLIB@
669
670 #-----------------------------------------------------------------------------
671 # Other standard (ha!) Unix utilities
672
673 AR                      = @ArCmd@
674 ArSupportsInput         = @ArSupportsInput@
675 # Yuckage: for ghc/utils/parallel -- todo: nuke this dependency!!
676 BASH                    = /usr/local/bin/bash
677 #
678 # Could be either gzip or compress
679 #
680 COMPRESS                = @CompressCmd@
681 COMPRESS_SUFFIX         = @CompressSuffix@
682
683 CONTEXT_DIFF            = @ContextDiffCmd@
684 CP                      = cp
685 CPP                     = @CPP@ @CPPFLAGS@
686 CTAGS                   = $(ETAGS)
687 #
688 # RAWCPP_FLAGS are the flags to give to cpp (viz, gcc -E) to persuade it to
689 # behave plausibly on Haskell sources.
690 #
691 RAWCPP_FLAGS            = -undef -traditional
692 FIND                    = @FindCmd@
693 INSTALL                 = @INSTALL@
694 #
695 # Sigh - the autoconf macro for INSTALL will subst a relative path to the fallback
696 # install-sh script (if chosen). This not terribly useful to us, so we convert
697 # it into an abs. path.
698
699 INSTALL                 := $(subst .././install-sh,$(FPTOOLS_TOP_ABS)/install-sh,$(INSTALL))
700 LATEX                   = latex
701 HEVEA                   = hevea
702 HACHA                   = hacha
703 LD                      = ld
704 LN_S                    = @LN_S@
705 MANMACROS               = -man
706 MSMACROS                = -ms
707 MV                      = mv
708 NROFF                   = nroff
709 PERL                    = @PerlCmd@
710 PIC                     = pic
711 PREPROCESSCMD           = $(CC) -E
712 PRINTER                 = lpr
713 RANLIB                  = @RANLIB@
714 RM                      = rm -f
715 SED                     = @SedCmd@
716 SHELL                   = /bin/sh
717 #
718 # In emergency situations, REAL_SHELL is used to perform shell commands
719 # from within the ghc driver script, by scribbling the command line to
720 # a temp file and then having $(REAL_SHELL) execute it. 
721 #
722 # The reason for having to do this is that overly long command lines
723 # cause unnecessary trouble with some shells (e.g., /bin/sh on Solaris
724 # 2.5.1), which is why this backdoor is provided. The situation of overly
725 # long command lines is either encountered while doing `make boot' in ghc/compiler, 
726 # or when linking the compiler binary (`hsc'). 
727 #
728 # We do not use SHELL to execute long commands, as `make' will more than likely
729 # override whatever setting you have in your environment while executing. 
730
731 # By default, REAL_SHELL is set equal to SHELL, which is not really a smart move
732 # as it is SHELL that will show up the bogosity in the first place, but setting
733 # it to anything else isn't really portable.
734 #
735 #  ====> If long command lines cause you trouble, invoke `ghc' (via `make' or otherwise)
736 # with REAL_SHELL set to something else than /bin/sh, for instance, your favourite
737 # command shell.
738 #
739 REAL_SHELL=$(SHELL)
740 SIZE                    = size
741 STRIP                   = strip
742 TAR                     = @TarCmd@
743 ZIP                     = zip
744
745 #
746 # Under Windows, we have to deal with .exe suffixes
747 #
748 EXE_SUFFIX=@exeext@
749
750 #
751 # This is special to literate/, ToDo: add literate-specific
752 # configure setup to literate/.
753 #
754 TBL                     = tbl
755 TEX                     = tex
756 TGRIND                  = tgrind
757 TGRIND_HELPER           = /usr/local/lib/tgrind/tfontedpr # XXX
758 TIB                     = tib
759
760 TIME                    = @TimeCmd@
761 TROFF                   = troff
762 UNAME                   = uname
763 YACC                    = @YaccCmd@
764
765 #-----------------------------------------------------------------------------
766 # SGML stuff
767
768 JADE                    = @JadeCmd@
769
770 SGML2DVI                = $(DOCBOOK_PREFIX)db2dvi
771 SGML2HTML               = $(DOCBOOK_PREFIX)db2html
772 SGML2PS                 = $(DOCBOOK_PREFIX)db2ps
773 SGML2PDF                = $(DOCBOOK_PREFIX)db2pdf
774 SGML2RTF                = $(DOCBOOK_PREFIX)db2rtf
775
776 SGMLSTYLESHEET          = $(FPTOOLS_TOP_ABS)/docs/fptools-both.dsl
777
778 SRC_SGML2DVI_OPTS       = -d $(SGMLSTYLESHEET)
779 SRC_SGML2HTML_OPTS      = -d $(SGMLSTYLESHEET)
780 SRC_SGML2PS_OPTS        = -d $(SGMLSTYLESHEET)
781 SRC_SGML2RTF_OPTS       = -d $(SGMLSTYLESHEET)
782 SRC_SGML2PDF_OPTS       = -d $(SGMLSTYLESHEET)
783
784 DOCBOOK_CATALOG         = @Catalog@
785
786 #-----------------------------------------------------------------------------
787 #               FPtools support software
788
789 # Stuff from fptools/glafp-utils
790 MKDEPENDC               = $(MKDEPENDC_PREFIX)mkdependC
791 LTX                     = $(LTX_PREFIX)ltx
792 MKDIRHIER               = $(MKDIRHIER_PREFIX)mkdirhier
793 LNDIR                   = $(LNDIR_PREFIX)lndir
794 MSUB                    = $(MSUB_PREFIX)msub
795 ETAGS                   = $(ETAGS_PREFIX)etags
796 VERBATIM                = $(VERBATIM_PREFIX)verbatim
797 SGMLVERB                = $(SGMLVERB_PREFIX)sgmlverb
798 RUNTEST                 = $(RUNTEST_PREFIX)runstdtest
799 LX                      = @LxCmd@
800 GREENCARD               = $(FPTOOLS_TOP)/green-card/src/green-card
801
802 BLD_DLL                 = dllwrap
803
804 #
805 # .NET support software
806 #
807 ILX2IL                  = ilx2il
808 ILASM                   = ilasm
809
810 #
811 # Happy
812 #
813 HAPPY                   = @HappyCmd@
814 HAPPY_VERSION           = @HappyVersion@                
815 #
816 # Options to pass to Happy when we're going to compile the output with GHC
817 #
818 GHC_HAPPY_OPTS          = $(shell if ( test `echo $(HAPPY_VERSION) | sed -e "s/\(.*\)\..*/\1/g"` "-gt" "1" || test `echo $(HAPPY_VERSION) | sed -e "s/.*\.\(.*\)/\1/g"` "-ge" "9" ); then echo -agc; else echo -g; fi)
819
820 #
821 # Stuff from fptools/literate
822 #
823 LIT2PGM                 = $(LITERATE_PREFIX)lit2pgm
824 LIT2HTML                = $(LITERATE_PREFIX)lit2html
825 LIT2LATEX               = $(LITERATE_PREFIX)lit2latex
826 MKDEPENDLIT             = $(LITERATE_PREFIX)mkdependlit
827 LIT2CHANGELOG           = $(LITERATE_PREFIX)lit2changelog
828 LIT2TEXT                = $(LITERATE_PREFIX)lit2text
829
830 #
831 # Stuff from fptools/ghc/utils
832 #
833 UNLIT                   = $(UNLIT_PREFIX)unlit$(EXE_SUFFIX)
834 HP2PS                   = $(HP2PS_PREFIX)hp2ps$(EXE_SUFFIX)
835 HSTAGS                  = $(HSTAGS_PREFIX)hstags
836 HSC2HS                  = $(HSC2HS_PREFIX)hsc2hs-inplace
837
838 #
839 # Options for the compiling different `ways'. Various projects within
840 # the glorious fptools tree support building in various user-configured
841 # ways. For instance, you could set up one `way' such that the prelude
842 # libraries all were built with the option -ffoldr-build-on.
843
844 # To configure up your own way, have a look at some of the standard ways
845 # such as profiling, and create your own set of WAY_*_OPTS defs below.
846 # After having done that, add your way string to WAYS, and after having
847 # run the configure script, the different projects will add the new way
848 # to the list of ways they support.
849 #
850
851 #
852 # IMPORTANT! The WAYS variable configures the different `ways'
853 # you want to build a project (or maybe just parts of it, as is
854 # the case for ghc/). This variable is intended set inside the
855 # project mk setup, enforcing a global fptools WAYS is a bit too
856 # much (do you *really* want to build glafp-utils the profiled-concurrent 
857 # way?)
858 #
859
860 #
861 # Definitions of the different ways:
862 #   
863 #   * their name:
864 #          - tag, e.g., p
865 #          - description, e.g., profiling
866 #   * what they mean to the driver:
867 #          - WAY_p_HC_OPTS gives the list of command-line options
868 #            to the driver.
869 #
870
871 #
872 # The ways currently defined.
873 #
874 ALL_WAYS=p t u s mp mg a b c d e f g h i j k l m n o A B
875 USER_WAYS=a b c d e f g h j k l m n o A B
876
877 #
878 # The following ways currently have treated specially, p u t mg,
879 # as the driver script treats these guys specially and needs to carefully be told
880 # about the options for these. Hence, we hide the required command line options
881 # for these in the ghc/driver, as this is the only place they are needed.
882
883 # If you want to add to these default options, fill in the variables below:
884
885 # Way 'i':
886 WAY_i_NAME=ILX
887 WAY_i_HC_OPTS= -filx -fruntime-types
888
889 # Way 'p':
890 WAY_p_NAME=profiling
891 WAY_p_HC_OPTS= -prof
892
893 # Way 't':
894 WAY_t_NAME=ticky-ticky profiling
895 WAY_t_HC_OPTS= -ticky
896
897 # Way `u':
898 WAY_u_NAME=unregisterized (using portable C only)
899 WAY_u_HC_OPTS=-unreg
900
901 # Way `s':
902 WAY_s_NAME=threads (for SMP)
903 WAY_s_HC_OPTS=-smp
904
905 # Way `mp': 
906 WAY_mp_NAME=parallel
907 WAY_mp_HC_OPTS=-parallel
908
909 # Way `mg': 
910 WAY_mg_NAME=GranSim
911 WAY_mg_HC_OPTS=-gransim
912
913 #
914 # Add user-way configurations here:
915 #
916 WAY_A_NAME=
917 WAY_A_HC_OPTS=
918
919 WAY_B_NAME=
920 WAY_B_HC_OPTS=
921
922 WAY_a_NAME=
923 WAY_a_HC_OPTS=
924
925 WAY_b_NAME=
926 WAY_b_HC_OPTS=
927
928 WAY_c_NAME=
929 WAY_c_HC_OPTS=
930
931 WAY_d_NAME=
932 WAY_d_HC_OPTS=
933
934 WAY_e_NAME=
935 WAY_e_HC_OPTS=
936
937 WAY_f_NAME=
938 WAY_f_HC_OPTS=
939
940 WAY_g_NAME=
941 WAY_g_HC_OPTS=
942
943 WAY_h_NAME=
944 WAY_h_HC_OPTS=
945
946 WAY_j_NAME=
947 WAY_j_HC_OPTS=
948
949 WAY_k_NAME=
950 WAY_k_HC_OPTS=
951
952 WAY_l_NAME=
953 WAY_l_HC_OPTS=
954
955 WAY_m_NAME=
956 WAY_m_HC_OPTS=
957
958 WAY_n_NAME=
959 WAY_n_HC_OPTS=
960
961 WAY_o_NAME=
962 WAY_o_HC_OPTS=
963
964 ################################################################################
965 #
966 #               31-bit-Int Core files
967 #
968 ################################################################################
969
970
971 # It is possible to configure the compiler and prelude to support 31-bit
972 # integers, suitable for a back-end and RTS using a tag bit on a 32-bit
973 # architecture.  Currently the only useful output from this option is external Core
974 # files.  The following additions to your build.mk will produce the
975 # 31-bit core output.  Note that this is *not* just a library "way"; the
976 # compiler must be built a special way too.
977
978 # GhcCppOpts +=-DWORD_SIZE_IN_BITS=31
979 # GhcLibHcOpts +=-fext-core -fno-code -DWORD_SIZE_IN_BITS=31
980 # GhcLibCppOpts += -DWORD_SIZE_IN_BITS=31
981 # SplitObjs=NO
982