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