#
.PHONY: installhdrs
-ifeq ($(RC_ProjectName),Libsyscall)
+ifeq ($(findstring Libsyscall,$(RC_ProjectName)),Libsyscall)
installhdrs:
cd libsyscall ; \
sdk="$(SDKROOT)" ; \
else ifeq ($(findstring libkxld,$(RC_ProjectName)),libkxld)
installhdrs:
make -C libkern/kxld/ installhdrs
+else ifeq ($(RC_ProjectName),libkmod)
+installhdrs:
+# nothing to do
else # xnu, xnu_debug, or xnu_headers_Sim
-installhdrs: exporthdrs installhdrs_mi installhdrs_md
+installhdrs: exporthdrs installhdrs_mi installhdrs_md setup
@echo "[ $(SRCROOT) ] make installhdrs installing Kernel.framework"
$(_v)kincpath=$(DSTROOT)/$(KINCDIR); \
krespath=$(DSTROOT)/$(KRESDIR); \
endif
endif
+.PHONY: installhdrs_embedded installhdrs_devicemap
+installhdrs_embedded installhdrs_devicemap: installhdrs
+
#
# Install header files order
#
#
# Install machine independent header files
#
-installhdrs_mi:
- $(_v)rel_path=$(shell $(RELPATH) $(SRCROOT) $(SOURCE)); \
- kernel_config=$(INSTALL_TYPE); \
+installhdrs_mi: setup
+ $(_v)kernel_config=$(INSTALL_TYPE); \
machine_config=$(MACHINE_CONFIG); \
arch_config=$(INSTALL_ARCH_DEFAULT); \
if [ $${arch_config} = ARM ] ; then \
machine_config=$(DEFAULT_ARM_MACHINE_CONFIG); \
fi; \
fi; \
+ if [ $${arch_config} = L4_ARM ] ; then \
+ if [ $${machine_config} = DEFAULT ] ; then \
+ machine_config=$(DEFAULT_L4_ARM_MACHINE_CONFIG); \
+ fi; \
+ fi; \
if [ $${machine_config} = DEFAULT ] ; then \
- installinc_dir=${OBJROOT}/$${kernel_config}_$${arch_config}/$${rel_path}; \
+ installinc_dir=${OBJROOT}/$${kernel_config}_$${arch_config}/${RELATIVE_SOURCE_PATH}; \
else \
- installinc_dir=${OBJROOT}/$${kernel_config}_$${arch_config}_$${machine_config}/$${rel_path}; \
+ installinc_dir=${OBJROOT}/$${kernel_config}_$${arch_config}_$${machine_config}/${RELATIVE_SOURCE_PATH}; \
fi; \
[ -d $${installinc_dir} ] || $(MKDIR) $${installinc_dir}; \
${MAKE} ${MAKEJOBS} -C $${installinc_dir} \
KERNEL_CONFIG=$${kernel_config} \
ARCH_CONFIG=$${arch_config} \
+ MACHINE_CONFIG=$${machine_config} \
MAKEFILES=${SOURCE}/Makefile \
SOURCE=${SOURCE}/ \
+ RELATIVE_SOURCE_PATH=. \
TARGET=$${installinc_dir}/ \
build_installhdrs_mi; \
#
# Install machine dependent kernel header files
+# Uses hack for machine_config, which is not threaded through properly.
#
-installhdrs_md:
- $(_v)rel_path=$(shell $(RELPATH) $(SRCROOT) $(SOURCE)); \
- kernel_config=$(INSTALL_TYPE); \
- machine_config=$(MACHINE_CONFIG); \
+installhdrs_md: setup
+ $(_v)kernel_config=$(INSTALL_TYPE); \
+ machine_config=$(MACHINE_CONFIG); \
for arch_config in $(INSTALL_ARCHS); \
do \
if [ $${arch_config} = ARM ] ; then \
machine_config=$(DEFAULT_ARM_MACHINE_CONFIG); \
fi; \
fi; \
+ if [ $${arch_config} = L4_ARM ] ; then \
+ if [ $${machine_config} = DEFAULT ] ; then \
+ machine_config=$(DEFAULT_L4_ARM_MACHINE_CONFIG); \
+ fi; \
+ fi; \
if [ $${machine_config} = DEFAULT ] ; then \
- installinc_dir=${OBJROOT}/$${kernel_config}_$${arch_config}/$${rel_path}; \
+ installinc_dir=${OBJROOT}/$${kernel_config}_$${arch_config}/${RELATIVE_SOURCE_PATH}; \
else \
- installinc_dir=${OBJROOT}/$${kernel_config}_$${arch_config}_$${machine_config}/$${rel_path}; \
+ installinc_dir=${OBJROOT}/$${kernel_config}_$${arch_config}_$${machine_config}/${RELATIVE_SOURCE_PATH}; \
fi; \
[ -d $${installinc_dir} ] || $(MKDIR) $${installinc_dir}; \
${MAKE} ${MAKEJOBS} -C $${installinc_dir} \
KERNEL_CONFIG=$${kernel_config} \
ARCH_CONFIG=$${arch_config} \
+ MACHINE_CONFIG=$${machine_config} \
MAKEFILES=${SOURCE}/Makefile \
SOURCE=${SOURCE}/ \
+ RELATIVE_SOURCE_PATH=. \
TARGET=$${installinc_dir}/ \
build_installhdrs_md; \
done;
${MAKE} -C $${installinc_subdir} \
MAKEFILES=$(SOURCE)$${installinc_subdir}/Makefile \
SOURCE=$(SOURCE)$${installinc_subdir}/ \
+ RELATIVE_SOURCE_PATH=$(RELATIVE_SOURCE_PATH)/$${installinc_subdir} \
TARGET=$(TARGET)$${installinc_subdir}/ \
build_installhdrs_mi;
${MAKE} -C $${installinc_subdir} \
MAKEFILES=$(SOURCE)$${installinc_subdir}/Makefile \
SOURCE=$(SOURCE)$${installinc_subdir}/ \
+ RELATIVE_SOURCE_PATH=$(RELATIVE_SOURCE_PATH)/$${installinc_subdir} \
TARGET=$(TARGET)$${installinc_subdir}/ \
build_installhdrs_md;
do_exporthdrs_mi:
exporthdrs_mi:
- $(_v)rel_path=$(shell $(RELPATH) $(SRCROOT) $(SOURCE)); \
- kernel_config=$(INSTALL_TYPE); \
- machine_config=$(MACHINE_CONFIG); \
+ $(_v)kernel_config=$(INSTALL_TYPE); \
arch_config=$(INSTALL_ARCH_DEFAULT); \
+ machine_config=DEFAULT; \
if [ $${arch_config} = ARM ] ; then \
if [ $${machine_config} = DEFAULT ] ; then \
machine_config=$(DEFAULT_ARM_MACHINE_CONFIG); \
fi; \
fi; \
+ if [ $${arch_config} = L4_ARM ] ; then \
+ if [ $${machine_config} = DEFAULT ] ; then \
+ machine_config=$(DEFAULT_L4_ARM_MACHINE_CONFIG);\
+ fi; \
+ fi; \
if [ $${machine_config} = DEFAULT ] ; then \
- exportinc_dir=${OBJROOT}/$${kernel_config}_$${arch_config}/$${rel_path}; \
+ exportinc_dir=${OBJROOT}/$${kernel_config}_$${arch_config}/${RELATIVE_SOURCE_PATH}; \
else \
- exportinc_dir=${OBJROOT}/$${kernel_config}_$${arch_config}_$${machine_config}/$${rel_path}; \
+ exportinc_dir=${OBJROOT}/$${kernel_config}_$${arch_config}_$${machine_config}/${RELATIVE_SOURCE_PATH}; \
fi; \
[ -d $${exportinc_dir} ] || $(MKDIR) $${exportinc_dir}; \
${MAKE} ${MAKEJOBS} -C $${exportinc_dir} \
KERNEL_CONFIG=$${kernel_config} \
ARCH_CONFIG=$${arch_config} \
+ MACHINE_CONFIG=$${machine_config} \
MAKEFILES=${SOURCE}/Makefile \
SOURCE=${SOURCE}/ \
+ RELATIVE_SOURCE_PATH=. \
TARGET=$${exportinc_dir}/ \
build_exporthdrs_mi; \
# set is the kernel configuration. The second item in the set is the architecture and the
# third item is the machine configuration. There may be multiple sets to build.
exporthdrs_md:
- $(_v)rel_path=$(shell $(RELPATH) $(SRCROOT) $(SOURCE)); \
- my_counter=1; \
+ $(_v)my_counter=1; \
for my_config in $(TARGET_CONFIGS_UC); \
do \
if [ $${my_counter} -eq 1 ] ; then \
machine_config=$(DEFAULT_ARM_MACHINE_CONFIG); \
fi; \
fi; \
+ if [ $${arch_config} = L4_ARM ] ; then \
+ if [ $${machine_config} = DEFAULT ] ; then \
+ machine_config=$(DEFAULT_L4_ARM_MACHINE_CONFIG); \
+ fi; \
+ fi; \
if [ $${machine_config} = DEFAULT ] ; then \
- exportinc_dir=${OBJROOT}/$${kernel_config}_$${arch_config}/$${rel_path}; \
+ exportinc_dir=${OBJROOT}/$${kernel_config}_$${arch_config}/${RELATIVE_SOURCE_PATH}; \
else \
- exportinc_dir=${OBJROOT}/$${kernel_config}_$${arch_config}_$${machine_config}/$${rel_path}; \
+ exportinc_dir=${OBJROOT}/$${kernel_config}_$${arch_config}_$${machine_config}/${RELATIVE_SOURCE_PATH}; \
fi; \
[ -d $${exportinc_dir} ] || $(MKDIR) $${exportinc_dir}; \
${MAKE} ${MAKEJOBS} -C $${exportinc_dir} \
KERNEL_CONFIG=$${kernel_config} \
ARCH_CONFIG=$${arch_config} \
+ MACHINE_CONFIG=$${machine_config} \
MAKEFILES=${SOURCE}/Makefile \
SOURCE=${SOURCE}/ \
+ RELATIVE_SOURCE_PATH=. \
TARGET=$${exportinc_dir}/ \
build_exporthdrs_md; \
fi; \
${MAKE} -C $${exportinc_subdir} \
MAKEFILES=$(SOURCE)$${exportinc_subdir}/Makefile \
SOURCE=$(SOURCE)$${exportinc_subdir}/ \
+ RELATIVE_SOURCE_PATH=$(RELATIVE_SOURCE_PATH)/$${exportinc_subdir} \
TARGET=$(TARGET)$${exportinc_subdir}/ \
build_exporthdrs_mi;
${MAKE} -C $${exportinc_subdir} \
MAKEFILES=$(SOURCE)$${exportinc_subdir}/Makefile \
SOURCE=$(SOURCE)$${exportinc_subdir}/ \
+ RELATIVE_SOURCE_PATH=$(RELATIVE_SOURCE_PATH)/$${exportinc_subdir} \
TARGET=$(TARGET)$${exportinc_subdir}/ \
build_exporthdrs_md;
.PHONY: setup
setup:
- $(_v)rel_path=$(shell $(RELPATH) $(SRCROOT) $(SOURCE)); \
- kernel_config=$(INSTALL_TYPE); \
+ $(_v)kernel_config=$(INSTALL_TYPE); \
arch_config=$(INSTALL_ARCH_DEFAULT); \
- setup_subdir=${OBJROOT}/$${rel_path}; \
+ setup_subdir=${OBJROOT}/$${RELATIVE_SOURCE_PATH}; \
[ -d $${setup_subdir} ] || $(MKDIR) $${setup_subdir}; \
${MAKE} ${MAKEJOBS} -C $${setup_subdir} \
KERNEL_CONFIG=$${kernel_config} \
ARCH_CONFIG=$${arch_config} \
+ MACHINE_CONFIG=$${machine_config} \
MAKEFILES=${SOURCE}/Makefile \
SOURCE=${SOURCE}/ \
+ RELATIVE_SOURCE_PATH=. \
TARGET=$${setup_subdir}/ \
build_setup;
${MAKE} -C $${setup_subdir} \
MAKEFILES=${SOURCE}/$${setup_subdir}/Makefile \
SOURCE=${SOURCE}/$${setup_subdir}/ \
+ RELATIVE_SOURCE_PATH=${RELATIVE_SOURCE_PATH}/$${setup_subdir} \
TARGET=${TARGET}/$${setup_subdir}/ \
build_setup;
ifeq ($(RC_ProjectName),Libsyscall)
all:
cd libsyscall ; \
- sdk="$(SDKROOT)" ; \
+ sdk="$(SDKROOT)" ; \
if [ $${sdk} = / ] ; then \
- sdk="" ; \
- fi; \
- xcrun -sdk "$(SDKROOT)" xcodebuild install \
+ sdk="" ; \
+ fi; \
+ xcrun -sdk "$(SDKROOT)" xcodebuild install \
"SRCROOT=$(SRCROOT)/libsyscall" \
"OBJROOT=$(OBJROOT)" \
"SYMROOT=$(SYMROOT)" \
else ifeq ($(RC_ProjectName),libkxld_host)
all:
make -C libkern/kxld/ install PRODUCT_TYPE=ARCHIVE
-else ifeq ($(RC_ProjectName),xnu_headers_Sim)
+else ifeq ($(RC_ProjectName),libkmod)
+all:
+ cd libkern/kmod ; \
+ sdk="$(SDKROOT)" ; \
+ if [ $${sdk} = / ] ; then \
+ sdk="" ; \
+ fi; \
+ xcrun -sdk "$(SDKROOT)" xcodebuild install \
+ "SRCROOT=$(SRCROOT)/libkern/kmod" \
+ "OBJROOT=$(OBJROOT)" \
+ "SYMROOT=$(SYMROOT)" \
+ "DSTROOT=$(DSTROOT)" \
+ "SDKROOT=$${sdk}"
+else ifeq ($(findstring _headers_Sim,$(RC_ProjectName)),_headers_Sim) # Libsyscall/xnu _headers_Sim
all: exporthdrs
else # xnu or xnu_debug
ifeq ($(COMPONENT), .)
machine_config=$(DEFAULT_ARM_MACHINE_CONFIG); \
fi; \
fi; \
+ if [ $${arch_config} = L4_ARM ] ; then \
+ if [ $${machine_config} = DEFAULT ] ; then \
+ machine_config=$(DEFAULT_L4_ARM_MACHINE_CONFIG); \
+ fi; \
+ fi; \
if [ $${machine_config} = DEFAULT ] ; then \
- build_subdir=${OBJROOT}/$${kernel_config}_$${arch_config}/$${rel_path}; \
+ build_subdir=${OBJROOT}/$${kernel_config}_$${arch_config}/${RELATIVE_SOURCE_PATH}; \
else \
- build_subdir=${OBJROOT}/$${kernel_config}_$${arch_config}_$${machine_config}/$${rel_path}; \
+ build_subdir=${OBJROOT}/$${kernel_config}_$${arch_config}_$${machine_config}/${RELATIVE_SOURCE_PATH}; \
fi; \
[ -d $${build_subdir} ] || $(MKDIR) $${build_subdir}; \
${MAKE} ${MAKEJOBS} -C $${build_subdir} \
MACHINE_CONFIG=$${machine_config} \
MAKEFILES=${SOURCE}/Makefile \
SOURCE=${SOURCE}/ \
+ RELATIVE_SOURCE_PATH=${RELATIVE_SOURCE_PATH} \
build_all; \
fi; \
done;
endif
+.PHONY: all_embedded all_devicemap
+all_embedded all_devicemap: all
+
#
# Build all architectures for all Configuration/Architecture options
#
${MAKE} -C $${comp_subdir} \
MAKEFILES=${SOURCE}/$${comp_subdir}/Makefile \
SOURCE=${SOURCE}$${comp_subdir}/ \
+ RELATIVE_SOURCE_PATH=$(RELATIVE_SOURCE_PATH)/$${comp_subdir} \
TARGET=$${TARGET} \
build_all;
${MAKE} -C $${comp_subdir} \
MAKEFILES=${SOURCE}/$${comp_subdir}/Makefile \
SOURCE=${SOURCE}$${comp_subdir}/ \
+ RELATIVE_SOURCE_PATH=$(RELATIVE_SOURCE_PATH)/$${comp_subdir} \
TARGET=$${TARGET} \
build_all; \
done;
machine_config=$(DEFAULT_ARM_MACHINE_CONFIG); \
fi; \
fi; \
+ if [ $${arch_config} = L4_ARM ] ; then \
+ if [ $${machine_config} = DEFAULT ] ; then \
+ machine_config=$(DEFAULT_L4_ARM_MACHINE_CONFIG); \
+ fi; \
+ fi; \
if [ $${machine_config} = DEFAULT ] ; then \
build_subdir=${OBJROOT}/$${kernel_config}_$${arch_config}; \
else \
# Install kernel header files based on RC_ARCHS
#
install: installhdrs all installman installmachinekernels
-ifeq ($(RC_ProjectName),Libsyscall)
+ifeq ($(findstring Libsyscall,$(RC_ProjectName)),Libsyscall)
# nothing to do
else ifeq ($(findstring libkxld,$(RC_ProjectName)),libkxld)
# nothing to do, work performed in "all" action
-else ifeq ($(RC_ProjectName),xnu_headers_Sim)
+else ifeq ($(RC_ProjectName),libkmod)
+# nothing to do, work performed in "all" action
+else ifeq ($(findstring _headers_Sim,$(RC_ProjectName)),_headers_Sim)
# nothing to do
else # xnu or xnu_debug
- $(_v)rel_path=$(shell $(RELPATH) $(SRCROOT) $(SOURCE)); \
- machine_config=$(MACHINE_CONFIG); \
+# A bit of a hack for machine_config: machine configs aren't really threaded through properly.
+ $(_v)machine_config=$(MACHINE_CONFIG); \
for kernel_config in $(INSTALL_TYPE); \
do \
for arch_config in $(INSTALL_ARCHS); \
machine_config=$(DEFAULT_ARM_MACHINE_CONFIG); \
fi; \
fi; \
+ if [ $${arch_config} = L4_ARM ] ; then \
+ if [ $${machine_config} = DEFAULT ] ; then \
+ machine_config=$(DEFAULT_L4_ARM_MACHINE_CONFIG); \
+ fi; \
+ fi; \
if [ $${machine_config} = DEFAULT ] ; then \
- install_subdir=${OBJROOT}/$${kernel_config}_$${arch_config}/$${rel_path}; \
+ install_subdir=${OBJROOT}/$${kernel_config}_$${arch_config}/${RELATIVE_SOURCE_PATH}; \
else \
- install_subdir=${OBJROOT}/$${kernel_config}_$${arch_config}_$${machine_config}/$${rel_path}; \
+ install_subdir=${OBJROOT}/$${kernel_config}_$${arch_config}_$${machine_config}/${RELATIVE_SOURCE_PATH}; \
fi; \
[ -d $${install_subdir} ] || $(MKDIR) $${install_subdir}; \
${MAKE} ${MAKEJOBS} -C $${install_subdir} \
MACHINE_CONFIG=$${machine_config} \
MAKEFILES=${SOURCE}/Makefile \
SOURCE=${SOURCE}/ \
+ RELATIVE_SOURCE_PATH=${RELATIVE_SOURCE_PATH} \
build_install; \
done; \
done;
endif
endif
+.PHONY: install_embedded install_devicemap
+install_embedded install_devicemap: install
+
installmachinekernels:
@echo "[ $(SOURCE) ] make installmachinekernels"; \
my_counter=1; \
MACHINE_CONFIG=$${machine_config} \
MAKEFILES=${SOURCE}/Makefile \
SOURCE=${SOURCE}/ \
+ RELATIVE_SOURCE_PATH=${RELATIVE_SOURCE_PATH} \
TARGET=$${build_subdir}/ \
do_build_install; \
fi; \
KERNEL_CONFIG=$${kernel_config} \
MAKEFILES=${SOURCE}/$${install_subdir}/Makefile \
SOURCE=${SOURCE}$${install_subdir}/ \
+ RELATIVE_SOURCE_PATH=${RELATIVE_SOURCE_PATH}/$${install_subdir} \
TARGET=$${TARGET} \
build_install;
.PHONY: installman
installman:
-ifeq ($(RC_ProjectName),Libsyscall)
+ifeq ($(findstring Libsyscall,$(RC_ProjectName)),Libsyscall)
# nothing to do
else ifeq ($(findstring libkxld,$(RC_ProjectName)),libkxld)
# nothing to do
+else ifeq ($(RC_ProjectName),libkmod)
+# nothing to do
else ifeq ($(findstring xnu_,$(RC_ProjectName)),xnu_)
installman:
# nothing to do
[ -d $$manpath ] || $(MKDIR) $$manpath; \
${MAKE} ${MAKEJOBS} MAKEFILES=${SOURCE}/Makefile \
SOURCE=${SOURCE}/ \
+ RELATIVE_SOURCE_PATH=${RELATIVE_SOURCE_PATH} \
TARGET=${DSTROOT}/ \
build_installman
${SRCROOT}/config/compress-man-pages.pl ${DSTROOT}/${MANDIR}
${MAKE} -C $${installman_subdir} -r \
MAKEFILES=$(SOURCE)$${installman_subdir}/Makefile \
SOURCE=$(SOURCE)$${installman_subdir}/ \
+ RELATIVE_SOURCE_PATH=$(RELATIVE_SOURCE_PATH)/$${installman_subdir} \
TARGET=$(TARGET)$${installman_subdir}/ \
build_installman;