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