Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

make install builds everything



  • I'm cross-compiling Qt5.13 for an ARM target.
    I set up the toolchain, downloaded the sources, configured and built only the modules I need:

    $ ./configure -release -device linux-arm-stm32mp1-g++ -device-option CROSS_COMPILE=/local/STM32MP15-Ecosystem-v1.0.0/Developer-Package/SDK/sysroots/x86_64-openstlinux_weston_sdk-linux/usr/bin/arm-openstlinux_weston-linux-gnueabi/arm-openstlinux_weston-linux-gnueabi- -sysroot /local/STM32MP15-Ecosystem-v1.0.0/Developer-Package/SDK/sysroots/cortexa7t2hf-neon-vfpv4-openstlinux_weston-linux-gnueabi -opensource -confirm-license -make libs -prefix /usr/local/qt5-STM32MP1 -extprefix ~/qt5-STM32MP1 -hostprefix ~/qt5-STM32MP1 -v -nomake examples -nomake tests -reduce-exports -no-pch -no-use-gold-linker
    
    $ make module-qtbase
    $ make module-qtserialport
    $ make module-qtserialbus
    $ make module-qtwebsockets
    

    Then I typed make install to copy the binaries to the "extprefix" path. Instead, it built everything (ran for several hours) and of course it failed on some modules.... but I don't want them!

    Should not make install just copy the built files to the defined output directory?



  • @mark81 said in make install builds everything:

    Should not make install just copy the built files to the defined output directory?

    And how the install target in your Makefile knows that (from your very example above) you just built modules qtbase and qtserialbus but that you forgot to build modules qtserialport and qtwebsockets?

    So in that case you'll want it to build the remaining modules and then, and only then, install all the built files.

    But for that example to work, you'll need to make your install target dependent on the all other targets: module-qtbase, module-qtserialport, module-qtserialbus, module-qtwebsockets, right?

    Well, it seems that the Qt developers did exactly the same making their install target dependent on all the modules they decided.


  • Lifetime Qt Champion

    Hi,

    You have to call make install for each subdir separately.

    A simpler option would be to tell configure the modules you want to skip and then it would only build what you asked for.



  • @pablo-j-rogina said in make install builds everything:

    And how the install target in your Makefile knows that (from your very example above) you just built modules qtbase and qtserialbus but that you forgot to build modules qtserialport and qtwebsockets?

    Well, make builds executables and make install copies them to the output directory. If there are no executables (because I forgot to build or because I don't want something) there's nothing to copy. Instead it runs make for me... I don't get the point!
    Following this approach is not needed at all to run make... just run make install.



  • @sgaist said in make install builds everything:

    You have to call make install for each subdir separately.

    Like make install module-qtbase? Or do you mean I have to enter each directory and run make install?
    It's funny that the docs explain how to build a single module but then just say "run make install".

    A simpler option would be to tell configure the modules you want to skip and then it would only build what you asked for.

    This makes more sense to me. Thanks.


Log in to reply