-all: SRCROOT DSTROOT OBJROOT
- @echo "[ $(SOURCE) ] make all"; \
- rel_path=$(shell $(RELPATH) $(SRCROOT) $(SOURCE)); \
- for kernel_config in $(KERNEL_CONFIGS); \
- do \
- for arch_config in $(ARCH_CONFIGS); \
- do \
- build_subdir=${OBJROOT}/$${kernel_config}_$${arch_config}/$${rel_path}; \
- $(MKDIR) $${build_subdir}; \
- (cd $${build_subdir}; \
- ${MAKE} KERNEL_CONFIG=$${kernel_config} \
- ARCH_CONFIG=$${arch_config} \
- MAKEFILES=${SOURCE}/Makefile \
- SOURCE=${SOURCE}/ \
- build_all \
- ); \
- done; \
+# Note - TARGET_CONFIGS_UC variable holds sets of three configuration options. The first
+# item in the 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.
+#
+.PHONY: all
+
+ifeq ($(RC_ProjectName),Libsyscall)
+all:
+ cd libsyscall ; \
+ sdk="$(SDKROOT)" ; \
+ if [ $${sdk} = / ] ; then \
+ sdk="" ; \
+ fi; \
+ xcrun -sdk "$(SDKROOT)" xcodebuild install \
+ "SRCROOT=$(SRCROOT)/libsyscall" \
+ "OBJROOT=$(OBJROOT)" \
+ "SYMROOT=$(SYMROOT)" \
+ "DSTROOT=$(DSTROOT)" \
+ "SDKROOT=$${sdk}"
+else ifeq ($(RC_ProjectName),libkxld)
+all:
+ make -C libkern/kxld/ install
+else ifeq ($(RC_ProjectName),libkxld_host)
+all:
+ make -C libkern/kxld/ install PRODUCT_TYPE=ARCHIVE
+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), .)
+all: exporthdrs setup
+else
+all:
+endif
+ $(_v)my_counter=1; \
+ for my_config in $(TARGET_CONFIGS_UC); \
+ do \
+ if [ $${my_counter} -eq 1 ] ; then \
+ my_counter=2; \
+ kernel_config=$${my_config}; \
+ if [ $${kernel_config} = DEFAULT ] ; then \
+ kernel_config=$(DEFAULT_KERNEL_CONFIG); \
+ fi; \
+ elif [ $${my_counter} -eq 2 ] ; then \
+ my_counter=3; \
+ arch_config=$${my_config}; \
+ if [ $${arch_config} = DEFAULT ] ; then \
+ arch_config=`arch | $(TR) a-z A-Z`; \
+ fi; \
+ else \
+ my_counter=1; \
+ machine_config=$${my_config}; \
+ 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 \
+ build_subdir=${OBJROOT}/$${kernel_config}_$${arch_config}/${RELATIVE_SOURCE_PATH}; \
+ else \
+ build_subdir=${OBJROOT}/$${kernel_config}_$${arch_config}_$${machine_config}/${RELATIVE_SOURCE_PATH}; \
+ fi; \
+ [ -d $${build_subdir} ] || $(MKDIR) $${build_subdir}; \
+ ${MAKE} ${MAKEJOBS} -C $${build_subdir} \
+ KERNEL_CONFIG=$${kernel_config} \
+ ARCH_CONFIG=$${arch_config} \
+ MACHINE_CONFIG=$${machine_config} \
+ MAKEFILES=${SOURCE}/Makefile \
+ SOURCE=${SOURCE}/ \
+ RELATIVE_SOURCE_PATH=${RELATIVE_SOURCE_PATH} \
+ build_all; \
+ fi; \