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