1*a1e26a70SApple OSS Distributions# 2*a1e26a70SApple OSS Distributions# Mach Operating System 3*a1e26a70SApple OSS Distributions# Copyright (c) 1986 Carnegie-Mellon University 4*a1e26a70SApple OSS Distributions# All rights reserved. The CMU software License Agreement specifies 5*a1e26a70SApple OSS Distributions# the terms and conditions for use and redistribution. 6*a1e26a70SApple OSS Distributions# 7*a1e26a70SApple OSS Distributions 8*a1e26a70SApple OSS Distributionsexport MakeInc_cmd=${SRCROOT}/makedefs/MakeInc.cmd 9*a1e26a70SApple OSS Distributionsexport MakeInc_def=${SRCROOT}/makedefs/MakeInc.def 10*a1e26a70SApple OSS Distributionsexport MakeInc_rule=${SRCROOT}/makedefs/MakeInc.rule 11*a1e26a70SApple OSS Distributionsexport MakeInc_dir=${SRCROOT}/makedefs/MakeInc.dir 12*a1e26a70SApple OSS Distributions 13*a1e26a70SApple OSS Distributionsinclude $(MakeInc_cmd) 14*a1e26a70SApple OSS Distributionsinclude $(MakeInc_def) 15*a1e26a70SApple OSS Distributions 16*a1e26a70SApple OSS Distributions# 17*a1e26a70SApple OSS Distributions# CFLAGS 18*a1e26a70SApple OSS Distributions# 19*a1e26a70SApple OSS DistributionsCFLAGS+= -include meta_features.h -DLIBSA_KERNEL_PRIVATE 20*a1e26a70SApple OSS DistributionsSFLAGS+= -include meta_features.h 21*a1e26a70SApple OSS Distributions 22*a1e26a70SApple OSS Distributions# 23*a1e26a70SApple OSS Distributions# Directories for mig generated files 24*a1e26a70SApple OSS Distributions# 25*a1e26a70SApple OSS DistributionsCOMP_SUBDIRS = 26*a1e26a70SApple OSS Distributions 27*a1e26a70SApple OSS Distributions# 28*a1e26a70SApple OSS Distributions# Make sure we don't remove this by accident if interrupted at the wrong 29*a1e26a70SApple OSS Distributions# time. 30*a1e26a70SApple OSS Distributions# 31*a1e26a70SApple OSS Distributions.PRECIOUS: Makefile 32*a1e26a70SApple OSS Distributions 33*a1e26a70SApple OSS Distributions# 34*a1e26a70SApple OSS Distributions# Theses macros are filled in by the config program depending on the 35*a1e26a70SApple OSS Distributions# current configuration. The MACHDEP macro is replaced by the 36*a1e26a70SApple OSS Distributions# contents of the machine dependent makefile template and the others 37*a1e26a70SApple OSS Distributions# are replaced by the corresponding symbol definitions for the 38*a1e26a70SApple OSS Distributions# configuration. 39*a1e26a70SApple OSS Distributions# 40*a1e26a70SApple OSS Distributions 41*a1e26a70SApple OSS Distributions%OBJS 42*a1e26a70SApple OSS Distributions 43*a1e26a70SApple OSS Distributions%LIBOBJS 44*a1e26a70SApple OSS Distributions 45*a1e26a70SApple OSS Distributions%CFILES 46*a1e26a70SApple OSS Distributions 47*a1e26a70SApple OSS Distributions%CXXFILES 48*a1e26a70SApple OSS Distributions 49*a1e26a70SApple OSS Distributions%SFILES 50*a1e26a70SApple OSS Distributions 51*a1e26a70SApple OSS Distributions%MACHDEP 52*a1e26a70SApple OSS Distributions 53*a1e26a70SApple OSS Distributions# Rebuild if per-file overrides change 54*a1e26a70SApple OSS Distributions${OBJS}: $(firstword $(MAKEFILE_LIST)) 55*a1e26a70SApple OSS Distributions 56*a1e26a70SApple OSS Distributions# Rebuild if global compile flags change 57*a1e26a70SApple OSS Distributions$(COBJS): .CFLAGS 58*a1e26a70SApple OSS Distributions.CFLAGS: ALWAYS 59*a1e26a70SApple OSS Distributions $(_v)$(REPLACECONTENTS) $@ $(KCC) $(CFLAGS) $(INCFLAGS) 60*a1e26a70SApple OSS Distributions$(CXXOBJS): .CXXFLAGS 61*a1e26a70SApple OSS Distributions.CXXFLAGS: ALWAYS 62*a1e26a70SApple OSS Distributions $(_v)$(REPLACECONTENTS) $@ $(KC++) $(CXXFLAGS) $(INCFLAGS) 63*a1e26a70SApple OSS Distributions$(SOBJS): .SFLAGS 64*a1e26a70SApple OSS Distributions.SFLAGS: ALWAYS 65*a1e26a70SApple OSS Distributions $(_v)$(REPLACECONTENTS) $@ $(S_KCC) $(SFLAGS) $(INCFLAGS) 66*a1e26a70SApple OSS Distributions 67*a1e26a70SApple OSS DistributionsKLD_FILES = $(OBJS) 68*a1e26a70SApple OSS Distributions 69*a1e26a70SApple OSS Distributions$(COMPONENT).filelist: $(OBJS) 70*a1e26a70SApple OSS Distributions $(_v)for kld_file in ${KLD_FILES}; do \ 71*a1e26a70SApple OSS Distributions $(SEG_HACK) -s __TEXT -n __KLD -o $${kld_file}__ $${kld_file} || exit 1; \ 72*a1e26a70SApple OSS Distributions mv $${kld_file}__ $${kld_file} || exit 1; \ 73*a1e26a70SApple OSS Distributions $(SEG_HACK) -i __KLD -n __KLDDATA -o $${kld_file}__ $${kld_file} || exit 1; \ 74*a1e26a70SApple OSS Distributions mv $${kld_file}__ $${kld_file} || exit 1; \ 75*a1e26a70SApple OSS Distributions done 76*a1e26a70SApple OSS Distributions @$(LOG_LDFILELIST) "$(COMPONENT)" 77*a1e26a70SApple OSS Distributions $(_v)for obj in ${OBJS}; do \ 78*a1e26a70SApple OSS Distributions $(ECHO) $(TARGET)/$(CURRENT_KERNEL_CONFIG)/$${obj}; \ 79*a1e26a70SApple OSS Distributions done > $(COMPONENT).filelist 80*a1e26a70SApple OSS Distributions 81*a1e26a70SApple OSS Distributions$(COMPONENT).libfilelist: $(LIBOBJS) 82*a1e26a70SApple OSS Distributions @$(LOG_LDFILELIST) "lib$(COMPONENT)" 83*a1e26a70SApple OSS Distributions $(_v)for obj in ${LIBOBJS}; do \ 84*a1e26a70SApple OSS Distributions $(ECHO) $(TARGET)/$(CURRENT_KERNEL_CONFIG)/$${obj}; \ 85*a1e26a70SApple OSS Distributions done > $(COMPONENT).libfilelist 86*a1e26a70SApple OSS Distributions 87*a1e26a70SApple OSS Distributions 88*a1e26a70SApple OSS Distributionsifeq ($(RC_ProjectName),xnu_libraries) 89*a1e26a70SApple OSS Distributionsdo_all: $(COMPONENT).libfilelist 90*a1e26a70SApple OSS Distributionselse 91*a1e26a70SApple OSS Distributionsdo_all: $(COMPONENT).filelist 92*a1e26a70SApple OSS Distributionsendif 93*a1e26a70SApple OSS Distributions 94*a1e26a70SApple OSS Distributionsdo_build_all:: do_all 95*a1e26a70SApple OSS Distributions 96*a1e26a70SApple OSS Distributions%RULES 97*a1e26a70SApple OSS Distributions 98*a1e26a70SApple OSS Distributionsinclude $(MakeInc_rule) 99*a1e26a70SApple OSS Distributionsinclude $(MakeInc_dir) 100*a1e26a70SApple OSS Distributions 101*a1e26a70SApple OSS Distributions# the KLD segment is mapped read-only on arm, so if we include llvm profiling 102*a1e26a70SApple OSS Distributions# here it will segfault the kernel. (see arm_vm_init.c) We don't currently have 103*a1e26a70SApple OSS Distributions# a way of retrieving these counters from KLD anyway, so there's no harm in just 104*a1e26a70SApple OSS Distributions# disabling them. 105*a1e26a70SApple OSS DistributionsCXXFLAGS_GEN:=$(filter-out -fprofile-instr-generate,$(CXXFLAGS_GEN)) 106*a1e26a70SApple OSS DistributionsCXXFLAGS_GEN:=$(filter-out -fcoverage-mapping,$(CXXFLAGS_GEN)) 107*a1e26a70SApple OSS DistributionsCFLAGS_GEN:=$(filter-out -fprofile-instr-generate,$(CFLAGS_GEN)) 108*a1e26a70SApple OSS DistributionsCFLAGS_GEN:=$(filter-out -fcoverage-mapping,$(CFLAGS_GEN)) 109