blob: f1e06f6cd1bc355c4ffabaf2f60c032b7062f985 (
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
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
|
AUTOMAKE_OPTIONS = foreign
AM_MAKEFLAGS = --no-print-directory
GIT_SHA1 ?= `git --work-tree=$(top_srcdir) --git-dir=$(top_srcdir)/.git describe --always --long --dirty 2>/dev/null || echo unknown`
libpdbg_tests = libpdbg_target_test \
libpdbg_probe_test1 \
libpdbg_probe_test2 \
libpdbg_probe_test3
bin_PROGRAMS = pdbg
check_PROGRAMS = $(libpdbg_tests) optcmd_test
PDBG_TESTS = \
tests/test_selection.sh \
tests/test_selection2.sh \
tests/test_hw_bmc.sh
TESTS = $(libpdbg_tests) optcmd_test $(PDBG_TESTS)
test: $(libpdbg_tests)
TEST_EXTENSIONS = .sh
SH_LOG_DRIVER = $(SHELL) $(srcdir)/tests/run_test.sh
ACLOCAL_AMFLAGS = -Im4
AM_CFLAGS = -I$(top_srcdir)/ccan/array_size -Wall -Werror -O2
EXTRA_DIST = \
fake.dts.m4 \
p8-fsi.dts.m4 \
p8-host.dts.m4 \
p8-i2c.dts.m4 \
p8-kernel.dts.m4 \
p8-pib.dts.m4 \
p9-fsi.dtsi.m4 \
p9-host.dts.m4 \
p9-kernel.dts.m4 \
p9-pib.dts.m4 \
p9r-fsi.dts.m4 \
p9w-fsi.dts.m4 \
p9z-fsi.dts.m4 \
template.S \
generate_dt_header.sh \
src/gdb_parser.rl \
tests/driver.sh \
tests/run_test.sh \
tests/test_driver.sh \
$(PDBG_TESTS)
if TARGET_ARM
DT_ARM = p8-fsi.dts p8-i2c.dts p8-kernel.dts \
p9w-fsi.dts p9r-fsi.dts p9z-fsi.dts p9-kernel.dts
ARCH_FLAGS="-DTARGET_ARM=1"
endif
if TARGET_PPC
DT_PPC = p8-host.dts p9-host.dts
ARCH_FLAGS="-DTARGET_PPC=1"
endif
DT = fake.dts $(DT_ARM) $(DT_PPC)
DT_objects = $(DT:.dts=.dtb.o)
DT_headers = $(DT:.dts=.dt.h)
optcmd_test_SOURCES = src/optcmd.c src/parsers.c src/tests/optcmd_test.c
optcmd_test_CFLAGS = -Wall -g
pdbg_SOURCES = \
src/cfam.c \
src/htm.c \
src/htm.h \
src/main.c \
src/main.h \
src/mem.c \
src/optcmd.c \
src/optcmd.h \
src/options.h \
src/parsers.c \
src/parsers.h \
src/path.c \
src/path.h \
src/pdbgproxy.c \
src/pdbgproxy.h \
src/progress.c \
src/progress.h \
src/reg.c \
src/ring.c \
src/scom.c \
src/thread.c \
src/util.c \
src/util.h
if TARGET_ARM
pdbg_SOURCES += src/options_arm.c
else
if TARGET_PPC
pdbg_SOURCES += src/options_ppc.c
else
pdbg_SOURCES += src/options_def.c
endif
endif
pdbg_CFLAGS = -I$(top_srcdir)/libpdbg -Wall -Werror -DGIT_SHA1=\"${GIT_SHA1}\" \
$(ARCH_FLAGS)
if GDBSERVER
if HAVE_RAGEL
pdbg_SOURCES += src/gdb_parser.c
else
pdbg_SOURCES += src/gdb_parser_precompile.c
endif
else
pdbg_CFLAGS += -DDISABLE_GDBSERVER
endif
src/main.c: $(DT_headers)
src/pdbg-gdb_parser.$(OBJEXT): CFLAGS+=-Wno-unused-const-variable
pdbg_LDADD = $(DT_objects) libpdbg.la libccan.a \
-L.libs -lrt
pdbg_LDFLAGS = -Wl,--whole-archive,-lpdbg,--no-whole-archive
lib_LTLIBRARIES = libfdt.la libpdbg.la
libfdt_la_CFLAGS = -I$(top_srcdir)/libfdt
libpdbg_la_CFLAGS = -I$(top_srcdir)/libfdt -Wall -Werror
libfdt_la_SOURCES = \
libfdt/fdt_addresses.c \
libfdt/fdt.c \
libfdt/fdt_empty_tree.c \
libfdt/fdt.h \
libfdt/fdt_overlay.c \
libfdt/fdt_ro.c \
libfdt/fdt_rw.c \
libfdt/fdt_strerror.c \
libfdt/fdt_sw.c \
libfdt/fdt_wip.c \
libfdt/libfdt_env.h \
libfdt/libfdt.h \
libfdt/libfdt_internal.h
libpdbg_la_SOURCES = \
libpdbg/adu.c \
libpdbg/backend.h \
libpdbg/bitutils.h \
libpdbg/bmcfsi.c \
libpdbg/cfam.c \
libpdbg/chip.c \
libpdbg/chip.h \
libpdbg/compiler.h \
libpdbg/debug.c \
libpdbg/debug.h \
libpdbg/device.c \
libpdbg/fake.c \
libpdbg/host.c \
libpdbg/htm.c \
libpdbg/i2c.c \
libpdbg/kernel.c \
libpdbg/libpdbg.c \
libpdbg/libpdbg.h \
libpdbg/operations.h \
libpdbg/p8chip.c \
libpdbg/p9chip.c \
libpdbg/target.c \
libpdbg/target.h \
libpdbg/xbus.c
libpdbg_la_LIBADD = libfdt.la
include_HEADERS = libpdbg/libpdbg.h
noinst_LIBRARIES = libccan.a
libccan_a_SOURCES = \
ccan/array_size/array_size.h \
ccan/build_assert/build_assert.h \
ccan/check_type/check_type.h \
ccan/container_of/container_of.h \
ccan/cppmagic/cppmagic.h \
ccan/list/list.c \
ccan/list/list.h \
ccan/short_types/short_types.h \
ccan/str/str.c \
ccan/str/str.h
libpdbg_test_cflags = -I$(top_srcdir)/libpdbg -I$(top_srcdir)/libfdt
libpdbg_test_ldflags = -Wl,--whole-archive,-lpdbg,--no-whole-archive
libpdbg_test_ldadd = -L.libs libpdbg.la
libpdbg_target_test_SOURCES = src/tests/libpdbg_target_test.c
libpdbg_target_test_CFLAGS = $(libpdbg_test_cflags)
libpdbg_target_test_LDFLAGS = $(libpdbg_test_ldflags)
libpdbg_target_test_LDADD = fake.dtb.o $(libpdbg_test_ldadd)
src/tests/libpdbg_target_test.c: fake.dt.h
libpdbg_probe_test1_SOURCES = src/tests/libpdbg_probe_test.c
libpdbg_probe_test1_CFLAGS = $(libpdbg_test_cflags) -DTEST_ID=1
libpdbg_probe_test1_LDFLAGS = $(libpdbg_test_ldflags)
libpdbg_probe_test1_LDADD = fake.dtb.o $(libpdbg_test_ldadd)
libpdbg_probe_test2_SOURCES = src/tests/libpdbg_probe_test.c
libpdbg_probe_test2_CFLAGS = $(libpdbg_test_cflags) -DTEST_ID=2
libpdbg_probe_test2_LDFLAGS = $(libpdbg_test_ldflags)
libpdbg_probe_test2_LDADD = fake.dtb.o $(libpdbg_test_ldadd)
libpdbg_probe_test3_SOURCES = src/tests/libpdbg_probe_test.c
libpdbg_probe_test3_CFLAGS = $(libpdbg_test_cflags) -DTEST_ID=3
libpdbg_probe_test3_LDFLAGS = $(libpdbg_test_ldflags)
libpdbg_probe_test3_LDADD = fake.dtb.o $(libpdbg_test_ldadd)
src/tests/libpdbg_probe_test.c: fake.dt.h
M4_V = $(M4_V_$(V))
M4_V_ = $(M4_V_$(AM_DEFAULT_VERBOSITY))
M4_V_0 = @echo " M4 " $@;
DTC_V = $(DTC_V_$(V))
DTC_V_ = $(DTC_V_$(AM_DEFAULT_VERBOSITY))
DTC_V_0 = @echo " DTC " $@;
GEN_V = $(GEN_V_$(V))
GEN_V_ = $(GEN_V_$(AM_DEFAULT_VERBOSITY))
GEN_V_0 = @echo " GEN " $@;
RAGEL_V = $(RAGEL_V_$(V))
RAGEL_V_ = $(RAGEL_V_$(AM_DEFAULT_VERBOSITY))
RAGEL_V_0 = @echo " RAGEL " $@;
%.dts: %.dts.m4
$(M4_V)$(M4) -I$(dir $<) $< | $(DTC) -I dts -O dts > $@
%.dtsi: %.dtsi.m4
$(M4_V)$(M4) -I$(dir $<) $< > $@
p9-fsi.dtsi: p9-fsi.dtsi.m4 p9-pib.dts.m4
p9w-fsi.dts: p9w-fsi.dts.m4 p9-fsi.dtsi
p9r-fsi.dts: p9r-fsi.dts.m4 p9-fsi.dtsi
p9z-fsi.dts: p9z-fsi.dts.m4 p9-fsi.dtsi
%.dtb: %.dts
$(DTC_V)$(DTC) -i$(dir $@) -I dts $< -O dtb > $@
%.dt.h: %.dts
$(GEN_V)$(srcdir)/generate_dt_header.sh $< > $@
%.dtb.o: %.dtb
$(AM_V_CC)$(CC) -c $(srcdir)/template.S -DSYMBOL_PREFIX=$(shell basename $@ | tr '.-' '_') -DFILENAME=\"$<\" -o $@
%.c: %.rl
$(RAGEL_V)$(RAGEL) -o $@ $<
MOSTLYCLEANFILES = *.dtb *.dts *.dt.h p9-fsi.dtsi src/gdb_parser.c
|