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