xref: /xnu-12377.1.9/tools/lldbmacros/Makefile (revision f6217f891ac0bb64f3d375211650a4c1ff8ca1ea)
1*f6217f89SApple OSS Distributionsexport MakeInc_cmd=${SRCROOT}/makedefs/MakeInc.cmd
2*f6217f89SApple OSS Distributionsexport MakeInc_def=${SRCROOT}/makedefs/MakeInc.def
3*f6217f89SApple OSS Distributionsexport MakeInc_rule=${SRCROOT}/makedefs/MakeInc.rule
4*f6217f89SApple OSS Distributionsexport MakeInc_dir=${SRCROOT}/makedefs/MakeInc.dir
5*f6217f89SApple OSS Distributions
6*f6217f89SApple OSS Distributionsinclude $(MakeInc_cmd)
7*f6217f89SApple OSS Distributionsinclude $(MakeInc_def)
8*f6217f89SApple OSS Distributions
9*f6217f89SApple OSS Distributions.PHONY: lldbmacros_install
10*f6217f89SApple OSS Distributions
11*f6217f89SApple OSS Distributionsdo_config_all:: lldbmacros_install
12*f6217f89SApple OSS Distributions
13*f6217f89SApple OSS DistributionsLLDBMACROS_SOURCE:=$(SRCROOT)/tools/lldbmacros/
14*f6217f89SApple OSS DistributionsLLDBMACROS_BOOTSTRAP_DEST:=$(OBJPATH)/$(KERNEL_FILE_NAME).dSYM/$(DSYMLLDBMACROSDIR)
15*f6217f89SApple OSS DistributionsLLDBMACROS_DEST:=$(LLDBMACROS_BOOTSTRAP_DEST)/lldbmacros/
16*f6217f89SApple OSS DistributionsLLDBMACROS_USERDEBUG_FILES=
17*f6217f89SApple OSS Distributionsifeq ($(BUILD_STATIC_LINK),1)
18*f6217f89SApple OSS Distributionsifneq ($(BUILD_XNU_LIBRARY),1)
19*f6217f89SApple OSS DistributionsKERNEL_STATIC_DSYM_LLDBMACROS := $(OBJPATH)/$(KERNEL_FILE_NAME).link/$(KERNEL_FILE_NAME).dSYM/$(DSYMLLDBMACROSDIR)/lldbmacros/
20*f6217f89SApple OSS Distributionsendif
21*f6217f89SApple OSS Distributionsendif
22*f6217f89SApple OSS Distributions
23*f6217f89SApple OSS DistributionsLLDBMACROS_USERDEBUG_FILES:= \
24*f6217f89SApple OSS Distributions	usertaskdebugging/__init__.py \
25*f6217f89SApple OSS Distributions	usertaskdebugging/gdbserver.py \
26*f6217f89SApple OSS Distributions	usertaskdebugging/interface.py \
27*f6217f89SApple OSS Distributions	usertaskdebugging/rsprotocol.py \
28*f6217f89SApple OSS Distributions	usertaskdebugging/target.py \
29*f6217f89SApple OSS Distributions	usertaskdebugging/userprocess.py
30*f6217f89SApple OSS Distributions
31*f6217f89SApple OSS DistributionsLLDBMACROS_PYTHON_FILES = $(LLDBMACROS_USERDEBUG_FILES) \
32*f6217f89SApple OSS Distributions	core/__init__.py \
33*f6217f89SApple OSS Distributions	core/caching.py \
34*f6217f89SApple OSS Distributions	core/iterators.py \
35*f6217f89SApple OSS Distributions	core/configuration.py \
36*f6217f89SApple OSS Distributions	core/cvalue.py \
37*f6217f89SApple OSS Distributions	core/io.py \
38*f6217f89SApple OSS Distributions	core/kernelcore.py \
39*f6217f89SApple OSS Distributions	core/lazytarget.py \
40*f6217f89SApple OSS Distributions	core/lldbwrap.py \
41*f6217f89SApple OSS Distributions	core/operating_system.py \
42*f6217f89SApple OSS Distributions	core/pointer.py \
43*f6217f89SApple OSS Distributions	core/standard.py \
44*f6217f89SApple OSS Distributions	core/xnu_lldb_init.py \
45*f6217f89SApple OSS Distributions	kmemory/__init__.py \
46*f6217f89SApple OSS Distributions	kmemory/btlog.py \
47*f6217f89SApple OSS Distributions	kmemory/kmem.py \
48*f6217f89SApple OSS Distributions	kmemory/vm.py \
49*f6217f89SApple OSS Distributions	kmemory/whatis.py \
50*f6217f89SApple OSS Distributions	kmemory/zone.py \
51*f6217f89SApple OSS Distributions	plugins/__init__.py \
52*f6217f89SApple OSS Distributions	plugins/zprint_perf_log.py \
53*f6217f89SApple OSS Distributions	sysregdoc/AArch64-esr_el1.xml \
54*f6217f89SApple OSS Distributions	bank.py \
55*f6217f89SApple OSS Distributions	turnstile.py \
56*f6217f89SApple OSS Distributions	kevent.py \
57*f6217f89SApple OSS Distributions	workqueue.py \
58*f6217f89SApple OSS Distributions	ulock.py \
59*f6217f89SApple OSS Distributions	xnu.py \
60*f6217f89SApple OSS Distributions	xnudefines.py \
61*f6217f89SApple OSS Distributions	ktrace.py \
62*f6217f89SApple OSS Distributions	macho.py \
63*f6217f89SApple OSS Distributions	mbufdefines.py \
64*f6217f89SApple OSS Distributions	netdefines.py \
65*f6217f89SApple OSS Distributions	ntstat.py \
66*f6217f89SApple OSS Distributions	routedefines.py \
67*f6217f89SApple OSS Distributions	ipc.py \
68*f6217f89SApple OSS Distributions	ipcimportancedetail.py \
69*f6217f89SApple OSS Distributions	kcdata.py \
70*f6217f89SApple OSS Distributions	scheduler.py \
71*f6217f89SApple OSS Distributions	structanalyze.py \
72*f6217f89SApple OSS Distributions	pmap.py \
73*f6217f89SApple OSS Distributions	memory.py \
74*f6217f89SApple OSS Distributions	memorystatus.py \
75*f6217f89SApple OSS Distributions	mbufs.py \
76*f6217f89SApple OSS Distributions	microstackshot.py \
77*f6217f89SApple OSS Distributions	net.py \
78*f6217f89SApple OSS Distributions	skywalk.py \
79*f6217f89SApple OSS Distributions	ioreg.py \
80*f6217f89SApple OSS Distributions	utils.py \
81*f6217f89SApple OSS Distributions	kdp.py \
82*f6217f89SApple OSS Distributions	process.py \
83*f6217f89SApple OSS Distributions	userspace.py \
84*f6217f89SApple OSS Distributions	pci.py \
85*f6217f89SApple OSS Distributions	misc.py \
86*f6217f89SApple OSS Distributions	apic.py \
87*f6217f89SApple OSS Distributions	kasan.py \
88*f6217f89SApple OSS Distributions	usertaskgdbserver.py \
89*f6217f89SApple OSS Distributions	waitq.py \
90*f6217f89SApple OSS Distributions	xnutriage.py \
91*f6217f89SApple OSS Distributions	kmtriage.py \
92*f6217f89SApple OSS Distributions	zonetriage.py \
93*f6217f89SApple OSS Distributions	recount.py \
94*f6217f89SApple OSS Distributions	sysreg.py \
95*f6217f89SApple OSS Distributions	counter.py \
96*f6217f89SApple OSS Distributions	refgrp.py \
97*f6217f89SApple OSS Distributions	workload.py \
98*f6217f89SApple OSS Distributions	log.py \
99*f6217f89SApple OSS Distributions	kext.py \
100*f6217f89SApple OSS Distributions	nvram.py \
101*f6217f89SApple OSS Distributions	taskinfo.py \
102*f6217f89SApple OSS Distributions	exclaves.py \
103*f6217f89SApple OSS Distributions	vm_pageout.py
104*f6217f89SApple OSS Distributions
105*f6217f89SApple OSS Distributionsifneq ($(PLATFORM),MacOSX)
106*f6217f89SApple OSS Distributions	LLDBMACROS_PYTHON_FILES+= \
107*f6217f89SApple OSS Distributions		plugins/iosspeedtracer.py \
108*f6217f89SApple OSS Distributions		plugins/iosspeedtracer.sh
109*f6217f89SApple OSS Distributionsendif
110*f6217f89SApple OSS Distributions
111*f6217f89SApple OSS Distributions
112*f6217f89SApple OSS Distributions# Adding plugin with macros to test all LLDB macros.
113*f6217f89SApple OSS DistributionsLLDBMACROS_PYTHON_FILES += \
114*f6217f89SApple OSS Distributions	tests/integration_smoke/__init__.py \
115*f6217f89SApple OSS Distributions	tests/integration_smoke/lldb_session.py \
116*f6217f89SApple OSS Distributions	tests/integration_smoke/conftest.py \
117*f6217f89SApple OSS Distributions	tests/integration_smoke/test_lldb_macros.py
118*f6217f89SApple OSS Distributions
119*f6217f89SApple OSS Distributionsinclude $(MakeInc_rule)
120*f6217f89SApple OSS Distributionsinclude $(MakeInc_dir)
121*f6217f89SApple OSS Distributions
122*f6217f89SApple OSS Distributions# Strip macros during install (default)
123*f6217f89SApple OSS Distributionsifeq ($(SKIP_LLDBMACROS_UNIFDEF),1)
124*f6217f89SApple OSS Distributions	LLDBMACROS_UNIFDEF :=
125*f6217f89SApple OSS Distributionselse
126*f6217f89SApple OSS Distributions	LLDBMACROS_UNIFDEF := $(DATA_UNIFDEF)
127*f6217f89SApple OSS Distributionsendif
128*f6217f89SApple OSS Distributions
129*f6217f89SApple OSS DistributionsINSTALL_LLDBMACROS_PYTHON_FILES=$(addprefix $(LLDBMACROS_DEST), $(LLDBMACROS_PYTHON_FILES))
130*f6217f89SApple OSS Distributions$(eval $(call INSTALLPYTHON_RULE_template,$(INSTALL_LLDBMACROS_PYTHON_FILES),$(LLDBMACROS_SOURCE)%,pydir,$(LLDBMACROS_UNIFDEF),$(LLDBMACROS_DEST)))
131*f6217f89SApple OSS Distributions$(eval $(call INSTALLPYTHON_RULE_template,$(LLDBMACROS_BOOTSTRAP_DEST)/$(KERNEL_LLDBBOOTSTRAP_NAME),$(LLDBMACROS_SOURCE)/core/xnu_lldb_init.py,kbpydir,$(LLDBMACROS_UNIFDEF),$(LLDBMACROS_BOOTSTRAP_DEST)/))
132*f6217f89SApple OSS Distributions
133*f6217f89SApple OSS Distributionsifeq ($(BUILD_STATIC_LINK),1)
134*f6217f89SApple OSS Distributionsifneq ($(BUILD_XNU_LIBRARY),1)
135*f6217f89SApple OSS DistributionsINSTALL_STATIC_DSYM_LLDBMACROS_PYTHON_FILES=$(addprefix $(KERNEL_STATIC_DSYM_LLDBMACROS), $(LLDBMACROS_PYTHON_FILES))
136*f6217f89SApple OSS Distributions$(eval $(call INSTALLPYTHON_RULE_template,$(INSTALL_STATIC_DSYM_LLDBMACROS_PYTHON_FILES),$(LLDBMACROS_SOURCE)%,sdpydir,$(LLDBMACROS_UNIFDEF),$(KERNEL_STATIC_DSYM_LLDBMACROS)))
137*f6217f89SApple OSS Distributions$(eval $(call INSTALLPYTHON_RULE_template,$(KERNEL_STATIC_DSYM_LLDBMACROS)/../$(KERNEL_LLDBBOOTSTRAP_NAME),$(LLDBMACROS_SOURCE)/core/xnu_lldb_init.py,kbsdpydir,$(LLDBMACROS_UNIFDEF),$(KERNEL_STATIC_DSYM_LLDBMACROS)/../))
138*f6217f89SApple OSS Distributionsendif
139*f6217f89SApple OSS Distributionsendif
140*f6217f89SApple OSS Distributions
141*f6217f89SApple OSS Distributionsifeq ($(BUILD_STATIC_LINK),1)
142*f6217f89SApple OSS Distributionsifneq ($(BUILD_XNU_LIBRARY),1)
143*f6217f89SApple OSS DistributionsSTATIC_DSYM_LLDBMACROS_INSTALL_TARGETS := \
144*f6217f89SApple OSS Distributions	$(INSTALL_STATIC_DSYM_LLDBMACROS_PYTHON_FILES) \
145*f6217f89SApple OSS Distributions	$(KERNEL_STATIC_DSYM_LLDBMACROS)/../$(KERNEL_LLDBBOOTSTRAP_NAME)
146*f6217f89SApple OSS Distributionsendif
147*f6217f89SApple OSS Distributionsendif
148*f6217f89SApple OSS Distributions
149*f6217f89SApple OSS Distributionslldbmacros_install: $(INSTALL_LLDBMACROS_PYTHON_FILES) $(LLDBMACROS_BOOTSTRAP_DEST)/$(KERNEL_LLDBBOOTSTRAP_NAME) $(STATIC_DSYM_LLDBMACROS_INSTALL_TARGETS)
150*f6217f89SApple OSS Distributions	$(_v)$(MKDIR) $(LLDBMACROS_DEST)/builtinkexts
151*f6217f89SApple OSS Distributionsifeq ($(BUILD_STATIC_LINK),1)
152*f6217f89SApple OSS Distributionsifneq ($(BUILD_XNU_LIBRARY),1)
153*f6217f89SApple OSS Distributions	$(_v)$(MKDIR) $(KERNEL_STATIC_DSYM_LLDBMACROS)/builtinkexts
154*f6217f89SApple OSS Distributionsendif
155*f6217f89SApple OSS Distributionsendif
156