We need to make Parser.y and Config.hs earlier
[ghc-hetmet.git] / compiler / Makefile
1 # -----------------------------------------------------------------------------
2 # Main compiler Makefile
3
4 # Targets:
5 #
6 #       all     builds stage1 compiler
7 #
8 #       boot stage=N   generate build dirs and dependencies for stage N.
9 #                      NB. Must be done before 'make stageN'.
10 #                      NB. Cannot 'make boot stage=2' until stage1 has
11 #                          been built (similarly for stage3).
12 #
13 #       stage1  (or stage=1) builds stage1 compiler
14 #       stage2  (or stage=2) builds stage2 compiler
15 #       stage3  (or stage=3) builds stage3 compiler
16 #
17
18 TOP = ..
19
20 ifeq "$(stage)" ""
21 stage=1
22 endif
23
24 include $(TOP)/mk/boilerplate.mk
25 include $(TOP)/mk/cabal-flags.mk
26
27 ifeq "$(GhcThreaded) $(GhcProfiled)" "YES YES"
28 $(error Cannot make GHC both threaded and profiled)
29 endif
30
31 CONFIG_HS       = main/Config.hs
32 PRIMOP_BITS = primop-data-decl.hs-incl        \
33               primop-tag.hs-incl              \
34               primop-list.hs-incl             \
35               primop-has-side-effects.hs-incl \
36               primop-out-of-line.hs-incl      \
37               primop-commutable.hs-incl       \
38               primop-needs-wrapper.hs-incl    \
39               primop-can-fail.hs-incl         \
40               primop-strictness.hs-incl       \
41               primop-primop-info.hs-incl
42
43 boot :: $(CONFIG_HS)
44
45 boot :: parser/Parser.y
46
47 boot:: boot.stage.$(stage)
48
49 all:: build.stage.$(stage)
50
51 stage1 ::
52         $(MAKE) stage=1
53
54 stage2 ::
55         $(MAKE) stage=2
56
57 stage3 ::
58         $(MAKE) stage=3
59
60 clean distclean::
61         -$(CABAL) clean --distpref dist-stage1
62         -$(CABAL) clean --distpref dist-stage2
63         $(RM) -f Makefile-stage1
64         $(RM) -f Makefile-stage2
65         $(RM) -f prelude/primops.txt
66         $(RM) -f $(PRIMOP_BITS)
67         $(RM) -f $(CONFIG_HS)
68         $(RM) -f parser/Parser.y
69
70 CONFIGURE_FLAGS_STAGE1 += --flags=stage1
71 CONFIGURE_FLAGS_STAGE2 += --flags=-stage1
72
73 CONFIGURE_FLAGS_STAGE1 += --flags=-ghci
74
75 ifeq "$(GhcWithInterpreter)" "YES"
76 CONFIGURE_FLAGS_STAGE2 += --flags=ghci
77
78 # If we are going to use dynamic libraries instead of .o files for ghci,
79 # we will need to always retain CAFs in the compiler.
80 # ghci/keepCAFsForGHCi contains a GNU C __attribute__((constructor))
81 # function which sets the keepCAFs flag for the RTS before any Haskell
82 # code is run.
83 ifeq "$(GhcBuildDylibs)" "YES"
84 CONFIGURE_FLAGS_STAGE2 += --flags=dynlibs
85 else
86 CONFIGURE_FLAGS_STAGE2 += --flags=-dynlibs
87 endif
88
89 ifeq "$(GhcEnableTablesNextToCode) $(GhcUnregisterised)" "YES NO"
90 # Should GHCI be building info tables in the TABLES_NEXT_TO_CODE style
91 # or not?
92 # XXX This should logically be a CPP option, but there doesn't seem to
93 # be a flag for that
94 CONFIGURE_FLAGS_STAGE2 += --ghc-option=-DGHCI_TABLES_NEXT_TO_CODE
95 endif
96
97 # Should the debugger commands be enabled?
98 ifeq "$(GhciWithDebugger)" "YES"
99 CONFIGURE_FLAGS_STAGE2 += --ghc-option=-DDEBUGGER
100 endif
101
102 # Enable editline if either:
103 #   - we're building stage 1 and $(GhcHasEditline)="YES"
104 #   - we're building stage 2/3, and we have built the editline package
105 #
106 # But we don't enable editline on Windows, as Windows terminals have
107 # editline-like support builtin.
108 #
109 ifeq "$(TARGETPLATFORM)" "i386-unknown-mingw32"
110 CONFIGURE_FLAGS_STAGE1 += --flags=-editline
111 CONFIGURE_FLAGS_STAGE2 += --flags=-editline
112 else
113 ifeq "$(GhcHasEditline)" "YES"
114 CONFIGURE_FLAGS_STAGE1 += --flags=editline
115 else
116 CONFIGURE_FLAGS_STAGE1 += --flags=-editline
117 endif
118 ifeq "$(wildcard $(FPTOOLS_TOP_ABS)/libraries/editline/unbuildable)" ""
119 CONFIGURE_FLAGS_STAGE2 += --flags=editline
120 else
121 CONFIGURE_FLAGS_STAGE2 += --flags=-editline
122 endif
123 endif
124
125 else
126 CONFIGURE_FLAGS_STAGE2 += --flags=-ghci
127 endif
128
129 ifeq "$(GhcWithNativeCodeGen)" "NO"
130 # XXX This should logically be a CPP option, but there doesn't seem to
131 # be a flag for that
132 COMMON_CONFIGURE_FLAGS += --ghc-option=-DOMIT_NATIVE_CODEGEN
133 endif
134
135 ifeq "$(TargetOS_CPP)" "openbsd"
136 COMMON_CONFIGURE_FLAGS += --ld-options="-Xlinker -E"
137 endif
138
139 ifeq "$(GhcUnregisterised)" "NO"
140 ifeq "$(HOSTPLATFORM)" "ia64-unknown-linux"
141 # needed for generating proper relocation in large binaries: trac #856
142 COMMON_CONFIGURE_FLAGS += --ld-option=-Wl,--relax
143 endif
144 endif
145
146 ifeq "$(HOSTPLATFORM)" "i386-unknown-mingw32"
147 # The #include is vital for the via-C route with older compilers, else the C
148 # compiler doesn't realise that the stcall foreign imports are indeed
149 # stdcall, and doesn't generate the Foo@8 name for them
150 # As it's only important for older compilers we don't need to do anything
151 # for stage2+.
152 CONFIGURE_FLAGS_STAGE1 += --ghc-option='-\#include'    \
153                           --ghc-option='"<windows.h>"' \
154                           --ghc-option='-\#include'    \
155                           --ghc-option='"<process.h>"'
156 endif
157
158 # ghc_strlen percolates through so many modules that it is easier to get its
159 # prototype via a global option instead of a myriad of per-file OPTIONS.
160 # Again, this is only important for older compilers, so we don't do it in
161 # stage 2+.
162 CONFIGURE_FLAGS_STAGE1 += --ghc-options='-\#include "cutils.h"'
163
164 CONFIGURE_FLAGS_STAGE3 = $(CONFIGURE_FLAGS_STAGE2)
165 CONFIGURE_FLAGS_STAGE1 += $(USE_BOOT_CONFIGURE_FLAGS)
166 CONFIGURE_FLAGS_STAGE2 += $(USE_STAGE1_CONFIGURE_FLAGS)
167 CONFIGURE_FLAGS_STAGE3 += $(USE_STAGE2_CONFIGURE_FLAGS)
168
169 boot.stage.%:
170         $(CABAL) configure --distpref dist-stage$* \
171                            $(CONFIGURE_FLAGS_STAGE$*) \
172                            $(INSTALL_DIRS_CONFIGURE_FLAGS) \
173                            $(COMMON_CONFIGURE_FLAGS) \
174                            --ghc-option=-DSTAGE=$*
175         $(RM) -f Makefile-stage$*
176         $(CABAL) makefile  --distpref dist-stage$* -f Makefile-stage$*
177
178 build.stage.%: $(PRIMOP_BITS)
179         $(MAKE) -f Makefile-stage$* stage=$*
180         $(CABAL) register  --distpref dist-stage$* --inplace
181
182 stage_dirs :
183         $(MKDIRHIER) stage$(stage)
184
185 boot :: stage_dirs
186
187 # -----------------------------------------------------------------------------
188 # Create compiler configuration
189 #
190 # The 'echo' commands simply spit the values of various make variables
191 # into Config.hs, whence they can be compiled and used by GHC itself
192
193 $(CONFIG_HS) : $(FPTOOLS_TOP)/mk/config.mk
194         @$(RM) -f $(CONFIG_HS)
195         @echo "Creating $(CONFIG_HS) ... "
196         @echo "module Config where" >>$(CONFIG_HS)
197         @echo "cProjectName          :: String" >> $(CONFIG_HS)
198         @echo "cProjectName          = \"$(ProjectName)\"" >> $(CONFIG_HS)
199         @echo "cProjectVersion       :: String" >> $(CONFIG_HS)
200         @echo "cProjectVersion       = \"$(ProjectVersion)\"" >> $(CONFIG_HS)
201         @echo "cProjectVersionInt    :: String" >> $(CONFIG_HS)
202         @echo "cProjectVersionInt    = \"$(ProjectVersionInt)\"" >> $(CONFIG_HS)
203         @echo "cProjectPatchLevel    :: String" >> $(CONFIG_HS)
204         @echo "cProjectPatchLevel    = \"$(ProjectPatchLevel)\"" >> $(CONFIG_HS)
205         @echo "cBooterVersion        :: String" >> $(CONFIG_HS)
206         @echo "cBooterVersion        = \"$(GhcVersion)\"" >> $(CONFIG_HS)
207         @echo "cStage                :: String" >> $(CONFIG_HS)
208         @echo "cStage                = show (STAGE :: Int)" >> $(CONFIG_HS)
209         @echo "cHscIfaceFileVersion  :: String" >> $(CONFIG_HS)
210         @echo "cHscIfaceFileVersion  = \"$(HscIfaceFileVersion)\"" >> $(CONFIG_HS)
211         @echo "cSplitObjs            :: String" >> $(CONFIG_HS)
212         @echo "cSplitObjs            = \"$(SplitObjs)\"" >> $(CONFIG_HS)
213         @echo "cGhcWithInterpreter   :: String" >> $(CONFIG_HS)
214         @echo "cGhcWithInterpreter   = \"$(GhcWithInterpreter)\"" >> $(CONFIG_HS)
215         @echo "cGhcWithNativeCodeGen :: String" >> $(CONFIG_HS)
216         @echo "cGhcWithNativeCodeGen = \"$(GhcWithNativeCodeGen)\"" >> $(CONFIG_HS)
217         @echo "cGhcWithSMP           :: String" >> $(CONFIG_HS)
218         @echo "cGhcWithSMP           = \"$(GhcWithSMP)\"" >> $(CONFIG_HS)
219         @echo "cGhcRTSWays           :: String" >> $(CONFIG_HS)
220         @echo "cGhcRTSWays           = \"$(GhcRTSWays)\"" >> $(CONFIG_HS)
221         @echo "cGhcUnregisterised    :: String" >> $(CONFIG_HS)
222         @echo "cGhcUnregisterised    = \"$(GhcUnregisterised)\"" >> $(CONFIG_HS)
223         @echo "cGhcEnableTablesNextToCode :: String" >> $(CONFIG_HS)
224         @echo "cGhcEnableTablesNextToCode = \"$(GhcEnableTablesNextToCode)\"" >> $(CONFIG_HS)
225         @echo "cLeadingUnderscore    :: String" >> $(CONFIG_HS)
226         @echo "cLeadingUnderscore    = \"$(LeadingUnderscore)\"" >> $(CONFIG_HS)
227         @echo "cRAWCPP_FLAGS         :: String" >> $(CONFIG_HS)
228         @echo "cRAWCPP_FLAGS         = \"$(RAWCPP_FLAGS)\"" >> $(CONFIG_HS)
229         @echo "cGCC                  :: String" >> $(CONFIG_HS)
230         @echo "cGCC                  = \"$(WhatGccIsCalled)\"" >> $(CONFIG_HS)
231         @echo "cMKDLL                :: String" >> $(CONFIG_HS)
232         @echo "cMKDLL                = \"$(BLD_DLL)\"" >> $(CONFIG_HS)
233         @echo "cLdIsGNULd            :: String" >> $(CONFIG_HS)
234         @echo "cLdIsGNULd            = \"$(LdIsGNULd)\"" >> $(CONFIG_HS)
235         @echo "cLD_X                 :: String" >> $(CONFIG_HS)
236         @echo "cLD_X                 = \"$(LD_X)\"" >> $(CONFIG_HS)
237         @echo "cGHC_DRIVER_DIR_REL   :: String" >> $(CONFIG_HS)
238         @echo "cGHC_DRIVER_DIR_REL   = \"$(GHC_DRIVER_DIR_REL)\"" >> $(CONFIG_HS)
239         @echo "cGHC_TOUCHY_PGM       :: String" >> $(CONFIG_HS)
240         @echo "cGHC_TOUCHY_PGM       = \"$(GHC_TOUCHY_PGM)\"" >> $(CONFIG_HS)
241         @echo "cGHC_TOUCHY_DIR_REL   :: String" >> $(CONFIG_HS)
242         @echo "cGHC_TOUCHY_DIR_REL   = \"$(GHC_TOUCHY_DIR_REL)\"" >> $(CONFIG_HS)
243         @echo "cGHC_UNLIT_PGM        :: String" >> $(CONFIG_HS)
244         @echo "cGHC_UNLIT_PGM        = \"$(GHC_UNLIT_PGM)\"" >> $(CONFIG_HS)
245         @echo "cGHC_UNLIT_DIR_REL    :: String" >> $(CONFIG_HS)
246         @echo "cGHC_UNLIT_DIR_REL    = \"$(GHC_UNLIT_DIR_REL)\"" >> $(CONFIG_HS)
247         @echo "cGHC_MANGLER_PGM      :: String" >> $(CONFIG_HS)
248         @echo "cGHC_MANGLER_PGM      = \"$(GHC_MANGLER_PGM)\"" >> $(CONFIG_HS)
249         @echo "cGHC_MANGLER_DIR_REL  :: String" >> $(CONFIG_HS)
250         @echo "cGHC_MANGLER_DIR_REL  = \"$(GHC_MANGLER_DIR_REL)\"" >> $(CONFIG_HS)
251         @echo "cGHC_SPLIT_PGM        :: String" >> $(CONFIG_HS)
252         @echo "cGHC_SPLIT_PGM        = \"$(GHC_SPLIT_PGM)\"" >> $(CONFIG_HS)
253         @echo "cGHC_SPLIT_DIR_REL    :: String" >> $(CONFIG_HS)
254         @echo "cGHC_SPLIT_DIR_REL    = \"$(GHC_SPLIT_DIR_REL)\"" >> $(CONFIG_HS)
255         @echo "cGHC_SYSMAN_PGM       :: String" >> $(CONFIG_HS)
256         @echo "cGHC_SYSMAN_PGM       = \"$(GHC_SYSMAN)\"" >> $(CONFIG_HS)
257         @echo "cGHC_SYSMAN_DIR_REL   :: String" >> $(CONFIG_HS)
258         @echo "cGHC_SYSMAN_DIR_REL   = \"$(GHC_SYSMAN_DIR)\"" >> $(CONFIG_HS)
259         @echo "cGHC_CP               :: String" >> $(CONFIG_HS)
260         @echo "cGHC_CP               = \"$(GHC_CP)\"" >> $(CONFIG_HS)
261         @echo "cGHC_PERL             :: String" >> $(CONFIG_HS)
262         @echo "cGHC_PERL             = \"$(GHC_PERL)\"" >> $(CONFIG_HS)
263         @echo "cEnableWin32DLLs      :: String" >> $(CONFIG_HS)
264         @echo "cEnableWin32DLLs      = \"$(EnableWin32DLLs)\"" >> $(CONFIG_HS)
265         @echo "cCONTEXT_DIFF         :: String" >> $(CONFIG_HS)
266         @echo "cCONTEXT_DIFF         = \"$(CONTEXT_DIFF)\"" >> $(CONFIG_HS)
267         @echo "cUSER_WAY_NAMES       :: String" >> $(CONFIG_HS)
268         @echo "cUSER_WAY_NAMES       = \"$(USER_WAY_NAMES)\"" >> $(CONFIG_HS)
269         @echo "cUSER_WAY_OPTS        :: String" >> $(CONFIG_HS)
270         @echo "cUSER_WAY_OPTS        = \"$(USER_WAY_OPTS)\"" >> $(CONFIG_HS)
271         @echo "cDEFAULT_TMPDIR       :: String" >> $(CONFIG_HS)
272         @echo "cDEFAULT_TMPDIR       = \"$(DEFAULT_TMPDIR)\"" >> $(CONFIG_HS)
273         @echo "cRelocatableBuild     :: Bool"                 >> $(CONFIG_HS)
274 ifeq "$(RelocatableBuild)" "YES"
275         @echo "cRelocatableBuild     = True"                  >> $(CONFIG_HS)
276 else
277         @echo "cRelocatableBuild     = False"                 >> $(CONFIG_HS)
278 endif
279         @echo "cLibFFI               :: Bool"                 >> $(CONFIG_HS)
280 ifeq "$(UseLibFFIForAdjustors)" "YES"
281         @echo "cLibFFI               = True"                  >> $(CONFIG_HS)
282 else
283         @echo "cLibFFI               = False"                 >> $(CONFIG_HS)
284 endif
285         @echo done.
286
287 # -----------------------------------------------------------------------------
288 # Create platform includes
289
290 # Here we generate a little header file containing CPP symbols that GHC
291 # uses to determine which platform it is building on/for.  The platforms
292 # can differ between stage1 and stage2 if we're cross-compiling, so we
293 # need one of these header files per stage.
294
295 PLATFORM_H = ghc_boot_platform.h
296
297 stage1/$(PLATFORM_H) : stage_dirs $(FPTOOLS_TOP)/mk/config.mk
298         @echo "Creating $@..."
299         @$(RM) $@
300         @echo "#ifndef __PLATFORM_H__"  >$@
301         @echo "#define __PLATFORM_H__" >>$@
302         @echo >> $@
303         @echo "#define BuildPlatform_NAME  \"$(BUILDPLATFORM)\"" >> $@
304         @echo "#define HostPlatform_NAME   \"$(HOSTPLATFORM)\"" >> $@
305         @echo "#define TargetPlatform_NAME \"$(TARGETPLATFORM)\"" >> $@
306         @echo >> $@
307         @echo "#define $(BuildPlatform_CPP)_BUILD       1" >> $@
308         @echo "#define $(HostPlatform_CPP)_HOST         1" >> $@
309         @echo "#define $(TargetPlatform_CPP)_TARGET     1" >> $@
310         @echo >> $@
311         @echo "#define $(BuildArch_CPP)_BUILD_ARCH      1" >> $@
312         @echo "#define $(HostArch_CPP)_HOST_ARCH        1" >> $@
313         @echo "#define $(TargetArch_CPP)_TARGET_ARCH    1" >> $@
314         @echo "#define BUILD_ARCH \"$(BuildArch_CPP)\"" >> $@
315         @echo "#define HOST_ARCH \"$(HostArch_CPP)\"" >> $@
316         @echo "#define TARGET_ARCH \"$(TargetArch_CPP)\"" >> $@
317         @echo >> $@
318         @echo "#define $(BuildOS_CPP)_BUILD_OS          1" >> $@
319         @echo "#define $(HostOS_CPP)_HOST_OS            1" >> $@
320         @echo "#define $(TargetOS_CPP)_TARGET_OS        1" >> $@  
321         @echo "#define BUILD_OS \"$(BuildOS_CPP)\"" >> $@
322         @echo "#define HOST_OS \"$(HostOS_CPP)\"" >> $@
323         @echo "#define TARGET_OS \"$(TargetOS_CPP)\"" >> $@
324 ifeq "$(HostOS_CPP)" "irix"
325         @echo "#ifndef $(IRIX_MAJOR)_TARGET_OS           " >> $@  
326         @echo "#define $(IRIX_MAJOR)_TARGET_OS          1" >> $@  
327         @echo "#endif                                    " >> $@  
328 endif
329         @echo >> $@
330         @echo "#define $(BuildVendor_CPP)_BUILD_VENDOR  1" >> $@
331         @echo "#define $(HostVendor_CPP)_HOST_VENDOR    1" >> $@
332         @echo "#define $(TargetVendor_CPP)_TARGET_VENDOR  1" >> $@
333         @echo "#define BUILD_VENDOR \"$(BuildVendor_CPP)\"" >> $@
334         @echo "#define HOST_VENDOR \"$(HostVendor_CPP)\"" >> $@
335         @echo "#define TARGET_VENDOR \"$(TargetVendor_CPP)\"" >> $@
336         @echo >> $@
337         @echo "#endif /* __PLATFORM_H__ */"          >> $@
338         @echo "Done."
339
340 # For stage2 and above, the BUILD platform is the HOST of stage1, and
341 # the HOST platform is the TARGET of stage1.  The TARGET remains the same
342 # (stage1 is the cross-compiler, not stage2).
343 stage2/$(PLATFORM_H) : stage_dirs $(FPTOOLS_TOP)/mk/config.mk
344         @echo "Creating $@..."
345         @$(RM) $@
346         @echo "#ifndef __PLATFORM_H__"  >$@
347         @echo "#define __PLATFORM_H__" >>$@
348         @echo >> $@
349         @echo "#define BuildPlatform_NAME  \"$(HOSTPLATFORM)\"" >> $@
350         @echo "#define HostPlatform_NAME   \"$(TARGETPLATFORM)\"" >> $@
351         @echo "#define TargetPlatform_NAME \"$(TARGETPLATFORM)\"" >> $@
352         @echo >> $@
353         @echo "#define $(HostPlatform_CPP)_BUILD        1" >> $@
354         @echo "#define $(TargetPlatform_CPP)_HOST               1" >> $@
355         @echo "#define $(TargetPlatform_CPP)_TARGET     1" >> $@
356         @echo >> $@
357         @echo "#define $(HostArch_CPP)_BUILD_ARCH       1" >> $@
358         @echo "#define $(TargetArch_CPP)_HOST_ARCH      1" >> $@
359         @echo "#define $(TargetArch_CPP)_TARGET_ARCH    1" >> $@
360         @echo "#define BUILD_ARCH \"$(HostArch_CPP)\"" >> $@
361         @echo "#define HOST_ARCH \"$(TargetArch_CPP)\"" >> $@
362         @echo "#define TARGET_ARCH \"$(TargetArch_CPP)\"" >> $@
363         @echo >> $@
364         @echo "#define $(HostOS_CPP)_BUILD_OS           1" >> $@
365         @echo "#define $(TargetOS_CPP)_HOST_OS          1" >> $@
366         @echo "#define $(TargetOS_CPP)_TARGET_OS        1" >> $@  
367         @echo "#define BUILD_OS \"$(HostOS_CPP)\"" >> $@
368         @echo "#define HOST_OS \"$(TargetOS_CPP)\"" >> $@
369         @echo "#define TARGET_OS \"$(TargetOS_CPP)\"" >> $@
370 ifeq "$(HostOS_CPP)" "irix"
371         @echo "#ifndef $(IRIX_MAJOR)_TARGET_OS           " >> $@  
372         @echo "#define $(IRIX_MAJOR)_TARGET_OS          1" >> $@  
373         @echo "#endif                                    " >> $@  
374 endif
375         @echo >> $@
376         @echo "#define $(HostVendor_CPP)_BUILD_VENDOR   1" >> $@
377         @echo "#define $(TargetVendor_CPP)_HOST_VENDOR  1" >> $@
378         @echo "#define $(TargetVendor_CPP)_TARGET_VENDOR  1" >> $@
379         @echo "#define BUILD_VENDOR \"$(HostVendor_CPP)\"" >> $@
380         @echo "#define HOST_VENDOR \"$(TargetVendor_CPP)\"" >> $@
381         @echo "#define TARGET_VENDOR \"$(TargetVendor_CPP)\"" >> $@
382         @echo >> $@
383         @echo "#endif /* __PLATFORM_H__ */"          >> $@
384         @echo "Done."
385
386 STAGE_PLATFORM_H = stage$(stage)/$(PLATFORM_H)
387
388 boot :: $(STAGE_PLATFORM_H)
389
390 # ----------------------------------------------------------------------------
391 #               Generate supporting stuff for prelude/PrimOp.lhs 
392 #               from prelude/primops.txt
393
394 SRC_CPP_OPTS += -I$(GHC_INCLUDE_DIR)
395 SRC_CPP_OPTS += ${GhcCppOpts}
396
397 prelude/primops.txt parser/Parser.y: %: %.pp stage1/$(PLATFORM_H)
398         $(CPP) $(RAWCPP_FLAGS) -P $(CPP_OPTS) -x c $< | grep -v '^#pragma GCC' > $@
399
400 primop-data-decl.hs-incl: prelude/primops.txt
401         $(GENPRIMOP) --data-decl          < $< > $@
402 primop-tag.hs-incl: prelude/primops.txt
403         $(GENPRIMOP) --primop-tag         < $< > $@
404 primop-list.hs-incl: prelude/primops.txt
405         $(GENPRIMOP) --primop-list        < $< > $@
406 primop-has-side-effects.hs-incl: prelude/primops.txt
407         $(GENPRIMOP) --has-side-effects   < $< > $@
408 primop-out-of-line.hs-incl: prelude/primops.txt
409         $(GENPRIMOP) --out-of-line        < $< > $@
410 primop-commutable.hs-incl: prelude/primops.txt
411         $(GENPRIMOP) --commutable         < $< > $@
412 primop-needs-wrapper.hs-incl: prelude/primops.txt
413         $(GENPRIMOP) --needs-wrapper      < $< > $@
414 primop-can-fail.hs-incl: prelude/primops.txt
415         $(GENPRIMOP) --can-fail           < $< > $@
416 primop-strictness.hs-incl: prelude/primops.txt
417         $(GENPRIMOP) --strictness         < $< > $@
418 primop-primop-info.hs-incl: prelude/primops.txt
419         $(GENPRIMOP) --primop-primop-info < $< > $@
420
421 # Usages aren't used any more; but the generator 
422 # can still generate them if we want them back
423 primop-usage.hs-incl: prelude/primops.txt
424         $(GENPRIMOP) --usage              < $< > $@
425
426 # XXX:
427 #-----------------------------------------------------------------------------
428 # binary-dist
429 #
430 #binary-dist:
431 #       $(INSTALL_DIR)                         $(BIN_DIST_DIR)/compiler
432 #       $(INSTALL_DIR)                         $(BIN_DIST_DIR)/compiler/stage$(stage)
433 #       echo "stage=$(stage)"                > $(BIN_DIST_DIR)/compiler/Makefile
434 #       cat Makefile                        >> $(BIN_DIST_DIR)/compiler/Makefile
435 #       $(INSTALL_DATA)    package.conf.in     $(BIN_DIST_DIR)/compiler/
436 #       set -e; for d in stage$(stage)/*/; do $(INSTALL_DIR) $(BIN_DIST_DIR)/compiler/$$d; done
437 #       set -e; for f in $(HS_IFACES); do $(INSTALL_DATA) $$f $(BIN_DIST_DIR)/compiler/$$f; done
438 #ifneq "$(INSTALL_LIBS)" ""
439 #       set -e; for f in $(INSTALL_LIBS); do $(INSTALL_DATA) $$f $(BIN_DIST_DIR)/compiler/$$f; done
440 #endif
441 #ifneq "$(INSTALL_PROGS)" ""
442 #       set -e; for f in $(INSTALL_PROGS); do $(INSTALL_PROGRAM) $$f $(BIN_DIST_DIR)/compiler/$$f; done
443 #endif
444 #ifneq "$(INSTALL_LIBEXECS)" ""
445 #       set -e; for f in $(INSTALL_LIBEXECS); do $(INSTALL_PROGRAM) $$f $(BIN_DIST_DIR)/compiler/$$f; done
446 #endif
447