File: Test.mk

package info (click to toggle)
zmk 0.5.1-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 1,132 kB
  • sloc: makefile: 1,749; sh: 313; ansic: 42; awk: 12; cpp: 12
file content (188 lines) | stat: -rw-r--r-- 11,174 bytes parent folder | download
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
#!/usr/bin/make -f
include zmk/internalTest.mk

t:: debug-defaults debug-sysroot debug-dependency-tracking \
	debug-mingw-cc-detection debug-mingw-cxx-detection \
	debug-watcom-dos-cc-detection debug-watcom-dos-cxx-detection \
	debug-watcom-win16-cc-detection debug-watcom-win16-cxx-detection \
	debug-watcom-win32-cc-detection debug-watcom-win32-cxx-detection \
	debug-gcc-configured-cross debug-g++-configured-cross \

# Test logs will contain debugging messages
%.log: ZMK.makeOverrides += DEBUG=toolchain

# Isolate from any tools installed on the host.
# This is useful to verify with forkstat(1).
%.log: ZMK.makeOverrides += Toolchain.CC.IsAvailable=yes
%.log: ZMK.makeOverrides += Toolchain.CXX.IsAvailable=yes
%.log: ZMK.makeOverrides += Toolchain.cc=/usr/bin/host-linux-gnu-gcc
%.log: ZMK.makeOverrides += Toolchain.cc.dumpmachine=host-linux-gnu
%.log: ZMK.makeOverrides += Toolchain.gcc.dumpmachine=build-linux-gnu
%.log: ZMK.makeOverrides += Toolchain.cxx=/usr/bin/host-linux-gnu-g++
%.log: ZMK.makeOverrides += Toolchain.cxx.dumpmachine=host-linux-gnu
%.log: ZMK.makeOverrides += Toolchain.g++.dumpmachine=build-linux-gnu
%.log: ZMK.makeOverrides += Toolchain.cc.version=
%.log: ZMK.makeOverrides += Toolchain.cxx.version=

debug-defaults: debug-defaults.log
	# By default CC=cc and CXX is either c++ or g++.
	GREP -qFx 'DEBUG: CC=cc' <$<
	GREP -qx 'DEBUG: CXX=[cg][+][+]' <$<

debug-sysroot.log: ZMK.makeOverrides += Configure.SysRoot=/path
debug-sysroot: debug-sysroot.log
	# SysRoot setting is inherited from the configuration system.
	GREP -qFx 'DEBUG: Toolchain.SysRoot=/path' <$<

debug-dependency-tracking.log: ZMK.makeOverrides += Configure.DependencyTracking=yes
debug-dependency-tracking: debug-dependency-tracking.log
	# DependencyTracking setting is inherited from the configuration system.
	GREP -qFx 'DEBUG: Toolchain.DependencyTracking=yes' <$<

debug-mingw-cc-detection.log: ZMK.makeOverrides += CC=fake-fake-mingw32-gcc
debug-mingw-cc-detection.log: ZMK.makeOverrides += Toolchain.cc.dumpmachine=fake-fake-mingw32
debug-mingw-cc-detection: debug-mingw-cc-detection.log
	# When CC is set to a mingw C compiler, then the image format is PE
	# and the toolchain is assumed to be a cross toolchain.
	# TODO: add a variant of this test that does not toggle cross
	# compilation condition from Windows.
	GREP -qFx 'DEBUG: .exe suffix enabled because fake-fake-mingw32-gcc -dumpmachine mentions mingw' <$<
	GREP -qFx 'DEBUG: cross-compiling because gcc -dumpmachine and fake-fake-mingw32-gcc -dumpmachine differ' <$<
	GREP -qFx 'DEBUG: Toolchain.CC.ImageFormat=PE' <$<
	GREP -qFx 'DEBUG: Toolchain.CC.IsCross=yes' <$<
	GREP -qFx 'DEBUG: Toolchain.ImageFormat=Mixed' <$<
	GREP -qFx 'DEBUG: Toolchain.IsCross=yes' <$<

debug-mingw-cxx-detection.log: ZMK.makeOverrides += CXX=fake-fake-mingw32-g++
debug-mingw-cxx-detection.log: ZMK.makeOverrides += Toolchain.cxx.dumpmachine=fake-fake-mingw32
debug-mingw-cxx-detection: debug-mingw-cxx-detection.log
	# When CXX is set to a mingw C++ compiler, then the image format is PE
	# and the toolchain is assumed to be a cross toolchain.
	# TODO: add a variant of this test that does not toggle cross
	# compilation condition from Windows.
	GREP -qFx 'DEBUG: .exe suffix enabled because fake-fake-mingw32-g++ -dumpmachine mentions mingw' <$<
	GREP -qFx 'DEBUG: cross-compiling because g++ -dumpmachine and fake-fake-mingw32-g++ -dumpmachine differ' <$<
	GREP -qFx 'DEBUG: Toolchain.CXX.ImageFormat=PE' <$<
	GREP -qFx 'DEBUG: Toolchain.CXX.IsCross=yes' <$<
	GREP -qFx 'DEBUG: Toolchain.ImageFormat=Mixed' <$<
	GREP -qFx 'DEBUG: Toolchain.IsCross=yes' <$<

debug-watcom-dos-cc-detection.log: ZMK.makeOverrides += CC=open-watcom.owcc-dos
debug-watcom-dos-cc-detection.log: ZMK.makeOverrides += Toolchain.cc=/snap/open-watcom.owcc-dos
debug-watcom-dos-cc-detection: debug-watcom-dos-cc-detection.log
	# When CC is set to a OpenWatcom C compiler targeting DOS,
	# then the image format is MZ and the toolchain is assumed to be a
	# cross toolchain.
	GREP -qFx 'DEBUG: .exe suffix enabled because open-watcom.owcc-dos name' <$<
	GREP -qFx 'DEBUG: cross-compiling because Watcom targets DOS' <$<
	GREP -qFx 'DEBUG: Toolchain.CC.ImageFormat=MZ' <$<
	GREP -qFx 'DEBUG: Toolchain.CC.IsCross=yes' <$<
	GREP -qFx 'DEBUG: Toolchain.ImageFormat=Mixed' <$<
	GREP -qFx 'DEBUG: Toolchain.IsCross=yes' <$<

debug-watcom-dos-cxx-detection.log: ZMK.makeOverrides += CXX=open-watcom.owcc-dos
debug-watcom-dos-cxx-detection.log: ZMK.makeOverrides += Toolchain.cxx=/snap/open-watcom.owcc-dos
debug-watcom-dos-cxx-detection: debug-watcom-dos-cxx-detection.log
	# When CXX is set to a OpenWatcom C++ compiler targeting DOS,
	# then the image format is MZ and the toolchain is assumed to be a
	# cross toolchain.
	GREP -qFx 'DEBUG: .exe suffix enabled because open-watcom.owcc-dos name' <$<
	GREP -qFx 'DEBUG: cross-compiling because Watcom targets DOS' <$<
	GREP -qFx 'DEBUG: Toolchain.CXX.ImageFormat=MZ' <$<
	GREP -qFx 'DEBUG: Toolchain.CXX.IsCross=yes' <$<
	GREP -qFx 'DEBUG: Toolchain.ImageFormat=Mixed' <$<
	GREP -qFx 'DEBUG: Toolchain.IsCross=yes' <$<

debug-watcom-win16-cc-detection.log: ZMK.makeOverrides += CC=open-watcom.owcc-win16
debug-watcom-win16-cc-detection.log: ZMK.makeOverrides += Toolchain.cc=/snap/open-watcom.owcc-win16
debug-watcom-win16-cc-detection: debug-watcom-win16-cc-detection.log
	# When CC is set to a OpenWatcom C compiler targeting Windows 3.x,
	# then the image format is MZ and the toolchain is assumed to be a
	# cross toolchain.
	GREP -qFx 'DEBUG: .exe suffix enabled because open-watcom.owcc-win16 name' <$<
	GREP -qFx 'DEBUG: cross-compiling because Watcom targets DOS' <$<
	GREP -qFx 'DEBUG: Toolchain.CC.ImageFormat=MZ' <$<
	GREP -qFx 'DEBUG: Toolchain.CC.IsCross=yes' <$<
	GREP -qFx 'DEBUG: Toolchain.ImageFormat=Mixed' <$<
	GREP -qFx 'DEBUG: Toolchain.IsCross=yes' <$<

debug-watcom-win16-cxx-detection.log: ZMK.makeOverrides += CXX=open-watcom.owcc-win16
debug-watcom-win16-cxx-detection.log: ZMK.makeOverrides += Toolchain.cxx=/snap/open-watcom.owcc-win16
debug-watcom-win16-cxx-detection: debug-watcom-win16-cxx-detection.log
	# When CXX is set to a OpenWatcom C++ compiler targeting Windows 3.x,
	# then the image format is MZ and the toolchain is assumed to be a
	# cross toolchain.
	GREP -qFx 'DEBUG: .exe suffix enabled because open-watcom.owcc-win16 name' <$<
	GREP -qFx 'DEBUG: cross-compiling because Watcom targets DOS' <$<
	GREP -qFx 'DEBUG: Toolchain.CXX.ImageFormat=MZ' <$<
	GREP -qFx 'DEBUG: Toolchain.CXX.IsCross=yes' <$<
	GREP -qFx 'DEBUG: Toolchain.ImageFormat=Mixed' <$<
	GREP -qFx 'DEBUG: Toolchain.IsCross=yes' <$<

debug-watcom-win32-cc-detection.log: ZMK.makeOverrides += CC=open-watcom.owcc-win32
debug-watcom-win32-cc-detection.log: ZMK.makeOverrides += Toolchain.cc=/snap/open-watcom.owcc-win32
debug-watcom-win32-cc-detection: debug-watcom-win32-cc-detection.log
	# When CC is set to a OpenWatcom C compiler targeting Windows NT,
	# then the image format is PE and the toolchain is assumed to be a
	# cross toolchain.
	GREP -qFx 'DEBUG: .exe suffix enabled because open-watcom.owcc-win32 name' <$<
	GREP -qFx 'DEBUG: cross-compiling because Watcom targets Windows' <$<
	GREP -qFx 'DEBUG: Toolchain.CC.ImageFormat=PE' <$<
	GREP -qFx 'DEBUG: Toolchain.CC.IsCross=yes' <$<
	GREP -qFx 'DEBUG: Toolchain.ImageFormat=Mixed' <$<
	GREP -qFx 'DEBUG: Toolchain.IsCross=yes' <$<

debug-watcom-win32-cxx-detection.log: ZMK.makeOverrides += CXX=open-watcom.owcc-win32
debug-watcom-win32-cxx-detection.log: ZMK.makeOverrides += Toolchain.cxx=/snap/open-watcom.owcc-win32
debug-watcom-win32-cxx-detection: debug-watcom-win32-cxx-detection.log
	# When CXX is set to a OpenWatcom C++ compiler targeting Windows NT,
	# then the image format is PE and the toolchain is assumed to be a
	# cross toolchain.
	GREP -qFx 'DEBUG: .exe suffix enabled because open-watcom.owcc-win32 name' <$<
	GREP -qFx 'DEBUG: cross-compiling because Watcom targets Windows' <$<
	GREP -qFx 'DEBUG: Toolchain.CXX.ImageFormat=PE' <$<
	GREP -qFx 'DEBUG: Toolchain.CXX.IsCross=yes' <$<
	GREP -qFx 'DEBUG: Toolchain.ImageFormat=Mixed' <$<
	GREP -qFx 'DEBUG: Toolchain.IsCross=yes' <$<

debug-gcc-configured-cross.log: ZMK.makeOverrides += Configure.Configured=yes
debug-gcc-configured-cross.log: ZMK.makeOverrides += Configure.HostArchTriplet=host-linux-gnu
debug-gcc-configured-cross.log: ZMK.makeOverrides += Configure.BuildArchTriplet=build-linux-gnu
debug-gcc-configured-cross.log: ZMK.makeOverrides += Toolchain.cc=/usr/bin/host-linux-gnu-gcc
debug-gcc-configured-cross.log: ZMK.makeOverrides += Toolchain.cc.dumpmachine=host-linux-gnu
debug-gcc-configured-cross.log: ZMK.makeOverrides += Toolchain.gcc.dumpmachine=build-linux-gnu
debug-gcc-configured-cross.log: ZMK.makeOverrides += Toolchain.cxx=/usr/bin/host-linux-gnu-g++
debug-gcc-configured-cross.log: ZMK.makeOverrides += Toolchain.cxx.dumpmachine=host-linux-gnu
debug-gcc-configured-cross.log: ZMK.makeOverrides += Toolchain.g++.dumpmachine=build-linux-gnu
debug-gcc-configured-cross: debug-gcc-configured-cross.log
	# When the configure script selects different linux build and host
	# machines, then both the C and C++ compilers are set to the
	# appropriate GCC binary, then image format is ELF and the toolchain is
	# assumed to be a cross toolchain.
	GREP -qFx 'DEBUG: gcc cross-compiler selected CC=host-linux-gnu-gcc' <$<
	GREP -qFx 'DEBUG: cross-compiling because gcc -dumpmachine and host-linux-gnu-gcc -dumpmachine differ' <$<
	GREP -qFx 'DEBUG: Toolchain.CC.ImageFormat=ELF' <$<
	GREP -qFx 'DEBUG: Toolchain.CC.IsCross=yes' <$<
	GREP -qFx 'DEBUG: Toolchain.ImageFormat=ELF' <$<
	GREP -qFx 'DEBUG: Toolchain.IsCross=yes' <$<

debug-g++-configured-cross.log: ZMK.makeOverrides += Configure.Configured=yes
debug-g++-configured-cross.log: ZMK.makeOverrides += Configure.HostArchTriplet=host-linux-gnu
debug-g++-configured-cross.log: ZMK.makeOverrides += Configure.BuildArchTriplet=build-linux-gnu
debug-g++-configured-cross.log: ZMK.makeOverrides += Toolchain.cc=/usr/bin/host-linux-gnu-gcc
debug-g++-configured-cross.log: ZMK.makeOverrides += Toolchain.cc.dumpmachine=host-linux-gnu
debug-g++-configured-cross.log: ZMK.makeOverrides += Toolchain.cxx=/usr/bin/host-linux-gnu-g++
debug-g++-configured-cross.log: ZMK.makeOverrides += Toolchain.cxx.dumpmachine=host-linux-gnu
debug-g++-configured-cross.log: ZMK.makeOverrides += Toolchain.gcc.dumpmachine=build-linux-gnu
debug-g++-configured-cross.log: ZMK.makeOverrides += Toolchain.g++.dumpmachine=build-linux-gnu
debug-g++-configured-cross: debug-g++-configured-cross.log
	# When the configure script selects different linux build and host
	# machines, then both the C and C++ compilers are set to the
	# appropriate GCC binary, the image format is ELF and the toolchain is
	# assumed to be a cross toolchain.
	GREP -qFx 'DEBUG: g++ cross-compiler selected CXX=host-linux-gnu-g++' <$<
	GREP -qFx 'DEBUG: cross-compiling because g++ -dumpmachine and host-linux-gnu-g++ -dumpmachine differ' <$<
	GREP -qFx 'DEBUG: Toolchain.CXX.ImageFormat=ELF' <$<
	GREP -qFx 'DEBUG: Toolchain.CXX.IsCross=yes' <$<
	GREP -qFx 'DEBUG: Toolchain.ImageFormat=ELF' <$<
	GREP -qFx 'DEBUG: Toolchain.IsCross=yes' <$<