]> git.saurik.com Git - apple/xnu.git/blobdiff - makedefs/MakeInc.dir
xnu-2050.7.9.tar.gz
[apple/xnu.git] / makedefs / MakeInc.dir
index b4b594cd6cb36dbd9a4f43c6657a92e93892deaa..12191a3c22ef11a0b8255a62d67115439ea043e3 100644 (file)
@@ -3,7 +3,7 @@
 #
 .PHONY: installhdrs
 
-ifeq ($(RC_ProjectName),Libsyscall)
+ifeq ($(findstring Libsyscall,$(RC_ProjectName)),Libsyscall)
 installhdrs:
        cd libsyscall ; \
                sdk="$(SDKROOT)" ;                                                              \
@@ -19,8 +19,11 @@ installhdrs:
 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);                                 \
@@ -53,6 +56,9 @@ ifeq (iPhoneOS,$(PLATFORM))
 endif
 endif
 
+.PHONY: installhdrs_embedded installhdrs_devicemap
+installhdrs_embedded installhdrs_devicemap: installhdrs
+
 #
 # Install header files order
 #
@@ -62,9 +68,8 @@ endif
 #
 # 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                             \
@@ -72,27 +77,34 @@ installhdrs_mi:
                        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     \
@@ -100,17 +112,24 @@ installhdrs_md:
                        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;
@@ -130,6 +149,7 @@ $(BUILD_INSTALLHDRS_MI_SUBDIRS_TARGETS):
        ${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;
 
@@ -151,6 +171,7 @@ $(BUILD_INSTALLHDRS_MD_SUBDIRS_TARGETS):
        ${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;
 
@@ -176,26 +197,32 @@ exporthdrs: exporthdrs_mi exporthdrs_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;                                    \
 
@@ -209,8 +236,7 @@ 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      \
@@ -238,17 +264,24 @@ exporthdrs_md:
                                        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;             \
@@ -270,6 +303,7 @@ $(BUILD_EXPORTHDRS_MI_SUBDIRS_TARGETS):
        ${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;
 
@@ -291,6 +325,7 @@ $(BUILD_EXPORTHDRS_MD_SUBDIRS_TARGETS):
        ${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;
 
@@ -303,16 +338,17 @@ build_exporthdrs_md: $(BUILD_EXPORTHDRS_MD_SUBDIRS_TARGETS)
 .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;
 
@@ -328,6 +364,7 @@ $(BUILD_SETUP_SUBDIRS_TARGETS):
        ${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;
 
@@ -347,11 +384,11 @@ build_setup: $(BUILD_SETUP_SUBDIRS_TARGETS)
 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)"                                            \
@@ -363,7 +400,20 @@ all:
 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), .)
@@ -394,10 +444,15 @@ endif
                                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}                         \
@@ -406,11 +461,15 @@ endif
                                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
 #
@@ -431,6 +490,7 @@ $(BUILD_ALL_SUBDIRS_TARGETS):
        ${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;
 
@@ -448,6 +508,7 @@ build_all: $(BUILD_ALL_SUBDIRS_TARGETS)
                ${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;                                                           
@@ -484,6 +545,11 @@ mach_kernel:
                                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            \
@@ -521,15 +587,17 @@ build_mach_kernel:
 # 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);                            \
@@ -539,10 +607,15 @@ else # xnu or xnu_debug
                        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}                       \
@@ -551,6 +624,7 @@ else # xnu or xnu_debug
                MACHINE_CONFIG=$${machine_config}                       \
                MAKEFILES=${SOURCE}/Makefile                            \
                SOURCE=${SOURCE}/                                       \
+               RELATIVE_SOURCE_PATH=${RELATIVE_SOURCE_PATH}            \
                build_install;                                          \
        done;                                                           \
        done;
@@ -565,6 +639,9 @@ ifeq ($(RC_ProjectName),xnu_debug)
 endif
 endif
 
+.PHONY: install_embedded install_devicemap
+install_embedded install_devicemap: install
+
 installmachinekernels:
        @echo "[ $(SOURCE) ] make installmachinekernels";                               \
        my_counter=1;           \
@@ -596,6 +673,7 @@ installmachinekernels:
                                MACHINE_CONFIG=$${machine_config}                       \
                                MAKEFILES=${SOURCE}/Makefile                            \
                                SOURCE=${SOURCE}/                                       \
+                               RELATIVE_SOURCE_PATH=${RELATIVE_SOURCE_PATH}            \
                                TARGET=$${build_subdir}/                                \
                                do_build_install;                                       \
                fi;             \
@@ -627,6 +705,7 @@ $(BUILD_INSTALL_SUBDIRS_TARGETS):
                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;
 
@@ -697,10 +776,12 @@ TAGS: cscope.files
 .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
@@ -710,6 +791,7 @@ else # xnu
        [ -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}
@@ -726,6 +808,7 @@ $(BUILD_INSTALLMAN_SUBDIRS_TARGETS):
        ${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;