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