[project @ 1996-01-08 20:28:12 by partain]
[ghc-hetmet.git] / ghc / includes / Jmakefile
1 LH_FILES = \
2 rtsTypes.lh     /* runtime system */ \
3 \
4 SMinterface.lh  /* storage-management related */ \
5 SMClosures.lh \
6 SMInfoTables.lh \
7 SMupdate.lh \
8 SMcopying.lh \
9 SMcompact.lh \
10 SMmark.lh \
11 \
12 StgMacros.lh \
13 StgTypes.lh \
14 MachRegs.lh \
15 StgRegs.lh \
16 COptJumps.lh \
17 COptRegs.lh \
18 COptWraps.lh \
19 \
20 GhcConstants.lh \
21 \
22 RednCounts.lh   /* "ticky-ticky" profiling */ \
23 \
24 Info.lh         /* Info pointer definitions */ \
25 \
26 CostCentre.lh   /* for cost centre profiling */ \
27 AgeProfile.lh   /* age stuff for heap and lifetime profiling */ \
28 Force_GC.lh     /* for forcing GC */ \
29 \
30 GranSim.lh  \
31 Parallel.lh     /* for PAR build */ \
32 Threads.lh      /* for threads, parallel or not */
33
34 H_FILES_FROM_LH_FILES = $(LH_FILES:.lh=.h)
35
36 MOST_H_FILES = $(H_FILES_FROM_LH_FILES) \
37 stgdefs.h /* top-level including file */ \
38 rtsdefs.h       \
39 \
40 StgDirections.h /* other basic STG things */ \
41 StgMachDeps.h   \
42 \
43 error.h         \
44 ieee-flpt.h     \
45 \
46 gmp.h           \
47 \
48 LLC.h       /* for PAR build */ \
49 HLC.h       /* ditto */
50
51 #if GhcWithNativeCodeGen == YES
52 #define __native_h $(TARGETPLATFORM).h
53 #else
54 #define __native_h /*no*/
55 #endif
56
57 H_FILES = $(MOST_H_FILES) \
58 __native_h /* Must be constructed last */
59
60 /* $(TARGETPLATFORM).h should probably be installed in LIB, not DATA (WDP 94/07) */
61
62 PLAT_H_FILES = config.h platform.h
63
64 #undef __native_h
65
66 /* Literate-pgmming suffix rules used herein */
67 LitSuffixRule(.lh,.h)
68 LitSuffixRule(.lc,.c)
69
70 all :: /* so it is first */
71         @:
72
73 #if GhcWithNativeCodeGen == YES
74
75 GhcDriverNeededHere(depend all mkNativeHdr.o) /* we use its C-compiling know-how */
76
77 $(TARGETPLATFORM).h : mkNativeHdr
78         $(RM) $@
79         ./mkNativeHdr > $@ || ( rm $@ && exit 1 )
80
81 mkNativeHdr.c : mkNativeHdr.lc
82
83 mkNativeHdr :: mkNativeHdr.c $(MOST_H_FILES)
84         $(RM) mkNativeHdr mkNativeHdr.o
85         $(GHC) -c mkNativeHdr.c
86         $(CC) -o mkNativeHdr mkNativeHdr.o
87
88 #endif /* NativeCodeGen */
89
90 all depend :: $(H_FILES)
91
92 #if DoInstallGHCSystem == YES
93 MakeDirectories(install, $(INSTDATADIR_GHC)/includes $(INSTLIBDIR_GHC)/includes)
94 includestuff:: /* nothing */
95 InstallTarget(includestuff)
96 InstallMultNonExecTargets(includestuff, $(H_FILES), $(INSTDATADIR_GHC)/includes)
97 InstallMultNonExecTargets(includestuff, $(PLAT_H_FILES), $(INSTLIBDIR_GHC)/includes)
98 #endif
99
100 ExtraStuffToClean( $(H_FILES_FROM_LH_FILES) )
101
102 EtagsNeededHere(tags) /* need this to do "make tags" */
103 ClearTagsFile()
104 CTagsTarget( $(H_FILES) )
105
106 LitStuffNeededHere(docs depend)
107 InfoStuffNeededHere(docs)
108
109 LitDocRootTargetWithNamedOutput(root,lit,root-standalone)
110 LitDocRootTargetWithNamedOutput(c-as-asm,lit,c-as-asm-standalone)