summaryrefslogtreecommitdiffstats
path: root/make/include/gcc.defs
blob: 50b31f1002baaafea6613b3e8560a48e4c861da0 (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
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
GCC.gcc = gcc
GCC.gxx = $(dir $(GCC.gcc))$(subst clang,clang++,$(subst gcc,g++,$(notdir $(GCC.gcc))))

GCC.strip   = $$(if $$(filter none,$$(GCC.g)),1)
GCC.dylib   = 1
GCC.pipe    = 1
GCC.ML      = 1
GCC.H       = 0
GCC.W       = all
GCC.archs   =
GCC.sysroot =
GCC.minver  =
GCC.vis     = 0
GCC.pic     = 0
ifndef GCC.g
	GCC.g       = none
endif
ifndef GCC.O
    GCC.O       = none
endif
GCC.D       =
GCC.I       =
GCC.muldefs = 0
GCC.start   = 0
GCC.a       =
GCC.F       =
GCC.f       =
GCC.L       =
GCC.l       =
GCC.end     = 0

GCC.extra         = 1
GCC.extra.h_o     = 1
GCC.extra.c_o     = 1
GCC.extra.dylib   = 1
GCC.extra.exe     = 1
GCC.extra.hpp_o   = 1
GCC.extra.cpp_o   = 1
GCC.extra.dylib++ = 1
GCC.extra.exe++   = 1

GCC.args.pipe      = -pipe
GCC.args.strip     = -Wl,-S
GCC.args.dylib     = -dynamiclib
GCC.args.ML        = -fmessage-length=0
GCC.args.H         = -H
GCC.args.W         = -W$(1)
GCC.args.archs     = -arch $(1)
GCC.args.sysroot   = --sysroot=$(1)
GCC.args.minver    = -mmacosx-version-min=$(1)
GCC.args.vis       = -fvisibility=hidden
GCC.args.pic       = -fPIC
GCC.args.g.none    = -g0
GCC.args.g.min     = -gdwarf-2 -g1
GCC.args.g.std     = -gdwarf-2
GCC.args.g.max     = -gdwarf-2 -g3
GCC.args.O.none    = -O0
GCC.args.O.size    = -Os
GCC.args.O.speed   = -O3
GCC.args.D         = -D$(1)
GCC.args.I         = -I$(1)
GCC.args.muldefs   = -Wl,--allow-multiple-definition
GCC.args.start     = -Wl,--start-group
GCC.args.F         = -F$(1)
GCC.args.f         = -framework $(1)
GCC.args.L         = -L$(1)
GCC.args.l         = -l$(1)
GCC.args.end       = -Wl,--end-group

GCC.args.extra         =
GCC.args.extra.h_o     =
GCC.args.extra.c_o     =
GCC.args.extra.dylib   =
GCC.args.extra.exe     =
GCC.args.extra.hpp_o   =
GCC.args.extra.cpp_o   =
GCC.args.extra.dylib++ =
GCC.args.extra.exe++   =

###############################################################################

define import.GCC
    $(1).GCC.gcc = $$(GCC.gcc)
    $(1).GCC.gxx = $$(dir $$($(1).GCC.gcc))$$(subst gcc,g++,$$(notdir $$($(1).GCC.gcc)))

    $(1).GCC.pipe    = $$(GCC.pipe)
    $(1).GCC.strip   = $$(if $$(filter none,$$($(1).GCC.g)),1)
    $(1).GCC.dylib   = $$(GCC.dylib)
    $(1).GCC.ML      = $$(GCC.ML) 
    $(1).GCC.H       = $$(GCC.H) 
    $(1).GCC.W       = $$(GCC.W)
    $(1).GCC.archs   = $$(GCC.archs)
    $(1).GCC.sysroot = $$(GCC.sysroot)
    $(1).GCC.minver  = $$(GCC.minver)
    $(1).GCC.vis     = $$(GCC.vis)
    $(1).GCC.pic     = $$(GCC.pic)
    $(1).GCC.g       = $$(GCC.g)
    $(1).GCC.O       = $$(GCC.O)
    $(1).GCC.D       = $$(GCC.D)
    $(1).GCC.I       = $$(GCC.I)
    $(1).GCC.muldefs = $$(GCC.muldefs)
    $(1).GCC.start   = $$(GCC.start)
    $(1).GCC.a       = $$(GCC.a)
    $(1).GCC.F       = $$(GCC.F)
    $(1).GCC.f       = $$(GCC.f)
    $(1).GCC.L       = $$(GCC.L)
    $(1).GCC.l       = $$(GCC.l)
    $(1).GCC.end     = $$(GCC.end)

    $(1).GCC.extra         = $$(GCC.extra)
    $(1).GCC.extra.h_o     = $$(GCC.extra.h_o)
    $(1).GCC.extra.c_o     = $$(GCC.extra.c_o)
    $(1).GCC.extra.dylib   = $$(GCC.extra.dylib)
    $(1).GCC.extra.exe     = $$(GCC.extra.exe)
    $(1).GCC.extra.hpp_o   = $$(GCC.extra.hpp_o)
    $(1).GCC.extra.cpp_o   = $$(GCC.extra.cpp_o)
    $(1).GCC.extra.dylib++ = $$(GCC.extra.dylib++)
    $(1).GCC.extra.exe++   = $$(GCC.extra.exe++)

    $(1).GCC.args.pipe      = $$(GCC.args.pipe)
    $(1).GCC.args.strip     = $$(GCC.args.strip)
    $(1).GCC.args.dylib     = $$(GCC.args.dylib)
    $(1).GCC.args.ML        = $$(GCC.args.ML)
    $(1).GCC.args.H         = $$(GCC.args.H)
    $(1).GCC.args.W         = $$(GCC.args.W)
    $(1).GCC.args.archs     = $$(GCC.args.archs)
    $(1).GCC.args.sysroot   = $$(GCC.args.sysroot)
    $(1).GCC.args.minver    = $$(GCC.args.minver)
    $(1).GCC.args.vis       = $$(GCC.args.vis)
    $(1).GCC.args.pic       = $$(GCC.args.pic)
    $(1).GCC.args.g.none    = $$(GCC.args.g.none)
    $(1).GCC.args.g.min     = $$(GCC.args.g.min)
    $(1).GCC.args.g.std     = $$(GCC.args.g.std)
    $(1).GCC.args.g.max     = $$(GCC.args.g.max)
    $(1).GCC.args.O.none    = $$(GCC.args.O.none)
    $(1).GCC.args.O.size    = $$(GCC.args.O.size)
    $(1).GCC.args.O.speed   = $$(GCC.args.O.speed)
    $(1).GCC.args.D         = $$(GCC.args.D)
    $(1).GCC.args.I         = $$(GCC.args.I)
    $(1).GCC.args.muldefs   = $$(GCC.args.muldefs)
    $(1).GCC.args.start     = $$(GCC.args.start)
    $(1).GCC.args.F         = $$(GCC.args.F)
    $(1).GCC.args.f         = $$(GCC.args.f)
    $(1).GCC.args.L         = $$(GCC.args.L)
    $(1).GCC.args.l         = $$(GCC.args.l)
    $(1).GCC.args.end       = $$(GCC.args.end)

    $(1).GCC.args.extra         = $$(GCC.args.extra)
    $(1).GCC.args.extra.h_o     = $$(GCC.args.extra.h_o)
    $(1).GCC.args.extra.c_o     = $$(GCC.args.extra.c_o)
    $(1).GCC.args.extra.dylib   = $$(GCC.args.extra.dylib)
    $(1).GCC.args.extra.exe     = $$(GCC.args.extra.exe)
    $(1).GCC.args.extra.hpp_o   = $$(GCC.args.extra.hpp_o)
    $(1).GCC.args.extra.cpp_o   = $$(GCC.args.extra.cpp_o)
    $(1).GCC.args.extra.dylib++ = $$(GCC.args.extra.dylib++)
    $(1).GCC.args.extra.exe++   = $$(GCC.args.extra.exe++)

    ###########################################################################

    $(1).GCC.c = -c $$(4)
    $(1).GCC.o = -o $$(3)

    # FUNCTION: C precompiled headers
    $(1).GCC.H_O.args = !gcc ?pipe ?ML ?H *W *archs *sysroot *minver ?vis ?pic .g .O ?extra ?extra.h_o *D *I !c !o
    $(1).GCC.H_O = $$(call fn.ARGS,$(1).GCC,$$($(1).GCC.H_O.args),$$(1),$$(2))

    # FUNCTION: C compile source
    $(1).GCC.C_O.args = !gcc ?pipe ?ML ?H *W *archs *sysroot *minver ?vis ?pic .g .O ?extra ?extra.c_o *D *I !c !o
    $(1).GCC.C_O = $$(call fn.ARGS,$(1).GCC,$$($(1).GCC.C_O.args),$$(1),$$(2))

    # FUNCTION: C++ precompile headers
    $(1).GCC.HPP_O.args = !gxx ?pipe ?ML ?H *W *archs *sysroot *minver ?vis ?pic .g .O ?extra ?extra.hpp_o *D *I !c !o
    $(1).GCC.HPP_O = $$(call fn.ARGS,$(1).GCC,$$($(1).GCC.HPP_O.args),$$(1),$$(2))

    # FUNCTION: C++ compile source
    $(1).GCC.CPP_O.args = !gxx ?pipe ?ML ?H *W *archs *sysroot *minver ?vis ?pic .g .O ?extra ?extra.cpp_o *D *I !c !o
    $(1).GCC.CPP_O = $$(call fn.ARGS,$(1).GCC,$$($(1).GCC.CPP_O.args),$$(1),$$(2))

    ###########################################################################

    $(1).GCC.i = $$(4)

    # FUNCTION: C link dynamic-lib
    $(1).GCC.DYLIB.args = !gcc ?pipe ?strip ?dylib ?extra.dylib ?ML *W *archs *sysroot *minver ?vis ?pic .g .O ?extra *D *I !o ?muldefs ?start !i *F *f *L *l *i !a ?end
    $(1).GCC.DYLIB = $$(call fn.ARGS,$(1).GCC,$$($(1).GCC.DYLIB.args),$$(1),$$(2))

    # FUNCTION: C link executable
    $(1).GCC.EXE.args = !gcc ?pipe ?strip ?extra.exe ?ML *W *archs *sysroot *minver ?vis ?pic .g .O ?extra *D *I !o ?muldefs ?start !i *F *f *L *l *i !a ?end
    $(1).GCC.EXE = $$(call fn.ARGS,$(1).GCC,$$($(1).GCC.EXE.args),$$(1),$$(2))

    # FUNCTION: C++ link dynamic-lib
    $(1).GCC.DYLIB++.args = !gxx ?pipe ?strip ?dylib ?extra.dylib++ ?ML *W *arch *sysroot *minvers ?vis ?pic .g .O ?extra *D *I !o ?muldefs ?start !i *F *f *L *l *i !a ?end
    $(1).GCC.DYLIB++ = $$(call fn.ARGS,$(1).GCC,$$($(1).GCC.DYLIB++.args),$$(1),$$(2))

    # FUNCTION: C++ link executable
    $(1).GCC.EXE++.args = !gxx ?pipe ?strip ?extra.exe++ ?ML *W *archs *sysroot *minver ?vis ?pic .g .O ?extra *D *I !o ?muldefs ?start !i *F *f *L *l *i !a ?end
    $(1).GCC.EXE++ = $$(call fn.ARGS,$(1).GCC,$$($(1).GCC.EXE++.args),$$(1),$$(2))
endef