Skip to content

Improve MDIS compilation system to only invoke the correct targets to build user space libraries

Reviewing MDIS rules.mak file, we can see that, when invoking "install" target, 2 targets are invoked to install user space libraries:

  • installlibs
  • installstaticlibs

rules.mak

# installation rules

install: installmods installlibs installstaticlibs installbin \
		 installdesc

Below, the warnings:

installing libusr_oss.so in /usr/local/lib
installing libusr_utl.so in /usr/local/lib
installing libsmb2_api.so in /usr/local/lib
installing libsmb2_bmc_api.so in /usr/local/lib
installing libsmb2_shc.so in /usr/local/lib
installing libmdis_api.so in /usr/local/lib
Updating library cache
/sbin/ldconfig
make[2]: Nothing to be done for 'installstaticlibs'.
make[2]: Nothing to be done for 'installstaticlibs'.
make[2]: Nothing to be done for 'installstaticlibs'.
make[2]: Nothing to be done for 'installstaticlibs'.
make[2]: Nothing to be done for 'installstaticlibs'.
make[2]: Nothing to be done for 'installstaticlibs'.

If we go deeper, in files usrlib_shared.mak and usrlib_static.mak, we can see that exist both targets in both files, however, one of them is empty on each file, for example:

libusr_static.mak

installlibs:

installstaticlibs:
ifdef STATIC_LIB_INSTALL_DIR
	@$(ECHO) installing $(LIB_NAME) in $(STATIC_LIB_INSTALL_DIR)
	$(Q)install --directory $(STATIC_LIB_INSTALL_DIR)
	$(Q)install --mode=644  \
	 $(LIB_OUTPUT_DIR)/$(LIB_NAME) $(STATIC_LIB_INSTALL_DIR)
endif

libusr_shared.mak

installlibs:
ifdef LIB_INSTALL_DIR
	@$(ECHO) installing $(LIB_NAME) in $(LIB_INSTALL_DIR)
	$(Q)install --directory --mode=755 $(LIB_INSTALL_DIR)
	$(Q)install --mode=644  \
	 $(LIB_OUTPUT_DIR)/$(LIB_NAME) $(LIB_INSTALL_DIR)
endif

installstaticlibs:

This is causing some warnings during the compilation and IMHO, this is not the correct way of working with Makefiles.

The file rules.mak file should include the correct Makefile depending on the linkage mode configured by the user, in the same way the userprog files are included.

Finally, I want to say that the "build" target for usrlib are properly invoked as only compiles the libraries in static or shared linkage mode so the issue only appears during the execution of "install" target.