-${OBJS}: ${OBJSDEPS}
-
-LDOBJS = $(OBJS)
-
-$(COMPONENT).filelist: $(LDOBJS) vers.o
- @echo LDFILELIST $(COMPONENT)
- $(_v)( for obj in ${LDOBJS} vers.o; do \
- echo $(TARGET)/$(CURRENT_KERNEL_CONFIG)/$${obj}; \
- done; ) > $(COMPONENT).filelist
-
+# DO NOT ADD MORE HERE.
+#
+# -Wno-cast-align
+mac_base.o_CFLAGS_ADD += -Wno-cast-align
+# -Wno-shorten-64-to-32
+mac_audit.o_CFLAGS_ADD += -Wno-shorten-64-to-32
+mac_base.o_CFLAGS_ADD += -Wno-shorten-64-to-32
+mac_process.o_CFLAGS_ADD += -Wno-shorten-64-to-32
+# -Wno-sign-conversion
+mac_base.o_CFLAGS_ADD += -Wno-sign-conversion
+mac_mach.o_CFLAGS_ADD += -Wno-sign-conversion
+mac_vfs.o_CFLAGS_ADD += -Wno-sign-conversion
+mac_vfs_subr.o_CFLAGS_ADD += -Wno-sign-conversion
+
+# Rebuild if per-file overrides change
+${OBJS}: $(firstword $(MAKEFILE_LIST))
+
+# Rebuild if global compile flags change
+$(COBJS): .CFLAGS
+.CFLAGS: ALWAYS
+ $(_v)$(REPLACECONTENTS) $@ $(KCC) $(CFLAGS) $(INCFLAGS)
+$(CXXOBJS): .CXXFLAGS
+.CXXFLAGS: ALWAYS
+ $(_v)$(REPLACECONTENTS) $@ $(KC++) $(CXXFLAGS) $(INCFLAGS)
+$(SOBJS): .SFLAGS
+.SFLAGS: ALWAYS
+ $(_v)$(REPLACECONTENTS) $@ $(S_KCC) $(SFLAGS) $(INCFLAGS)
+
+$(COMPONENT).filelist: $(OBJS)
+ @$(LOG_LDFILELIST) "$(COMPONENT)"
+ $(_v)for obj in ${OBJS}; do \
+ $(ECHO) $(TARGET)/$(CURRENT_KERNEL_CONFIG)/$${obj}; \
+ done > $(COMPONENT).filelist
+
+$(COMPONENT).libfilelist: $(LIBOBJS)
+ @$(LOG_LDFILELIST) "lib$(COMPONENT)"
+ $(_v)for obj in ${LIBOBJS}; do \
+ $(ECHO) $(TARGET)/$(CURRENT_KERNEL_CONFIG)/$${obj}; \
+ done > $(COMPONENT).libfilelist
+
+ifeq ($(RC_ProjectName),xnu_libraries)
+do_all: $(COMPONENT).libfilelist
+else