forked from libvmi/libvmi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.am
311 lines (264 loc) · 10.2 KB
/
Makefile.am
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
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
h_public = libvmi/libvmi.h \
libvmi/libvmi_extra.h \
libvmi/slat.h \
libvmi/x86.h
h_private = \
libvmi/private.h \
libvmi/debug.h \
libvmi/msr-index.h \
libvmi/glib_compat.h \
libvmi/arch/arch_interface.h \
libvmi/arch/intel.h \
libvmi/arch/amd64.h \
libvmi/arch/arm_aarch32.h \
libvmi/arch/arm_aarch64.h \
libvmi/arch/ept.h \
libvmi/os/os_interface.h \
libvmi/driver/driver_interface.h \
libvmi/driver/driver_wrapper.h \
libvmi/driver/memory_cache.h \
libvmi/disk/vbd_private.h
c_sources = \
libvmi/accessors.c \
libvmi/convenience.c \
libvmi/core.c \
libvmi/events.c \
libvmi/pretty_print.c \
libvmi/read.c \
libvmi/slat.c \
libvmi/strmatch.c \
libvmi/write.c \
libvmi/msr-index.c \
libvmi/arch/arch_interface.c \
libvmi/arch/intel.c \
libvmi/arch/amd64.c \
libvmi/arch/arm_aarch32.c \
libvmi/arch/arm_aarch64.c \
libvmi/arch/ept.c \
libvmi/driver/driver_interface.c \
libvmi/driver/memory_cache.c \
libvmi/os/os_interface.c \
libvmi/disk/vbd.c
if ENABLE_ADDRESS_CACHE
c_sources += libvmi/cache.c
c_sources += libvmi/cache.h
endif
if ENABLE_JSON_PROFILES
c_sources += libvmi/json_profiles/json_profiles.c
h_private += libvmi/json_profiles/json_profiles.h
endif
if ENABLE_VOLATILITY_IST
c_sources += libvmi/json_profiles/volatility_ist.c
h_private += libvmi/json_profiles/volatility_ist.h
endif
if ENABLE_REKALL_PROFILES
c_sources += libvmi/json_profiles/rekall.c
h_private += libvmi/json_profiles/rekall.h
endif
drivers =
if WITH_FILE
drivers += libvmi/driver/file/file.h \
libvmi/driver/file/file_private.h \
libvmi/driver/file/file.c
endif
if WITH_KVM
drivers += libvmi/driver/kvm/kvm.h \
libvmi/driver/kvm/kvm_private.h \
libvmi/driver/kvm/kvm_common.c \
libvmi/driver/kvm/libvirt_wrapper.c \
libvmi/driver/kvm/libvirt_wrapper.h
if WITH_KVM_LEGACY
drivers += libvmi/driver/kvm/kvm_legacy.c
else
h_public += libvmi/events.h
drivers += libvmi/driver/kvm/kvm.c \
libvmi/driver/kvm/kvm_events.c \
libvmi/driver/kvm/kvm_events.h \
libvmi/driver/kvm/kvm_slat.c \
libvmi/driver/kvm/kvm_slat.h \
libvmi/driver/kvm/libkvmi_wrapper.c \
libvmi/driver/kvm/libkvmi_wrapper.h
endif
endif
if WITH_XEN
h_public += libvmi/events.h
drivers += libvmi/driver/xen/altp2m.c \
libvmi/driver/xen/altp2m_private.h \
libvmi/driver/xen/xen.h \
libvmi/driver/xen/xen_private.h \
libvmi/driver/xen/xen.c \
libvmi/driver/xen/xen_events.c \
libvmi/driver/xen/xen_events.h \
libvmi/driver/xen/xen_events_abi.h \
libvmi/driver/xen/xen_events_private.h \
libvmi/driver/xen/libxc_wrapper.c \
libvmi/driver/xen/libxc_wrapper.h \
libvmi/driver/xen/libxs_wrapper.c \
libvmi/driver/xen/libxs_wrapper.h
endif
if WITH_BAREFLANK
drivers += libvmi/driver/bareflank/bareflank.h \
libvmi/driver/bareflank/bareflank_private.h \
libvmi/driver/bareflank/bareflank.c \
libvmi/driver/bareflank/hypercall.h \
libvmi/driver/bareflank/hypercall.S
endif
os =
if WINDOWS
h_public += libvmi/peparse.h
os += libvmi/os/windows/windows.h \
libvmi/os/windows/core.c \
libvmi/os/windows/kdbg.c \
libvmi/os/windows/memory.c \
libvmi/os/windows/peparse.c \
libvmi/os/windows/process.c \
libvmi/os/windows/unicode.c
endif
if LINUX
h_public += libvmi/elfparse.h
os += libvmi/os/linux/linux.h \
libvmi/os/linux/core.c \
libvmi/os/linux/memory.c \
libvmi/os/linux/symbols.c \
libvmi/os/linux/elfparse.c
endif
if FREEBSD
os += libvmi/os/freebsd/freebsd.h \
libvmi/os/freebsd/core.c \
libvmi/os/freebsd/memory.c \
libvmi/os/freebsd/symbols.c
endif
if OSX
os += libvmi/os/osx/osx.h \
libvmi/os/osx/core.c \
libvmi/os/osx/memory.c \
libvmi/os/osx/symbols.c
endif
library_includedir=$(includedir)/libvmi
library_include_HEADERS = $(h_public)
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = libvmi.pc
AM_CPPFLAGS = -I$(top_srcdir)/libvmi
AM_CFLAGS = $(CFLAGS)
AM_YFLAGS = -y -d
AM_LDFLAGS = $(LDFLAGS)
lib_LTLIBRARIES= libvmi/libvmi.la
libvmi_libvmi_la_SOURCES= $(h_public) $(h_private) $(drivers) $(os) $(c_sources)
libvmi_libvmi_la_CFLAGS= -fvisibility=hidden $(GLIB_CFLAGS) $(JSONC_CFLAGS) $(ZLIB_CFLAGS)
libvmi_libvmi_la_LDFLAGS= $(GLIB_LIBS) $(JSONC_LIBS) $(ZLIB_LIBS) -no-undefined
libvmi_libvmi_la_LDFLAGS+= -version-info $(VERSION)
if WITH_KVM
libvmi_libvmi_la_CFLAGS += $(LIBKVMI_CFLAGS)
endif
if ENABLE_CONFIGFILE
config_h_sources = libvmi/config/config_parser.h
config_c_sources = libvmi/config/grammar.y libvmi/config/lexicon.l
CLEANFILES = libvmi/config/lexicon.c \
libvmi/config/grammar.c \
libvmi/config/grammar.h
noinst_LTLIBRARIES= libvmi/config/libconfig.la
libvmi_config_libconfig_la_SOURCES= $(config_h_sources) $(config_c_sources)
libvmi_config_libconfig_la_CFLAGS= $(GLIB_CFLAGS)
libvmi_config_libconfig_la_LDFLAGS= $(GLIB_LIBS)
libvmi_libvmi_la_LIBADD= libvmi/config/libconfig.la
endif
if HARDENING
libvmi_libvmi_la_CFLAGS += $(HARDEN_CFLAGS)
libvmi_libvmi_la_LDFLAGS += $(HARDEN_LDFLAGS)
endif
if DEBUG
libvmi_libvmi_la_CFLAGS+= -Wall -Wextra
libvmi_libvmi_la_CFLAGS+= -Werror
libvmi_libvmi_la_CFLAGS+= -Wno-missing-field-initializers
libvmi_libvmi_la_CFLAGS+= -Wno-missing-braces
libvmi_libvmi_la_CFLAGS+= -Wno-unused-result
libvmi_libvmi_la_CFLAGS+= -Wno-ignored-attributes
endif
#############################################################
bin_PROGRAMS =
noinst_PROGRAMS =
if VMIFS
tools_vmifs_vmifs_CFLAGS = $(FUSE_CFLAGS) $(GLIB_CFLAGS) -DFUSE_USE_VERSION=22
tools_vmifs_vmifs_LDADD = $(FUSE_LIBS) $(GLIB_LIBS) libvmi/libvmi.la
bin_PROGRAMS += tools/vmifs/vmifs
tools_vmifs_vmifs_SOURCES = tools/vmifs/vmifs.c
endif
if EXAMPLES
LDADD = libvmi/libvmi.la
bin_PROGRAMS += examples/vmi-process-list \
examples/vmi-module-list \
examples/vmi-dump-memory \
examples/vmi-cpuid
if WINDOWS
bin_PROGRAMS += examples/vmi-win-guid \
examples/vmi-win-offsets
examples_vmi_win_offsets_CFLAGS = $(GLIB_CFLAGS)
examples_vmi_win_offsets_LDADD = $(GLIB_LIBS) libvmi/libvmi.la
examples_vmi_win_guid_CFLAGS = $(GLIB_CFLAGS)
examples_vmi_win_guid_LDADD = $(GLIB_LIBS) libvmi/libvmi.la
endif
if LINUX
bin_PROGRAMS += examples/vmi-dmesg \
examples/vmi-linux-offsets
examples_vmi_linux_offsets_CFLAGS = $(GLIB_CFLAGS)
examples_vmi_linux_offsets_LDADD = $(GLIB_LIBS) libvmi/libvmi.la
examples_vmi_dmesg_SOURCES = examples/dmesg.c
examples_vmi_linux_offsets_SOURCES = examples/linux-offsets.c
endif
examples_vmi_process_list_SOURCES = examples/process-list.c
examples_vmi_module_list_SOURCES = examples/module-list.c
examples_vmi_dump_memory_SOURCES = examples/dump-memory.c
examples_vmi_win_guid_SOURCES = examples/win-guid.c examples/win-guid.h
examples_vmi_win_offsets_SOURCES = examples/win-offsets.c
examples_vmi_cpuid_SOURCES = examples/cpuid.c
noinst_PROGRAMS += examples/map-symbol \
examples/map-addr \
examples/event-example \
examples/msr-event-example \
examples/new-physical-page-example \
examples/singlestep-event-example \
examples/interrupt-event-example \
examples/step-event-example \
examples/xen-emulate-response \
examples/breakpoint-emulate-example \
examples/read-disk-example \
examples/io-event-example \
examples/switch-view-example
examples_map_symbol_SOURCES = examples/map-symbol.c
examples_map_addr_SOURCES = examples/map-addr.c
examples_event_example_SOURCES = examples/event-example.c
examples_msr_event_example_SOURCES = examples/msr-event-example.c
examples_new_physical_page_example_SOURCES = examples/new-physical-page-example.c
examples_singlestep_event_example_SOURCES = examples/singlestep-event-example.c
examples_interrupt_event_example_SOURCES = examples/interrupt-event-example.c
examples_step_event_example_SOURCES = examples/step-event-example.c
examples_xen_emulate_response_SOURCES = examples/xen-emulate-response.c
examples_breakpoint_emulate_example_SOURCES = examples/breakpoint-emulate-example.c
examples_read_disk_example_SOURCES = examples/read-disk-example.c
examples_io_event_example_SOURCES = examples/io-event-example.c
examples_switch_view_example_SOURCES = examples/switch-view-example.c
noinst_PROGRAMS += examples/va-pages
examples_va_pages_SOURCES = examples/va-pages.c
examples_va_pages_CFLAGS = $(GLIB_CFLAGS)
examples_va_pages_LDADD = $(GLIB_LIBS) libvmi/libvmi.la
endif
#############################################################
if MAKE_TESTS
TESTS = tests/check_libvmi
check_PROGRAMS = tests/check_libvmi
tests_check_libvmi_SOURCES = \
tests/check_runner.c \
tests/check_tests.h \
tests/test_accessor.c \
tests/test_init.c \
tests/test_print.c \
tests/test_read.c \
tests/test_translate.c \
tests/test_util.c \
tests/test_write.c \
tests/test_peparse.c \
tests/test_cache.c \
tests/test_getvapages.c
tests_check_libvmi_CFLAGS = $(CHECK_CFLAGS) $(GLIB_CFLAGS)
tests_check_libvmi_LDADD = $(CHECK_LIBS) $(GLIB_LIBS) libvmi/libvmi.la
endif