summaryrefslogtreecommitdiff
path: root/mk/project.mk.in
blob: bf79614c24d855a33b75154db96933c8c3539d25 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
# WARNING: mk/project.mk is automatically generated from mk/project.mk.in by
# ./configure.  Make sure you are editing mk/project.mk.in, not mk/project.mk.

################################################################################
#
# GHC Version
#

# ProjectVersion    is treated as a *string*
# ProjectVersionInt is treated as an *integer* (for cpp defines)

# Versioning scheme: A.B.C
#         A: major version, decimal, any number of digits
#         B: minor version, decimal, any number of digits
#     C: patchlevel, one digit, omitted if zero.
#
# ProjectVersionInt does *not* contain the patchlevel (rationale: this
# figure is used for conditional compilations, and library interfaces
# etc. are not supposed to change between patchlevels).
#
# The ProjectVersionInt is included in interface files, and GHC
# checks that it's reading interface generated by the same ProjectVersion
# as itself. It does this even though interface file syntax may not
# change between versions.  Rationale: calling conventions or other
# random .o-file stuff might change even if the .hi syntax doesn't

ProjectName       = @ProjectName@
ProjectTags       =
ProjectVersion    = @ProjectVersion@$(ProjectTags)
ProjectVersionInt = @ProjectVersionInt@
ProjectPatchLevel = @ProjectPatchLevel@
ProjectPatchLevel1 = @ProjectPatchLevel1@
ProjectPatchLevel2 = @ProjectPatchLevel2@
ProjectGitCommitId = @ProjectGitCommitId@

################################################################################
#
#       Platform variables
#
################################################################################

# A "platform" is the GNU cpu-type/manufacturer/operating-system target machine
# specifier.  E.g. sparc-sun-solaris2
#
# Build  platform: the platform on which we are doing this build
# Host   platform: the platform on which these binaries will run
# Target platform: the platform for which this compiler will generate code
#
# We don't support build & host being different, because the build
# process creates binaries that are run during the build, and also
# installed.
#
# If host & target are different, then we are building a compiler
# which will generate intermediate .hc files to port to the target
# architecture for bootstrapping.  The libraries and stage 2 compiler
# will be built as HC files for the target system, and likely won't
# build on this host platform.
#
# An important invariant is that for any piece of source code, the
# platform on which the code is going to run is the HOST platform,
# and the platform on which we are building is the BUILD platform.
# Additionally for the compiler, the platform this compiler will
# generate code for is the TARGET.  TARGET is not meaningful outside
# the compiler sources.
#
# Guidelines for when to use HOST vs. TARGET:
#
#  - In the build system (Makefile, foo.mk), normally we should test
#    $(HOSTPLATFORM).  There are some cases (eg. installation), where
#    we expect $(HOSTPLATFORM)==$(TARGETPLATFORM), so in those cases it
#    doesn't matter which is used.
#
#  - In the compiler itself, we should test HOST or TARGET depending
#    on whether the conditional relates to the code being generated, or
#    the platform on which the compiler is running.  See the section
#    on "coding-style" in the commentary for more details.
#
#  - In all other code, we should be testing HOST only.
#
# NOTE: cross-compiling is not well supported by the build system.
# You have to do a lot of work by hand to cross compile: see the
# section on "Porting GHC" in the Building Guide.

HOSTPLATFORM            = @HostPlatform@
TARGETPLATFORM          = @TargetPlatform@
BUILDPLATFORM           = @BuildPlatform@

HostPlatform_CPP        = @HostPlatform_CPP@
HostArch_CPP            = @HostArch_CPP@
HostOS_CPP              = @HostOS_CPP@
HostVendor_CPP          = @HostVendor_CPP@

TargetPlatform_CPP      = @TargetPlatform_CPP@
TargetArch_CPP          = @TargetArch_CPP@
TargetOS_CPP            = @TargetOS_CPP@
TargetVendor_CPP        = @TargetVendor_CPP@
LLVMTarget_CPP          = @LLVMTarget_CPP@

BuildPlatform_CPP       = @BuildPlatform_CPP@
BuildArch_CPP           = @BuildArch_CPP@
BuildOS_CPP             = @BuildOS_CPP@
BuildVendor_CPP         = @BuildVendor_CPP@

@HostPlatform_CPP@_HOST           = 1
@TargetPlatform_CPP@_TARGET       = 1
@BuildPlatform_CPP@_BUILD         = 1

@HostArch_CPP@_HOST_ARCH          = 1
@TargetArch_CPP@_TARGET_ARCH      = 1
@BuildArch_CPP@_BUILD_ARCH        = 1

@HostOS_CPP@_HOST_OS              = 1
@TargetOS_CPP@_TARGET_OS          = 1
@BuildOS_CPP@_BUILD_OS            = 1

@HostVendor_CPP@_HOST_VENDOR      = 1
@TargetVendor_CPP@_TARGET_VENDOR  = 1
@BuildVendor_CPP@_BUILD_VENDOR    = 1

################################################################################
#
#       Global configuration options
#
################################################################################

# Leading underscores on symbol names in object files
# Valid options: YES/NO
#
LeadingUnderscore=@LeadingUnderscore@

# Pin a suffix on executables? If so, what (Windows only).
exeext0=@exeext_host@
exeext1=@exeext_target@
exeext2=@exeext_target@
exeext3=@exeext_target@
soext=@soext_target@

# Windows_Host=YES if on a Windows platform
ifneq "$(findstring $(HostOS_CPP), mingw32)" ""
Windows_Host=YES
else
Windows_Host=NO
endif

# Darwin_Host=YES if on a Darwin platform
ifneq "$(findstring $(HostOS_CPP), darwin)" ""
Darwin_Host=YES
else
Darwin_Host=NO
endif

# Windows_Target=YES if we are targeting a Windows platform
ifneq "$(findstring $(TargetOS_CPP), mingw32)" ""
Windows_Target=YES
else
Windows_Target=NO
endif

# In case of Solaris OS, does it provide broken shared libs
# linker or not?
SOLARIS_BROKEN_SHLD=@SOLARIS_BROKEN_SHLD@

# Is the stage0 compiler affected by Bug #9439?
GHC_LLVM_AFFECTED_BY_9439 = @GHC_LLVM_AFFECTED_BY_9439@

ifeq "$(TargetArch_CPP)" "arm"
ARM_ISA=@ARM_ISA@
endif