1*27b03b36SApple OSS Distributions# -*- mode: makefile;-*- 2*27b03b36SApple OSS Distributions# 3*27b03b36SApple OSS Distributions# Copyright (C) 1999-2020 Apple Inc. All rights reserved. 4*27b03b36SApple OSS Distributions# 5*27b03b36SApple OSS Distributions# MakeInc.rule defines the targets and rules for 6*27b03b36SApple OSS Distributions# leaf directories once MakeInc.dir has recursed 7*27b03b36SApple OSS Distributions# into them. "do_XXX" may be double-colon rules 8*27b03b36SApple OSS Distributions# to allow the Makefile in the source directory 9*27b03b36SApple OSS Distributions# to augment the actions that will be performed. 10*27b03b36SApple OSS Distributions# 11*27b03b36SApple OSS Distributionsinclude $(SRCROOT)/makedefs/MakeInc.color 12*27b03b36SApple OSS Distributions 13*27b03b36SApple OSS Distributions# 14*27b03b36SApple OSS Distributions# Generic Install rules 15*27b03b36SApple OSS Distributions# 16*27b03b36SApple OSS Distributions 17*27b03b36SApple OSS Distributionsifndef INSTALL_KF_MI_LCL_LIST 18*27b03b36SApple OSS Distributions INSTALL_KF_MI_LCL_LIST = $(EXPORT_MI_LIST) 19*27b03b36SApple OSS Distributionsendif 20*27b03b36SApple OSS Distributions 21*27b03b36SApple OSS Distributionsifndef INSTALL_KF_MI_LCL_GEN_LIST 22*27b03b36SApple OSS Distributions INSTALL_KF_MI_LCL_GEN_LIST = $(EXPORT_MI_GEN_LIST) 23*27b03b36SApple OSS Distributionsendif 24*27b03b36SApple OSS Distributions 25*27b03b36SApple OSS Distributionsifndef INSTALL_KF_MD_LCL_LIST 26*27b03b36SApple OSS Distributions INSTALL_KF_MD_LCL_LIST = $(EXPORT_MD_LIST) 27*27b03b36SApple OSS Distributionsendif 28*27b03b36SApple OSS Distributions 29*27b03b36SApple OSS Distributionsifndef INSTALL_KF_MD_LCL_GEN_LIST 30*27b03b36SApple OSS Distributions INSTALL_KF_MD_LCL_GEN_LIST = $(EXPORT_MD_GEN_LIST) 31*27b03b36SApple OSS Distributionsendif 32*27b03b36SApple OSS Distributions 33*27b03b36SApple OSS Distributionsifndef INSTALL_KF_MI_LIST 34*27b03b36SApple OSS Distributions INSTALL_KF_MI_LIST = $(EXPORT_MI_LIST) 35*27b03b36SApple OSS Distributionsendif 36*27b03b36SApple OSS Distributions 37*27b03b36SApple OSS Distributionsifndef INSTALL_KF_MI_GEN_LIST 38*27b03b36SApple OSS Distributions INSTALL_KF_MI_GEN_LIST = $(EXPORT_MI_GEN_LIST) 39*27b03b36SApple OSS Distributionsendif 40*27b03b36SApple OSS Distributions 41*27b03b36SApple OSS Distributionsifndef INSTALL_KF_MD_LIST 42*27b03b36SApple OSS Distributions INSTALL_KF_MD_LIST = $(EXPORT_MD_LIST) 43*27b03b36SApple OSS Distributionsendif 44*27b03b36SApple OSS Distributions 45*27b03b36SApple OSS Distributionsifndef INSTALL_KF_MD_GEN_LIST 46*27b03b36SApple OSS Distributions INSTALL_KF_MD_GEN_LIST = $(EXPORT_MD_GEN_LIST) 47*27b03b36SApple OSS Distributionsendif 48*27b03b36SApple OSS Distributions 49*27b03b36SApple OSS Distributions$(eval $(call _setup_build_log_colors)) 50*27b03b36SApple OSS Distributions 51*27b03b36SApple OSS Distributions.PHONY: ALWAYS 52*27b03b36SApple OSS Distributions 53*27b03b36SApple OSS DistributionsALWAYS: 54*27b03b36SApple OSS Distributions 55*27b03b36SApple OSS Distributions# $(1) is the list of install paths 56*27b03b36SApple OSS Distributions# $(2) is "1" if it's a "GEN"-style rule that looks locally, or else $(SOURCE) 57*27b03b36SApple OSS Distributions# $(3) is the local temp directory for processing 58*27b03b36SApple OSS Distributions# $(4) is the unifdef flags 59*27b03b36SApple OSS Distributions# 60*27b03b36SApple OSS Distributions# $$$$$$$$ is a double-escaped "$$" to represent the current pid 61*27b03b36SApple OSS Distributions# of the shell process for creating uniquely named temporary files 62*27b03b36SApple OSS Distributions 63*27b03b36SApple OSS Distributionsdefine INSTALLHDRS_RULE_template 64*27b03b36SApple OSS Distributions 65*27b03b36SApple OSS Distributions.PHONY: $(3)_MKDIR 66*27b03b36SApple OSS Distributions 67*27b03b36SApple OSS Distributions$(3)_MKDIR: 68*27b03b36SApple OSS Distributions $$(_v)$$(MKDIR) ./$(3) 69*27b03b36SApple OSS Distributions $$(_v)$$(MKDIR) $(dir $(firstword $(1))) 70*27b03b36SApple OSS Distributions 71*27b03b36SApple OSS Distributions# Rebuild if unifdef flags change 72*27b03b36SApple OSS Distributions$(1): $(3)/.UNIFDEF_FLAGS 73*27b03b36SApple OSS Distributions$(3)/.UNIFDEF_FLAGS: ALWAYS | $(3)_MKDIR 74*27b03b36SApple OSS Distributions $$(_v)$$(REPLACECONTENTS) $$@ $$(UNIFDEF) $(4) 75*27b03b36SApple OSS Distributions 76*27b03b36SApple OSS Distributions$(1): $(dir $(firstword $(1)))% : $(if $(2),%,$$(SOURCE)/%) | $(3)_MKDIR 77*27b03b36SApple OSS Distributions @$$(LOG_INSTALLHDR) "$$*" 78*27b03b36SApple OSS Distributions $$(_v)$$(UNIFDEF) $(4) $$< > ./$(3)/$$*.unifdef.$$$$$$$$; \ 79*27b03b36SApple OSS Distributions if [ $$$$? -eq 2 ]; then \ 80*27b03b36SApple OSS Distributions $(ERR) Parse failure for $$<; \ 81*27b03b36SApple OSS Distributions exit 1; \ 82*27b03b36SApple OSS Distributions fi; \ 83*27b03b36SApple OSS Distributions $$(DECOMMENT) ./$(3)/$$*.unifdef.$$$$$$$$ r > \ 84*27b03b36SApple OSS Distributions ./$(3)/$$*.strip.$$$$$$$$ || exit 1; \ 85*27b03b36SApple OSS Distributions if [ -s ./$(3)/$$*.strip.$$$$$$$$ ]; then \ 86*27b03b36SApple OSS Distributions $$(INSTALL) $$(INSTALL_FLAGS) ./$(3)/$$*.unifdef.$$$$$$$$ $$@ || exit 1; \ 87*27b03b36SApple OSS Distributions fi; \ 88*27b03b36SApple OSS Distributions $$(RM) ./$(3)/$$*.unifdef.$$$$$$$$ ./$(3)/$$*.strip.$$$$$$$$ 89*27b03b36SApple OSS Distributionsendef 90*27b03b36SApple OSS Distributions 91*27b03b36SApple OSS Distributions# $(1) is the list of install paths 92*27b03b36SApple OSS Distributions# $(2) is the source path pattern (using % to match with $(5)) or source file 93*27b03b36SApple OSS Distributions# $(3) is the local temp directory for processing 94*27b03b36SApple OSS Distributions# $(4) is the unifdef flags 95*27b03b36SApple OSS Distributions# $(5) is the destination directory (when pattern matching) or empty 96*27b03b36SApple OSS Distributions# 97*27b03b36SApple OSS Distributions# $$$$$$$$ is a double-escaped "$$" to represent the current pid 98*27b03b36SApple OSS Distributions# of the shell process for creating uniquely named temporary files 99*27b03b36SApple OSS Distributions 100*27b03b36SApple OSS Distributionsdefine INSTALLPYTHON_RULE_template 101*27b03b36SApple OSS Distributions 102*27b03b36SApple OSS Distributions.PHONY: $(3)_MKDIR 103*27b03b36SApple OSS Distributions 104*27b03b36SApple OSS Distributions$(3)_MKDIR: 105*27b03b36SApple OSS Distributions $$(_v)$$(MKDIR) ./$(3) 106*27b03b36SApple OSS Distributions 107*27b03b36SApple OSS Distributions# Rebuild if unifdef flags change 108*27b03b36SApple OSS Distributions$(1): $(3)/.UNIFDEF_FLAGS 109*27b03b36SApple OSS Distributions$(3)/.UNIFDEF_FLAGS: ALWAYS | $(3)_MKDIR 110*27b03b36SApple OSS Distributions $$(_v)$$(REPLACECONTENTS) $$@ $$(UNIFDEF) -t $(4) 111*27b03b36SApple OSS Distributions 112*27b03b36SApple OSS Distributions$(1): $(5)% : $(2) | $(3)_MKDIR 113*27b03b36SApple OSS Distributions @$$(LOG_INSTALLPY) "$$*" 114*27b03b36SApple OSS Distributions $$(_v)$$(MKDIR) $$(dir $$@) $$(dir ./$(3)/$$*) 115*27b03b36SApple OSS Distributions $$(_v)$$(UNIFDEF) -t $(4) $$< > ./$(3)/$$*.unifdef.$$$$$$$$$$(suffix $$*); \ 116*27b03b36SApple OSS Distributions if [ $$$$? -eq 2 ]; then \ 117*27b03b36SApple OSS Distributions $(ERR) Parse failure for $$<; \ 118*27b03b36SApple OSS Distributions exit 1; \ 119*27b03b36SApple OSS Distributions fi; \ 120*27b03b36SApple OSS Distributions $$(INSTALL) $$(DATA_INSTALL_FLAGS) \ 121*27b03b36SApple OSS Distributions ./$(3)/$$*.unifdef.$$$$$$$$$$(suffix $$*) $$@ || exit 1; \ 122*27b03b36SApple OSS Distributions $$(PYTHON) $$(LLDBMACROS_SOURCE)/core/syntax_checker.py \ 123*27b03b36SApple OSS Distributions ./$(3)/$$*.unifdef.$$$$$$$$$$(suffix $$*) $$(_vstdout) || exit 1; \ 124*27b03b36SApple OSS Distributions $$(RM) ./$(3)/$$*.unifdef.$$$$$$$$$$(suffix $$*) 125*27b03b36SApple OSS Distributions $$(_v)if [ -n "$(5)" ]; then $$(TOUCH) "$(5)"; fi 126*27b03b36SApple OSS Distributionsendef 127*27b03b36SApple OSS Distributions 128*27b03b36SApple OSS Distributions# Template for Libsyscall header unifdef postprocessing in DSTROOT 129*27b03b36SApple OSS Distributions# $(1) is the install path 130*27b03b36SApple OSS Distributions# $(2) is the unifdef flags 131*27b03b36SApple OSS Distributions 132*27b03b36SApple OSS Distributionsdefine LIBSYSCALL_DO_UNIFDEF_HEADERS_RULE_template 133*27b03b36SApple OSS Distributionsdo_unifdef_headers:: 134*27b03b36SApple OSS Distributions $$(_v)[ \! -d "$(1)" ] || $$(FIND) -x "$(1)" -type f \( -name \*.h -o \ 135*27b03b36SApple OSS Distributions -name \*.defs -o -name \*.iig -o -name \*.modulemap \) \ 136*27b03b36SApple OSS Distributions -execdir $$(UNIFDEF) $(2) -o {} {} \; 137*27b03b36SApple OSS Distributions.PHONY: do_unifdef_headers 138*27b03b36SApple OSS Distributionsendef 139*27b03b36SApple OSS Distributions 140*27b03b36SApple OSS Distributions 141*27b03b36SApple OSS Distributions# 142*27b03b36SApple OSS Distributions# Empty the install lists of non-host headers if building the host headers alias 143*27b03b36SApple OSS Distributions# 144*27b03b36SApple OSS Distributions 145*27b03b36SApple OSS Distributionsifeq ($(INSTALLHDRS_SKIP_HOST),YES) 146*27b03b36SApple OSS Distributions 147*27b03b36SApple OSS DistributionsINSTALL_MI_LIST = 148*27b03b36SApple OSS DistributionsINSTALL_MI_GEN_LIST = 149*27b03b36SApple OSS DistributionsINSTALL_DRIVERKIT_MI_LIST = 150*27b03b36SApple OSS DistributionsINSTALL_DRIVERKIT_MI_GEN_LIST = 151*27b03b36SApple OSS DistributionsINSTALL_KF_MI_LIST = 152*27b03b36SApple OSS DistributionsINSTALL_KF_MI_GEN_LIST = 153*27b03b36SApple OSS DistributionsINSTALL_MI_LCL_LIST = 154*27b03b36SApple OSS DistributionsINSTALL_MI_LCL_GEN_LIST = 155*27b03b36SApple OSS DistributionsINSTALL_SF_MI_LCL_LIST = 156*27b03b36SApple OSS DistributionsINSTALL_SF_MI_LCL_GEN_LIST = 157*27b03b36SApple OSS DistributionsINSTALL_DRIVERKIT_MI_LCL_LIST = 158*27b03b36SApple OSS DistributionsINSTALL_DRIVERKIT_MI_LCL_GEN_LIST = 159*27b03b36SApple OSS DistributionsINSTALL_KF_MI_LCL_LIST = 160*27b03b36SApple OSS DistributionsINSTALL_KF_MI_LCL_GEN_LIST = 161*27b03b36SApple OSS DistributionsINSTALL_MD_LIST = 162*27b03b36SApple OSS DistributionsINSTALL_MD_GEN_LIST = 163*27b03b36SApple OSS DistributionsINSTALL_DRIVERKIT_MD_LIST = 164*27b03b36SApple OSS DistributionsINSTALL_DRIVERKIT_MD_GEN_LIST = 165*27b03b36SApple OSS DistributionsINSTALL_KF_MD_LIST = 166*27b03b36SApple OSS DistributionsINSTALL_KF_MD_GEN_LIST = 167*27b03b36SApple OSS DistributionsINSTALL_MD_LCL_LIST = 168*27b03b36SApple OSS DistributionsINSTALL_MD_LCL_GEN_LIST = 169*27b03b36SApple OSS DistributionsINSTALL_SF_MD_LCL_LIST = 170*27b03b36SApple OSS DistributionsINSTALL_SF_MD_LCL_GEN_LIST = 171*27b03b36SApple OSS DistributionsINSTALL_DRIVERKIT_MD_LCL_LIST = 172*27b03b36SApple OSS DistributionsINSTALL_DRIVERKIT_MD_LCL_GEN_LIST = 173*27b03b36SApple OSS DistributionsINSTALL_KF_MD_LCL_LIST = 174*27b03b36SApple OSS DistributionsINSTALL_KF_MD_LCL_GEN_LIST = 175*27b03b36SApple OSS Distributions 176*27b03b36SApple OSS Distributions# If there are no headers then there can be no module maps. 177*27b03b36SApple OSS DistributionsINSTALLHDRS_MODULEMAPS_SKIP_HOST = YES 178*27b03b36SApple OSS Distributions 179*27b03b36SApple OSS Distributionsendif 180*27b03b36SApple OSS Distributions 181*27b03b36SApple OSS Distributionsifeq ($(INSTALLHDRS_MODULEMAPS_SKIP_HOST),YES) 182*27b03b36SApple OSS DistributionsINSTALL_MODULEMAP_MI_LIST = 183*27b03b36SApple OSS DistributionsINSTALL_MODULEMAP_MI_LCL_LIST = 184*27b03b36SApple OSS DistributionsINSTALL_MODULEMAP_MD_LIST = 185*27b03b36SApple OSS DistributionsINSTALL_MODULEMAP_MD_LCL_LIST = 186*27b03b36SApple OSS Distributionsendif 187*27b03b36SApple OSS Distributions 188*27b03b36SApple OSS Distributions# 189*27b03b36SApple OSS Distributions# Machine-independent (public) files 190*27b03b36SApple OSS Distributions# 191*27b03b36SApple OSS Distributions 192*27b03b36SApple OSS DistributionsINSTALL_MI_INC_FILES = $(addprefix $(DSTROOT)/$(INCDIR)/$(INSTALL_MI_DIR)/, $(INSTALL_MI_LIST)) 193*27b03b36SApple OSS DistributionsINSTALL_MI_INC_GEN_FILES = $(addprefix $(DSTROOT)/$(INCDIR)/$(INSTALL_MI_DIR)/, $(INSTALL_MI_GEN_LIST)) 194*27b03b36SApple OSS DistributionsINSTALL_MODULEMAP_MI_INC_FILES = $(addprefix $(DSTROOT)/$(INCDIR)/$(INSTALL_MODULEMAP_MI_DIR)/,$(INSTALL_MODULEMAP_MI_LIST)) 195*27b03b36SApple OSS Distributions 196*27b03b36SApple OSS Distributions$(eval $(call INSTALLHDRS_RULE_template,$(INSTALL_MI_INC_FILES),,incmidir,$(SINCFRAME_UNIFDEF))) 197*27b03b36SApple OSS Distributions$(eval $(call INSTALLHDRS_RULE_template,$(INSTALL_MI_INC_GEN_FILES),1,incmigendir,$(SINCFRAME_UNIFDEF))) 198*27b03b36SApple OSS Distributions$(eval $(call INSTALLHDRS_RULE_template,$(INSTALL_MODULEMAP_MI_INC_FILES),,mmincmidir,-t $(DATA_UNIFDEF))) 199*27b03b36SApple OSS Distributions 200*27b03b36SApple OSS Distributionsifeq ($(DRIVERKIT),1) 201*27b03b36SApple OSS DistributionsINSTALL_DRIVERKIT_MI_INC_FILES = $(addprefix $(DSTROOT)/$(DRIVERKITINCDIR)/$(INSTALL_MI_DIR)/, $(INSTALL_DRIVERKIT_MI_LIST)) 202*27b03b36SApple OSS DistributionsINSTALL_DRIVERKIT_MI_INC_GEN_FILES = $(addprefix $(DSTROOT)/$(DRIVERKITINCDIR)/$(INSTALL_MI_DIR)/, $(INSTALL_DRIVERKIT_MI_GEN_LIST)) 203*27b03b36SApple OSS Distributions 204*27b03b36SApple OSS Distributions$(eval $(call INSTALLHDRS_RULE_template,$(INSTALL_DRIVERKIT_MI_INC_FILES),,dkincmidir,$(DKINCFRAME_UNIFDEF))) 205*27b03b36SApple OSS Distributions$(eval $(call INSTALLHDRS_RULE_template,$(INSTALL_DRIVERKIT_MI_INC_GEN_FILES),1,dkincmigendir,$(DKINCFRAME_UNIFDEF))) 206*27b03b36SApple OSS Distributionsendif 207*27b03b36SApple OSS Distributions 208*27b03b36SApple OSS DistributionsINSTALL_KF_MI_FILES = $(addprefix $(DSTROOT)/$(KINCDIR)/$(EXPORT_MI_DIR)/, $(INSTALL_KF_MI_LIST)) 209*27b03b36SApple OSS DistributionsINSTALL_KF_MI_GEN_FILES = $(addprefix $(DSTROOT)/$(KINCDIR)/$(EXPORT_MI_DIR)/, $(INSTALL_KF_MI_GEN_LIST)) 210*27b03b36SApple OSS Distributions 211*27b03b36SApple OSS Distributions$(eval $(call INSTALLHDRS_RULE_template,$(INSTALL_KF_MI_FILES),,kincmidir,$(KINCFRAME_UNIFDEF))) 212*27b03b36SApple OSS Distributions$(eval $(call INSTALLHDRS_RULE_template,$(INSTALL_KF_MI_GEN_FILES),1,kincmigendir,$(KINCFRAME_UNIFDEF))) 213*27b03b36SApple OSS Distributions 214*27b03b36SApple OSS Distributions# 215*27b03b36SApple OSS Distributions# Machine-independent local (private) files 216*27b03b36SApple OSS Distributions# 217*27b03b36SApple OSS Distributions 218*27b03b36SApple OSS DistributionsINSTALL_MI_LCL_FILES = $(addprefix $(DSTROOT)/$(LCLDIR)/$(INSTALL_MI_DIR)/, $(INSTALL_MI_LCL_LIST)) 219*27b03b36SApple OSS DistributionsINSTALL_MI_LCL_GEN_FILES = $(addprefix $(DSTROOT)/$(LCLDIR)/$(INSTALL_MI_DIR)/, $(INSTALL_MI_LCL_GEN_LIST)) 220*27b03b36SApple OSS DistributionsINSTALL_MODULEMAP_MI_LCL_FILES = $(addprefix $(DSTROOT)/$(LCLDIR)/$(INSTALL_MODULEMAP_MI_DIR)/,$(INSTALL_MODULEMAP_MI_LCL_LIST)) 221*27b03b36SApple OSS Distributions 222*27b03b36SApple OSS Distributions$(eval $(call INSTALLHDRS_RULE_template,$(INSTALL_MI_LCL_FILES),,pincmidir,$(SPINCFRAME_UNIFDEF))) 223*27b03b36SApple OSS Distributions$(eval $(call INSTALLHDRS_RULE_template,$(INSTALL_MI_LCL_GEN_FILES),1,pincmigendir,$(SPINCFRAME_UNIFDEF))) 224*27b03b36SApple OSS Distributions$(eval $(call INSTALLHDRS_RULE_template,$(INSTALL_MODULEMAP_MI_LCL_FILES),,mmpincmidir,-t $(PDATA_UNIFDEF))) 225*27b03b36SApple OSS Distributions 226*27b03b36SApple OSS DistributionsINSTALL_SF_MI_LCL_FILES = $(addprefix $(DSTROOT)/$(SPINCDIR)/$(INSTALL_MI_DIR)/, $(sort $(INSTALL_SF_MI_LCL_LIST))) 227*27b03b36SApple OSS DistributionsINSTALL_SF_MI_LCL_GEN_FILES = $(addprefix $(DSTROOT)/$(SPINCDIR)/$(INSTALL_MI_DIR)/, $(sort $(INSTALL_SF_MI_LCL_GEN_LIST))) 228*27b03b36SApple OSS Distributions 229*27b03b36SApple OSS Distributions$(eval $(call INSTALLHDRS_RULE_template,$(INSTALL_SF_MI_LCL_FILES),,spincmidir,$(SPINCFRAME_UNIFDEF))) 230*27b03b36SApple OSS Distributions$(eval $(call INSTALLHDRS_RULE_template,$(INSTALL_SF_MI_LCL_GEN_FILES),1,spincmigendir,$(SPINCFRAME_UNIFDEF))) 231*27b03b36SApple OSS Distributions 232*27b03b36SApple OSS Distributionsifeq ($(DRIVERKIT),1) 233*27b03b36SApple OSS DistributionsINSTALL_DRIVERKIT_MI_LCL_FILES = $(addprefix $(DSTROOT)/$(DRIVERKITLCLDIR)/$(INSTALL_MI_DIR)/, $(INSTALL_DRIVERKIT_MI_LCL_LIST)) 234*27b03b36SApple OSS DistributionsINSTALL_DRIVERKIT_MI_LCL_GEN_FILES = $(addprefix $(DSTROOT)/$(DRIVERKITLCLDIR)/$(INSTALL_MI_DIR)/, $(INSTALL_DRIVERKIT_MI_LCL_GEN_LIST)) 235*27b03b36SApple OSS Distributions 236*27b03b36SApple OSS Distributions$(eval $(call INSTALLHDRS_RULE_template,$(INSTALL_DRIVERKIT_MI_LCL_FILES),,dkpincmidir,$(DKPINCFRAME_UNIFDEF))) 237*27b03b36SApple OSS Distributions$(eval $(call INSTALLHDRS_RULE_template,$(INSTALL_DRIVERKIT_MI_LCL_GEN_FILES),1,dkpincmigendir,$(DKPINCFRAME_UNIFDEF))) 238*27b03b36SApple OSS Distributionsendif 239*27b03b36SApple OSS Distributions 240*27b03b36SApple OSS DistributionsINSTALL_KF_MI_LCL_FILES = $(addprefix $(DSTROOT)/$(KPINCDIR)/$(EXPORT_MI_DIR)/, $(INSTALL_KF_MI_LCL_LIST)) 241*27b03b36SApple OSS DistributionsINSTALL_KF_MI_LCL_GEN_FILES = $(addprefix $(DSTROOT)/$(KPINCDIR)/$(EXPORT_MI_DIR)/, $(INSTALL_KF_MI_LCL_GEN_LIST)) 242*27b03b36SApple OSS Distributions 243*27b03b36SApple OSS Distributions$(eval $(call INSTALLHDRS_RULE_template,$(INSTALL_KF_MI_LCL_FILES),,kpincmidir,$(KPINCFRAME_UNIFDEF))) 244*27b03b36SApple OSS Distributions$(eval $(call INSTALLHDRS_RULE_template,$(INSTALL_KF_MI_LCL_GEN_FILES),1,kpincmigendir,$(KPINCFRAME_UNIFDEF))) 245*27b03b36SApple OSS Distributions 246*27b03b36SApple OSS Distributions# 247*27b03b36SApple OSS Distributions# Machine-dependent (public) files 248*27b03b36SApple OSS Distributions# 249*27b03b36SApple OSS Distributions 250*27b03b36SApple OSS DistributionsINSTALL_MD_INC_FILES = $(addprefix $(DSTROOT)/$(INCDIR)/$(INSTALL_MD_DIR)/, $(INSTALL_MD_LIST)) 251*27b03b36SApple OSS DistributionsINSTALL_MD_INC_GEN_FILES = $(addprefix $(DSTROOT)/$(INCDIR)/$(INSTALL_MD_DIR)/, $(INSTALL_MD_GEN_LIST)) 252*27b03b36SApple OSS DistributionsINSTALL_MODULEMAP_MD_INC_FILES = $(addprefix $(DSTROOT)/$(INCDIR)/$(INSTALL_MODULEMAP_MD_DIR)/,$(INSTALL_MODULEMAP_MD_LIST)) 253*27b03b36SApple OSS Distributions 254*27b03b36SApple OSS Distributions$(eval $(call INSTALLHDRS_RULE_template,$(INSTALL_MD_INC_FILES),,incdir,$(SINCFRAME_UNIFDEF))) 255*27b03b36SApple OSS Distributions$(eval $(call INSTALLHDRS_RULE_template,$(INSTALL_MD_INC_GEN_FILES),1,incgendir,$(SINCFRAME_UNIFDEF))) 256*27b03b36SApple OSS Distributions$(eval $(call INSTALLHDRS_RULE_template,$(INSTALL_MODULEMAP_MD_INC_FILES),,mmincdir,-t $(DATA_UNIFDEF))) 257*27b03b36SApple OSS Distributions 258*27b03b36SApple OSS Distributionsifeq ($(DRIVERKIT),1) 259*27b03b36SApple OSS DistributionsINSTALL_DRIVERKIT_MD_INC_FILES = $(addprefix $(DSTROOT)/$(DRIVERKITINCDIR)/$(INSTALL_MD_DIR)/, $(INSTALL_DRIVERKIT_MD_LIST)) 260*27b03b36SApple OSS DistributionsINSTALL_DRIVERKIT_MD_INC_GEN_FILES = $(addprefix $(DSTROOT)/$(DRIVERKITINCDIR)/$(INSTALL_MD_DIR)/, $(INSTALL_DRIVERKIT_MD_GEN_LIST)) 261*27b03b36SApple OSS Distributions 262*27b03b36SApple OSS Distributions$(eval $(call INSTALLHDRS_RULE_template,$(INSTALL_DRIVERKIT_MD_INC_FILES),,dkincdir,$(DKINCFRAME_UNIFDEF))) 263*27b03b36SApple OSS Distributions$(eval $(call INSTALLHDRS_RULE_template,$(INSTALL_DRIVERKIT_MD_INC_GEN_FILES),1,dkincgendir,$(DKINCFRAME_UNIFDEF))) 264*27b03b36SApple OSS Distributionsendif 265*27b03b36SApple OSS Distributions 266*27b03b36SApple OSS DistributionsINSTALL_KF_MD_FILES = $(addprefix $(DSTROOT)/$(KINCDIR)/$(EXPORT_MD_DIR)/, $(INSTALL_KF_MD_LIST)) 267*27b03b36SApple OSS DistributionsINSTALL_KF_MD_GEN_FILES = $(addprefix $(DSTROOT)/$(KINCDIR)/$(EXPORT_MD_DIR)/, $(INSTALL_KF_MD_GEN_LIST)) 268*27b03b36SApple OSS Distributions 269*27b03b36SApple OSS Distributions$(eval $(call INSTALLHDRS_RULE_template,$(INSTALL_KF_MD_FILES),,kincdir,$(KINCFRAME_UNIFDEF))) 270*27b03b36SApple OSS Distributions$(eval $(call INSTALLHDRS_RULE_template,$(INSTALL_KF_MD_GEN_FILES),1,kincgendir,$(KINCFRAME_UNIFDEF))) 271*27b03b36SApple OSS Distributions 272*27b03b36SApple OSS Distributions# 273*27b03b36SApple OSS Distributions# Machine-dependent local (private) files 274*27b03b36SApple OSS Distributions# 275*27b03b36SApple OSS Distributions 276*27b03b36SApple OSS DistributionsINSTALL_MD_LCL_FILES = $(addprefix $(DSTROOT)/$(LCLDIR)/$(INSTALL_MD_DIR)/, $(sort $(INSTALL_MD_LCL_LIST))) 277*27b03b36SApple OSS DistributionsINSTALL_MD_LCL_GEN_FILES = $(addprefix $(DSTROOT)/$(LCLDIR)/$(INSTALL_MD_DIR)/, $(sort $(INSTALL_MD_LCL_GEN_LIST))) 278*27b03b36SApple OSS DistributionsINSTALL_MODULEMAP_MD_LCL_FILES = $(addprefix $(DSTROOT)/$(LCLDIR)/$(INSTALL_MODULEMAP_MD_DIR)/,$(INSTALL_MODULEMAP_MD_LCL_LIST)) 279*27b03b36SApple OSS Distributions 280*27b03b36SApple OSS Distributions$(eval $(call INSTALLHDRS_RULE_template,$(INSTALL_MD_LCL_FILES),,pincdir,$(SPINCFRAME_UNIFDEF))) 281*27b03b36SApple OSS Distributions$(eval $(call INSTALLHDRS_RULE_template,$(INSTALL_MD_LCL_GEN_FILES),1,pincgendir,$(SPINCFRAME_UNIFDEF))) 282*27b03b36SApple OSS Distributions$(eval $(call INSTALLHDRS_RULE_template,$(INSTALL_MODULEMAP_MD_LCL_FILES),,mmpincdir,-t $(PDATA_UNIFDEF))) 283*27b03b36SApple OSS Distributions 284*27b03b36SApple OSS DistributionsINSTALL_SF_MD_LCL_FILES = $(addprefix $(DSTROOT)/$(SPINCDIR)/$(INSTALL_MD_DIR)/, $(sort $(INSTALL_SF_MD_LCL_LIST))) 285*27b03b36SApple OSS DistributionsINSTALL_SF_MD_LCL_GEN_FILES = $(addprefix $(DSTROOT)/$(SPINCDIR)/$(INSTALL_MD_DIR)/, $(sort $(INSTALL_SF_MD_LCL_GEN_LIST))) 286*27b03b36SApple OSS Distributions 287*27b03b36SApple OSS Distributions$(eval $(call INSTALLHDRS_RULE_template,$(INSTALL_SF_MD_LCL_FILES),,spincdir,$(SPINCFRAME_UNIFDEF))) 288*27b03b36SApple OSS Distributions$(eval $(call INSTALLHDRS_RULE_template,$(INSTALL_SF_MD_LCL_GEN_FILES),1,spincgendir,$(SPINCFRAME_UNIFDEF))) 289*27b03b36SApple OSS Distributions 290*27b03b36SApple OSS Distributionsifeq ($(DRIVERKIT),1) 291*27b03b36SApple OSS DistributionsINSTALL_DRIVERKIT_MD_LCL_FILES = $(addprefix $(DSTROOT)/$(DRIVERKITLCLDIR)/$(INSTALL_MD_DIR)/, $(INSTALL_DRIVERKIT_MD_LCL_LIST)) 292*27b03b36SApple OSS DistributionsINSTALL_DRIVERKIT_MD_LCL_GEN_FILES = $(addprefix $(DSTROOT)/$(DRIVERKITLCLDIR)/$(INSTALL_MD_DIR)/, $(INSTALL_DRIVERKIT_MD_LCL_GEN_LIST)) 293*27b03b36SApple OSS Distributions 294*27b03b36SApple OSS Distributions$(eval $(call INSTALLHDRS_RULE_template,$(INSTALL_DRIVERKIT_MD_LCL_FILES),,dkpincdir,$(DKPINCFRAME_UNIFDEF))) 295*27b03b36SApple OSS Distributions$(eval $(call INSTALLHDRS_RULE_template,$(INSTALL_DRIVERKIT_MD_LCL_GEN_FILES),1,dkpincgendir,$(DKPINCFRAME_UNIFDEF))) 296*27b03b36SApple OSS Distributionsendif 297*27b03b36SApple OSS Distributions 298*27b03b36SApple OSS DistributionsINSTALL_KF_MD_LCL_FILES = $(addprefix $(DSTROOT)/$(KPINCDIR)/$(EXPORT_MD_DIR)/, $(INSTALL_KF_MD_LCL_LIST)) 299*27b03b36SApple OSS DistributionsINSTALL_KF_MD_LCL_GEN_FILES = $(addprefix $(DSTROOT)/$(KPINCDIR)/$(EXPORT_MD_DIR)/, $(INSTALL_KF_MD_LCL_GEN_LIST)) 300*27b03b36SApple OSS Distributions 301*27b03b36SApple OSS Distributions$(eval $(call INSTALLHDRS_RULE_template,$(INSTALL_KF_MD_LCL_FILES),,kpincdir,$(KPINCFRAME_UNIFDEF))) 302*27b03b36SApple OSS Distributions$(eval $(call INSTALLHDRS_RULE_template,$(INSTALL_KF_MD_LCL_GEN_FILES),1,kpincgendir,$(KPINCFRAME_UNIFDEF))) 303*27b03b36SApple OSS Distributions 304*27b03b36SApple OSS Distributions.PHONY: do_installhdrs_mi 305*27b03b36SApple OSS Distributions 306*27b03b36SApple OSS Distributions# Double-colon rule so that MakeInc.kernel can add custom behaviors 307*27b03b36SApple OSS Distributionsdo_installhdrs_mi:: $(INSTALL_MI_INC_FILES) $(INSTALL_MI_INC_GEN_FILES) $(INSTALL_MODULEMAP_MI_INC_FILES) \ 308*27b03b36SApple OSS Distributions $(INSTALL_DRIVERKIT_MI_INC_FILES) $(INSTALL_DRIVERKIT_MI_INC_GEN_FILES) \ 309*27b03b36SApple OSS Distributions $(INSTALL_KF_MI_FILES) $(INSTALL_KF_MI_GEN_FILES) \ 310*27b03b36SApple OSS Distributions $(INSTALL_MI_LCL_FILES) $(INSTALL_MI_LCL_GEN_FILES) $(INSTALL_MODULEMAP_MI_LCL_FILES) \ 311*27b03b36SApple OSS Distributions $(INSTALL_SF_MI_LCL_FILES) $(INSTALL_SF_MI_LCL_GEN_FILES) \ 312*27b03b36SApple OSS Distributions $(INSTALL_DRIVERKIT_MI_LCL_FILES) $(INSTALL_DRIVERKIT_MI_LCL_GEN_FILES) \ 313*27b03b36SApple OSS Distributions $(INSTALL_KF_MI_LCL_FILES) $(INSTALL_KF_MI_LCL_GEN_FILES) 314*27b03b36SApple OSS Distributions @: 315*27b03b36SApple OSS Distributions 316*27b03b36SApple OSS Distributions.PHONY: do_installhdrs_md 317*27b03b36SApple OSS Distributions 318*27b03b36SApple OSS Distributionsdo_installhdrs_md: $(INSTALL_MD_INC_FILES) $(INSTALL_MD_INC_GEN_FILES) $(INSTALL_MODULEMAP_MD_INC_FILES) \ 319*27b03b36SApple OSS Distributions $(INSTALL_DRIVERKIT_MD_INC_FILES) $(INSTALL_DRIVERKIT_MD_INC_GEN_FILES) \ 320*27b03b36SApple OSS Distributions $(INSTALL_KF_MD_FILES) $(INSTALL_KF_MD_GEN_FILES) \ 321*27b03b36SApple OSS Distributions $(INSTALL_MD_LCL_FILES) $(INSTALL_MD_LCL_GEN_FILES) $(INSTALL_MODULEMAP_MD_LCL_FILES) \ 322*27b03b36SApple OSS Distributions $(INSTALL_SF_MD_LCL_FILES) $(INSTALL_SF_MD_LCL_GEN_FILES) \ 323*27b03b36SApple OSS Distributions $(INSTALL_DRIVERKIT_MD_LCL_FILES) $(INSTALL_DRIVERKIT_MD_LCL_GEN_FILES) \ 324*27b03b36SApple OSS Distributions $(INSTALL_KF_MD_LCL_FILES) $(INSTALL_KF_MD_LCL_GEN_FILES) 325*27b03b36SApple OSS Distributions @: 326*27b03b36SApple OSS Distributions 327*27b03b36SApple OSS Distributions# 328*27b03b36SApple OSS Distributions# Generic Export rules 329*27b03b36SApple OSS Distributions# 330*27b03b36SApple OSS DistributionsEXPORT_MI_INC_FILES = $(addprefix $(OBJROOT)/$(EXPDIR)/$(EXPORT_MI_DIR)/, $(EXPORT_MI_LIST)) 331*27b03b36SApple OSS DistributionsEXPORT_MI_GEN_INC_FILES = $(addprefix $(OBJROOT)/$(EXPDIR)/$(EXPORT_MI_DIR)/, $(EXPORT_MI_GEN_LIST)) 332*27b03b36SApple OSS Distributions 333*27b03b36SApple OSS Distributions.PHONY: EXP_MI_INC_DIR 334*27b03b36SApple OSS Distributions 335*27b03b36SApple OSS DistributionsEXP_MI_INC_DIR: 336*27b03b36SApple OSS Distributions $(_v)$(MKDIR) $(OBJROOT)/$(EXPDIR)/$(EXPORT_MI_DIR) 337*27b03b36SApple OSS Distributions 338*27b03b36SApple OSS Distributions$(EXPORT_MI_GEN_INC_FILES): $(OBJROOT)/$(EXPDIR)/$(EXPORT_MI_DIR)/% : % | EXP_MI_INC_DIR 339*27b03b36SApple OSS Distributions $(_v)$(INSTALL) $(DATA_INSTALL_FLAGS_RO) $< $@ 340*27b03b36SApple OSS Distributions 341*27b03b36SApple OSS Distributions$(EXPORT_MI_INC_FILES): $(OBJROOT)/$(EXPDIR)/$(EXPORT_MI_DIR)/% : $(SOURCE)/% | EXP_MI_INC_DIR 342*27b03b36SApple OSS Distributions $(_v)$(INSTALL) $(DATA_INSTALL_FLAGS_RO) $< $@ 343*27b03b36SApple OSS Distributions 344*27b03b36SApple OSS DistributionsEXPORT_MD_INC_FILES = $(addprefix $(OBJROOT)/$(EXPDIR)/$(EXPORT_MD_DIR)/, $(EXPORT_MD_LIST)) 345*27b03b36SApple OSS DistributionsEXPORT_MD_GEN_INC_FILES = $(addprefix $(OBJROOT)/$(EXPDIR)/$(EXPORT_MD_DIR)/, $(EXPORT_MD_GEN_LIST)) 346*27b03b36SApple OSS Distributions 347*27b03b36SApple OSS Distributions.PHONY: EXP_MD_INC_DIR 348*27b03b36SApple OSS Distributions 349*27b03b36SApple OSS DistributionsEXP_MD_INC_DIR: 350*27b03b36SApple OSS Distributions $(_v)$(MKDIR) $(OBJROOT)/$(EXPDIR)/$(EXPORT_MD_DIR) 351*27b03b36SApple OSS Distributions 352*27b03b36SApple OSS Distributions$(EXPORT_MD_GEN_INC_FILES): $(OBJROOT)/$(EXPDIR)/$(EXPORT_MD_DIR)/% : % | EXP_MD_INC_DIR 353*27b03b36SApple OSS Distributions $(_v)$(INSTALL) $(DATA_INSTALL_FLAGS_RO) $< $@ 354*27b03b36SApple OSS Distributions 355*27b03b36SApple OSS Distributions$(EXPORT_MD_INC_FILES): $(OBJROOT)/$(EXPDIR)/$(EXPORT_MD_DIR)/% : $(SOURCE)/% | EXP_MD_INC_DIR 356*27b03b36SApple OSS Distributions $(_v)$(INSTALL) $(DATA_INSTALL_FLAGS_RO) $< $@ 357*27b03b36SApple OSS Distributions 358*27b03b36SApple OSS Distributions.PHONY: do_exporthdrs_mi 359*27b03b36SApple OSS Distributions 360*27b03b36SApple OSS Distributionsdo_exporthdrs_mi: $(EXPORT_MI_GEN_INC_FILES) $(EXPORT_MI_INC_FILES) 361*27b03b36SApple OSS Distributions @: 362*27b03b36SApple OSS Distributions 363*27b03b36SApple OSS Distributions.PHONY: do_exporthdrs_md 364*27b03b36SApple OSS Distributions 365*27b03b36SApple OSS Distributionsdo_exporthdrs_md: $(EXPORT_MD_GEN_INC_FILES) $(EXPORT_MD_INC_FILES) 366*27b03b36SApple OSS Distributions @: 367*27b03b36SApple OSS Distributions 368*27b03b36SApple OSS Distributions# 369*27b03b36SApple OSS Distributions# Generic Compilation rules 370*27b03b36SApple OSS Distributions# 371*27b03b36SApple OSS Distributions 372*27b03b36SApple OSS Distributions# 373*27b03b36SApple OSS Distributions# Compilation rules to generate .o from .s 374*27b03b36SApple OSS Distributions# 375*27b03b36SApple OSS Distributions 376*27b03b36SApple OSS DistributionsS_RULE_0=@$(LOG_AS) "$@" 377*27b03b36SApple OSS DistributionsS_RULE_1A=$(_v)${S_KCC} -c ${SFLAGS} -MD -MF $(@:o=d) -MP ${$@_SFLAGS_ADD} ${INCFLAGS} ${$@_INCFLAGS} 378*27b03b36SApple OSS DistributionsS_RULE_1B=$(<F) 379*27b03b36SApple OSS DistributionsS_RULE_2= 380*27b03b36SApple OSS Distributions 381*27b03b36SApple OSS Distributions# 382*27b03b36SApple OSS Distributions# Compilation rules to generate .o from .c for normal files 383*27b03b36SApple OSS Distributions# 384*27b03b36SApple OSS DistributionsC_RULE_0=@$(LOG_CC) "$@" 385*27b03b36SApple OSS DistributionsC_RULE_1A=$(_v)${KCC} -c ${filter-out ${$@_CFLAGS_RM}, ${CFLAGS} ${CWARNFLAGS}} -MD -MF $(@:o=d) -MP ${$@_CFLAGS_ADD} ${$@_CWARNFLAGS_ADD} ${INCFLAGS} ${$@_INCFLAGS} 386*27b03b36SApple OSS DistributionsC_RULE_1B=$(<F) 387*27b03b36SApple OSS DistributionsC_RULE_2= 388*27b03b36SApple OSS Distributions 389*27b03b36SApple OSS DistributionsC_RULE_3= 390*27b03b36SApple OSS DistributionsC_RULE_4A= 391*27b03b36SApple OSS DistributionsC_RULE_4B= 392*27b03b36SApple OSS Distributions 393*27b03b36SApple OSS Distributions# 394*27b03b36SApple OSS Distributions# Compilation rules to generate .o from .c for driver files 395*27b03b36SApple OSS Distributions# 396*27b03b36SApple OSS DistributionsC_RULE_0_D=${C_RULE_0} 397*27b03b36SApple OSS DistributionsC_RULE_1A_D=${C_RULE_1A} 398*27b03b36SApple OSS DistributionsC_RULE_1B_D=${C_RULE_1B} 399*27b03b36SApple OSS DistributionsC_RULE_2_D=${C_RULE_2} 400*27b03b36SApple OSS DistributionsC_RULE_3_D=${C_RULE_3} 401*27b03b36SApple OSS DistributionsC_RULE_4A_D=${C_RULE_4A} 402*27b03b36SApple OSS DistributionsC_RULE_4B_D=${C_RULE_4B} 403*27b03b36SApple OSS Distributions 404*27b03b36SApple OSS Distributions# 405*27b03b36SApple OSS Distributions# Compilation rules to generate .co from .cp or .cpo from .cpp 406*27b03b36SApple OSS Distributions# The config tool slickly changes the last source filename char to 'o' 407*27b03b36SApple OSS Distributions# for the object filename. 408*27b03b36SApple OSS DistributionsP_RULE_0=@$(LOG_CXX) "$@" 409*27b03b36SApple OSS DistributionsP_RULE_1A=$(_v)${KC++} -o $@ -c ${CXXFLAGS} ${filter-out ${$@_CFLAGS_RM}, ${CFLAGS} ${CXXWARNFLAGS}} -MD -MF $(@:o=d) -MP ${$@_CFLAGS_ADD} ${$@_CXXWARNFLAGS_ADD} ${INCFLAGS} ${$@_INCFLAGS} 410*27b03b36SApple OSS DistributionsP_RULE_1B=$(<F) 411*27b03b36SApple OSS DistributionsP_RULE_2= 412*27b03b36SApple OSS Distributions 413*27b03b36SApple OSS DistributionsP_RULE_3= 414*27b03b36SApple OSS DistributionsP_RULE_4A= 415*27b03b36SApple OSS DistributionsP_RULE_4B= 416*27b03b36SApple OSS Distributions 417*27b03b36SApple OSS Distributions# 418*27b03b36SApple OSS Distributions# Explain how to make the bsd syscall list 419*27b03b36SApple OSS Distributions# 420*27b03b36SApple OSS Distributions$(TARGET)/bsd.syscalls.master: $(SRCROOT)/bsd/kern/syscalls.master $(MAKESYSCALLS) 421*27b03b36SApple OSS Distributions @$(LOG_GENERATE) "$(@F)$(Color0) from $(ColorF)$<$(Color0)" 422*27b03b36SApple OSS Distributions $(_v)$(UNIFDEF) $(SEED_DEFINES) $< > $@; \ 423*27b03b36SApple OSS Distributions if [ $$? -eq 2 ]; then \ 424*27b03b36SApple OSS Distributions $(ERR) Parse failure for $<; \ 425*27b03b36SApple OSS Distributions exit 1; \ 426*27b03b36SApple OSS Distributions fi 427*27b03b36SApple OSS Distributions 428*27b03b36SApple OSS Distributions# 429*27b03b36SApple OSS Distributions# This isn't the right place to put this, but we need to := override some settings 430*27b03b36SApple OSS Distributions# in Makefiles that include the generic helper fragments (like this file) 431*27b03b36SApple OSS Distributions# 432*27b03b36SApple OSS Distributionsifeq ($(BUILD_JSON_COMPILATION_DATABASE),1) 433*27b03b36SApple OSS DistributionsHIB_FILES := 434*27b03b36SApple OSS DistributionsLAST_FILES := 435*27b03b36SApple OSS DistributionsKLD_FILES := 436*27b03b36SApple OSS Distributionsendif 437*27b03b36SApple OSS Distributions 438*27b03b36SApple OSS Distributions.PHONY: do_build_all 439*27b03b36SApple OSS Distributions 440*27b03b36SApple OSS Distributions# Do-nothing rule, since not all levels of the recursive hierarchy might implement this 441*27b03b36SApple OSS Distributions# in their local Makefiles. Those that do will use a "::" rule to augment this. 442*27b03b36SApple OSS Distributionsdo_build_all:: 443*27b03b36SApple OSS Distributions @: 444*27b03b36SApple OSS Distributions 445*27b03b36SApple OSS Distributions.PHONY: do_build_install_primary 446*27b03b36SApple OSS Distributions 447*27b03b36SApple OSS Distributions# Do-nothing rule, since not all levels of the recursive hierarchy might implement this 448*27b03b36SApple OSS Distributions# in their local Makefiles. Those that do will use a "::" rule to augment this. 449*27b03b36SApple OSS Distributionsdo_build_install_primary:: 450*27b03b36SApple OSS Distributions @: 451*27b03b36SApple OSS Distributions 452*27b03b36SApple OSS Distributions.PHONY: do_build_install_non_primary 453*27b03b36SApple OSS Distributions 454*27b03b36SApple OSS Distributions# Do-nothing rule, since not all levels of the recursive hierarchy might implement this 455*27b03b36SApple OSS Distributions# in their local Makefiles. Those that do will use a "::" rule to augment this. 456*27b03b36SApple OSS Distributionsdo_build_install_non_primary:: 457*27b03b36SApple OSS Distributions @: 458*27b03b36SApple OSS Distributions 459*27b03b36SApple OSS DistributionsINSTALL_MAN_FILES = $(addprefix $(DSTROOT)/$(MANDIR)/$(INSTALL_MAN_DIR)/, $(INSTALL_MAN_LIST)) 460*27b03b36SApple OSS Distributions 461*27b03b36SApple OSS Distributions.PHONY: INSTALL_MAN_DIR 462*27b03b36SApple OSS Distributions 463*27b03b36SApple OSS DistributionsINSTALL_MAN_DIR: 464*27b03b36SApple OSS Distributions $(_v)$(MKDIR) $(DSTROOT)/$(MANDIR)/$(INSTALL_MAN_DIR) 465*27b03b36SApple OSS Distributions 466*27b03b36SApple OSS Distributions$(INSTALL_MAN_FILES): $(DSTROOT)/$(MANDIR)/$(INSTALL_MAN_DIR)/% : % | INSTALL_MAN_DIR 467*27b03b36SApple OSS Distributions @$(LOG_MAN) "$*" 468*27b03b36SApple OSS Distributions $(_v)$(INSTALL) $(INSTALL_FLAGS) $< $@ 469*27b03b36SApple OSS Distributions 470*27b03b36SApple OSS Distributionsdefine MAN_LINKS_RULE_template 471*27b03b36SApple OSS Distributions$$(DSTROOT)/$$(MANDIR)/$$(INSTALL_MAN_DIR)/$(2): $$(DSTROOT)/$$(MANDIR)/$$(INSTALL_MAN_DIR)/$(1) 472*27b03b36SApple OSS Distributions @$$(LOG_MANLINK) "$(2)" 473*27b03b36SApple OSS Distributions $(_v)ln -f $$< $$@ 474*27b03b36SApple OSS Distributionsendef 475*27b03b36SApple OSS Distributions 476*27b03b36SApple OSS Distributionsfunction_generate_man_links_rules = $(if $(word 1,$(1)),$(eval $(call MAN_LINKS_RULE_template,$(word 1,$(1)),$(word 2,$(1)))) $(DSTROOT)/$(MANDIR)/$(INSTALL_MAN_DIR)/$(word 2,$(1)) $(call function_generate_man_links_rules,$(wordlist 3,$(words $(1)),$(1)))) 477*27b03b36SApple OSS Distributions 478*27b03b36SApple OSS DistributionsINSTALL_MAN_FILES_LINKS = $(call function_generate_man_links_rules,$(INSTALL_MAN_LINKS)) 479*27b03b36SApple OSS Distributions 480*27b03b36SApple OSS Distributions.PHONY: do_installman 481*27b03b36SApple OSS Distributions 482*27b03b36SApple OSS Distributionsdo_installman: $(INSTALL_MAN_FILES) $(INSTALL_MAN_FILES_LINKS) 483*27b03b36SApple OSS Distributions @: 484*27b03b36SApple OSS Distributions 485*27b03b36SApple OSS Distributions.PHONY: do_textfiles_install do_textfiles_install_mi do_textfiles_install_md 486*27b03b36SApple OSS Distributions 487*27b03b36SApple OSS Distributions# Do-nothing rule, since not all levels of the recursive hierarchy might implement this 488*27b03b36SApple OSS Distributions# in their local Makefiles. Those that do will use a "::" rule to augment this. 489*27b03b36SApple OSS Distributionsdo_textfiles_install_mi:: do_installman 490*27b03b36SApple OSS Distributions @: 491*27b03b36SApple OSS Distributions 492*27b03b36SApple OSS Distributions# Do-nothing rule, since not all levels of the recursive hierarchy might implement this 493*27b03b36SApple OSS Distributions# in their local Makefiles. Those that do will use a "::" rule to augment this. 494*27b03b36SApple OSS Distributionsdo_textfiles_install_md:: 495*27b03b36SApple OSS Distributions @: 496*27b03b36SApple OSS Distributions 497*27b03b36SApple OSS Distributions.PHONY: do_build_setup 498*27b03b36SApple OSS Distributions 499*27b03b36SApple OSS Distributions# Do-nothing rule, since not all levels of the recursive hierarchy might implement this 500*27b03b36SApple OSS Distributions# in their local Makefiles. Those that do will use a "::" rule to augment this. 501*27b03b36SApple OSS Distributionsdo_build_setup:: 502*27b03b36SApple OSS Distributions @: 503*27b03b36SApple OSS Distributions 504*27b03b36SApple OSS Distributions.PHONY: do_config_all 505*27b03b36SApple OSS Distributions 506*27b03b36SApple OSS Distributions# Do-nothing rule, since not all levels of the recursive hierarchy might implement this 507*27b03b36SApple OSS Distributions# in their local Makefiles. Those that do will use a "::" rule to augment this. 508*27b03b36SApple OSS Distributionsdo_config_all:: 509*27b03b36SApple OSS Distributions @: 510*27b03b36SApple OSS Distributions 511*27b03b36SApple OSS Distributions.PHONY: do_config_install_primary 512*27b03b36SApple OSS Distributions 513*27b03b36SApple OSS Distributions# Do-nothing rule, since not all levels of the recursive hierarchy might implement this 514*27b03b36SApple OSS Distributions# in their local Makefiles. Those that do will use a "::" rule to augment this. 515*27b03b36SApple OSS Distributionsdo_config_install_primary:: 516*27b03b36SApple OSS Distributions @: 517*27b03b36SApple OSS Distributions 518*27b03b36SApple OSS Distributions.PHONY: do_config_install_variant 519*27b03b36SApple OSS Distributions 520*27b03b36SApple OSS Distributions# Do-nothing rule, since not all levels of the recursive hierarchy might implement this 521*27b03b36SApple OSS Distributions# in their local Makefiles. Those that do will use a "::" rule to augment this. 522*27b03b36SApple OSS Distributionsdo_config_install_variant:: 523*27b03b36SApple OSS Distributions @: 524*27b03b36SApple OSS Distributions 525*27b03b36SApple OSS Distributions.PHONY: do_config_install 526*27b03b36SApple OSS Distributions 527*27b03b36SApple OSS Distributions# Do-nothing rule, since not all levels of the recursive hierarchy might implement this 528*27b03b36SApple OSS Distributions# in their local Makefiles. Those that do will use a "::" rule to augment this. 529*27b03b36SApple OSS Distributionsdo_config_install:: 530*27b03b36SApple OSS Distributions @: 531*27b03b36SApple OSS Distributions 532*27b03b36SApple OSS Distributions# vim: set ft=make: 533