2 # Copyright (c) 2000-2016 Apple Inc. All rights reserved.
4 # @APPLE_LICENSE_HEADER_START@
6 # The contents of this file constitute Original Code as defined in and
7 # are subject to the Apple Public Source License Version 1.1 (the
8 # "License"). You may not use this file except in compliance with the
9 # License. Please obtain a copy of the License at
10 # http://www.apple.com/publicsource and read it before using this file.
12 # This Original Code and all software distributed under the License are
13 # distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
14 # EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
15 # INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
16 # FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
17 # License for the specific language governing rights and limitations
20 # @APPLE_LICENSE_HEADER_END@
24 # Mach Operating System
25 # Copyright (c) 1986 Carnegie-Mellon University
26 # All rights reserved. The CMU software License Agreement specifies
27 # the terms and conditions for use and redistribution.
30 export MakeInc_cmd=${SRCROOT}/makedefs/MakeInc.cmd
31 export MakeInc_def=${SRCROOT}/makedefs/MakeInc.def
32 export MakeInc_rule=${SRCROOT}/makedefs/MakeInc.rule
33 export MakeInc_dir=${SRCROOT}/makedefs/MakeInc.dir
35 include $(MakeInc_cmd)
36 include $(MakeInc_def)
41 CFLAGS+= -include meta_features.h -DDRIVER_PRIVATE \
42 -D_KERNEL_BUILD -DKERNEL_BUILD -DMACH_KERNEL -DBSD_BUILD \
43 -DBSD_KERNEL_PRIVATE -DLP64_DEBUG=0
44 SFLAGS+= -include meta_features.h
47 # Directories for mig generated files
52 # Make sure we don't remove this by accident if interrupted at the wrong
58 # Theses macros are filled in by the config program depending on the
59 # current configuration. The MACHDEP macro is replaced by the
60 # contents of the machine dependent makefile template and the others
61 # are replaced by the corresponding symbol definitions for the
76 # Machine-independent per-file flags
79 dp_backing_file.o_CFLAGS_ADD += -Wshorten-64-to-32
80 ubc_subr.o_CFLAGS_ADD += -Wshorten-64-to-32
81 vnode_pager.o_CFLAGS_ADD += -Wshorten-64-to-32
82 vm_unix.o_CFLAGS_ADD += -Wshorten-64-to-32
83 pthread_synch.o_CFLAGS_ADD += -Wno-unused-parameter -Wno-missing-prototypes
84 pthread_support.o_CFLAGS_ADD += -Wno-unused-parameter -Wno-missing-prototypes
86 # Objects that don't want -Wsign-compare
87 OBJS_NO_SIGN_COMPARE = \
151 $(foreach file,$(OBJS_NO_SIGN_COMPARE),$(eval $(call add_perfile_cflags,$(file),-Wno-sign-compare)))
153 # Objects that don't want -Wcast-align warning (8474835)
154 OBJS_NO_CAST_ALIGN = \
225 $(foreach file,$(OBJS_NO_CAST_ALIGN),$(eval $(call add_perfile_cflags,$(file),-Wno-cast-align)))
227 # Relax -Waddress-of-packed-member on networking (28123676)
228 OBJS_NO_PACKED_ADDRESS = \
260 $(foreach file,$(OBJS_NO_PACKED_ADDRESS),$(eval $(call add_perfile_cflags,$(file),-Wno-address-of-packed-member)))
263 # This rule insures that the subr_prof.c does NOT get compiled with
264 # profiling. It implements mcount() and profiling it leads to recursion.
267 subr_prof.o_CFLAGS_RM = -pg
269 # Rebuild if per-file overrides change
270 ${OBJS}: $(firstword $(MAKEFILE_LIST))
272 # Rebuild if global compile flags change
275 $(_v)$(REPLACECONTENTS) $@ $(KCC) $(CFLAGS) $(INCFLAGS)
276 $(CXXOBJS): .CXXFLAGS
278 $(_v)$(REPLACECONTENTS) $@ $(KC++) $(CXXFLAGS) $(INCFLAGS)
281 $(_v)$(REPLACECONTENTS) $@ $(S_KCC) $(SFLAGS) $(INCFLAGS)
283 $(COMPONENT).filelist: $(OBJS)
284 @echo "$(ColorL)LDFILELIST$(Color0) $(ColorLF)$(COMPONENT)$(Color0)"
285 $(_v)for obj in ${OBJS}; do \
286 echo $(TARGET)/$(CURRENT_KERNEL_CONFIG)/$${obj}; \
287 done > $(COMPONENT).filelist
289 MAKESYSCALLS = $(SRCROOT)/bsd/kern/makesyscalls.sh
291 init_sysent.c: $(SRCROOT)/bsd/kern/syscalls.master $(MAKESYSCALLS)
292 @echo "[$(CMD_MC)] $(ColorH)GENERATING$(Color0) $(ColorLF)$@$(Color0) from $(ColorF)$<$(Color0)";
293 $(_v)$(MAKESYSCALLS) $< table > /dev/null
295 syscalls.c: $(SRCROOT)/bsd/kern/syscalls.master $(MAKESYSCALLS)
296 @echo "[$(CMD_MC)] $(ColorH)GENERATING$(Color0) $(ColorLF)$@$(Color0) from $(ColorF)$<$(Color0)";
297 $(_v)$(MAKESYSCALLS) $< names > /dev/null
299 audit_kevents.c: $(SRCROOT)/bsd/kern/syscalls.master $(MAKESYSCALLS)
300 @echo "[$(CMD_MC)] $(ColorH)GENERATING$(Color0) $(ColorLF)$@$(Color0) from $(ColorF)$<$(Color0)";
301 $(_v)$(MAKESYSCALLS) $< audit > /dev/null
303 systrace_args.c: $(SRCROOT)/bsd/kern/syscalls.master $(MAKESYSCALLS)
304 @echo "[$(CMD_MC)] $(ColorH)GENERATING$(Color0) $(ColorLF)$@$(Color0) from $(ColorF)$<$(Color0)";
305 $(_v)$(MAKESYSCALLS) $< systrace > /dev/null
307 do_all: $(COMPONENT).filelist
309 do_build_all:: do_all
313 include $(MakeInc_rule)
314 include $(MakeInc_dir)