xref: /xnu-11417.121.6/libkern/libkern/Makefile (revision a1e26a70f38d1d7daa7b49b258e2f8538ad81650)
1export MakeInc_cmd=${SRCROOT}/makedefs/MakeInc.cmd
2export MakeInc_def=${SRCROOT}/makedefs/MakeInc.def
3export MakeInc_rule=${SRCROOT}/makedefs/MakeInc.rule
4export MakeInc_dir=${SRCROOT}/makedefs/MakeInc.dir
5
6include $(MakeInc_cmd)
7include $(MakeInc_def)
8
9INSTINC_SUBDIRS = \
10    machine \
11    c++ \
12    crypto \
13    img4 \
14    image4 \
15    coretrust \
16    apple_encrypted_archive \
17    amfi \
18    coreanalytics \
19    compression
20
21INSTINC_SUBDIRS_X86_64 = \
22        i386
23INSTINC_SUBDIRS_X86_64H = \
24        i386
25INSTINC_SUBDIRS_ARM64 = \
26        arm
27
28EXPINC_SUBDIRS = ${INSTINC_SUBDIRS}
29EXPINC_SUBDIRS_X86_64 = ${INSTINC_SUBDIRS_X86_64}
30EXPINC_SUBDIRS_X86_64H = ${INSTINC_SUBDIRS_X86_64H}
31EXPINC_SUBDIRS_ARM64 = ${INSTINC_SUBDIRS_ARM64}
32
33# Files that are public on macOS, but private on embedded
34EMBEDDED_PRIVATE_DATAFILES = \
35	OSDebug.h \
36	OSKextLib.h
37
38ifeq ($(filter $(SUPPORTED_EMBEDDED_PLATFORMS) $(SUPPORTED_SIMULATOR_PLATFORMS),$(PLATFORM)),)
39EXTRA_DATAFILES = $(EMBEDDED_PRIVATE_DATAFILES)
40else
41EXTRA_PRIVATE_DATAFILES = $(EMBEDDED_PRIVATE_DATAFILES)
42endif
43
44# These are covered by CoreOSModuleMaps because they're mixed in with headers
45# from other projects in libkern/.
46DATAFILES = $(sort \
47	OSByteOrder.h \
48	_OSByteOrder.h \
49	OSReturn.h \
50	OSTypes.h \
51	$(EXTRA_DATAFILES))
52
53DRIVERKIT_DATAFILES = \
54	OSByteOrder.h \
55	_OSByteOrder.h
56
57KERNELFILES = $(sort \
58	${DATAFILES} \
59	OSAtomic.h \
60	OSBase.h \
61	OSMalloc.h \
62	locks.h	\
63	sysctl.h \
64	tree.h \
65	zconf.h	\
66	zlib.h \
67	crc.h \
68	Block.h \
69	$(EXTRA_PRIVATE_DATAFILES))
70
71PRIVATE_KERNELFILES = \
72	OSKextLibPrivate.h \
73	OSSerializeBinary.h \
74	kernel_mach_header.h \
75	kext_request_keys.h \
76	mkext.h \
77	prelink.h \
78	section_keywords.h \
79	Block_private.h \
80	ptrauth_utils.h
81
82PRIVATE_DATAFILES = $(sort \
83	${PRIVATE_KERNELFILES} \
84	tree.h \
85	$(EXTRA_PRIVATE_DATAFILES))
86
87INSTALL_MI_LIST	= ${DATAFILES}
88
89INSTALL_MI_LCL_LIST = $(sort OSKextLibPrivate.h ${EXTRA_PRIVATE_DATAFILES})
90
91INSTALL_DRIVERKIT_MI_LIST = ${DRIVERKIT_DATAFILES}
92
93DRIVERKITINCDIR = $(DRIVERKITSDKHEADERSROOT)/usr/local/include
94
95INSTALL_MI_DIR = libkern
96
97INSTALL_SF_MI_LCL_LIST =        \
98	${DATAFILES} \
99	${PRIVATE_DATAFILES} \
100	kext_panic_report.h  \
101	OSCrossEndian.h
102
103INSTALL_KF_MI_LIST = ${KERNELFILES}
104
105INSTALL_KF_MI_LCL_LIST = ${KERNELFILES} ${PRIVATE_KERNELFILES}
106
107EXPORT_MI_LIST = \
108	$(sort ${KERNELFILES} ${PRIVATE_DATAFILES}) \
109	kxld.h                 \
110	kxld_types.h           \
111	stack_protector.h
112
113EXPORT_MI_GEN_LIST = version.h
114
115EXPORT_MI_DIR = libkern
116
117version.h: version.h.template $(NEWVERS) $(XNU_VERSION)
118	@$(LOG_GENERATE) "libkern/$@$(Color0) from $(ColorF)$<"
119	$(_v)install $(DATA_INSTALL_FLAGS) $< $@
120	$(_v)$(NEWVERS) $@ > /dev/null
121
122include $(MakeInc_rule)
123include $(MakeInc_dir)
124