[project @ 1996-07-19 18:36:04 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 UnlitSuffixRule(.lh,.h)
67 UnlitSuffixRule(.lc,.c)
68
69 all :: /* so it is first */
70         @:
71
72 UnlitNeededHere(depend)
73
74 #if GhcWithNativeCodeGen == YES
75
76 GhcDriverNeededHere(depend all mkNativeHdr.o) /* we use its C-compiling know-how */
77
78 $(TARGETPLATFORM).h : mkNativeHdr
79         $(RM) $@
80         ./mkNativeHdr > $@ || ( rm $@ && exit 1 )
81
82 mkNativeHdr.c : mkNativeHdr.lc
83
84 mkNativeHdr :: mkNativeHdr.c $(MOST_H_FILES)
85         $(RM) mkNativeHdr mkNativeHdr.o
86         $(GHC) -c mkNativeHdr.c
87         $(CC) -o mkNativeHdr mkNativeHdr.o
88
89 #endif /* NativeCodeGen */
90
91 all depend :: $(H_FILES)
92
93 #if DoInstallGHCSystem == YES
94 MakeDirectories(install, $(INSTDATADIR_GHC)/includes $(INSTLIBDIR_GHC)/includes)
95 includestuff:: /* nothing */
96 InstallTarget(includestuff)
97 InstallMultNonExecTargets(includestuff, $(H_FILES), $(INSTDATADIR_GHC)/includes)
98 InstallMultNonExecTargets(includestuff, $(PLAT_H_FILES), $(INSTLIBDIR_GHC)/includes)
99 #endif
100
101 ExtraStuffToClean( $(H_FILES_FROM_LH_FILES) )
102
103 EtagsNeededHere(tags) /* need this to do "make tags" */
104 ClearTagsFile()
105 CTagsTarget( $(H_FILES) )