clean command for a gnumake project

Sysprogs forums Forums VisualGDB clean command for a gnumake project

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #8320
    feos
    Participant

    A fully custom project allows to specify the clean command, but disallows using a makefile. And a makefile project disallows using a custom clean command. And with the internal clean command, I’m having a problem, that it also builds. If I enter the makefile dir and type “make clean” in the Windows command prompt, it works as intended. If I do that in cygwin, it works as intended. If I run clean from a custom version of the project, it works as intended. But whenever I execute clean for a gnu makefile project, it also builds. Additionally, if I hit rebuild, it cleans and builds twice in a row!

    What could i be missing?

    PS: Amazing tool anyways, thanks for it, hope to see it evolve further!

    #8321
    feos
    Participant

    Note: My NMAKE command for MSVC is auto-generated and standard, and doesn’t contain garbage.

    #8324
    support
    Keymaster

    Hi,

    Not sure why the ‘make clean’ command starts the build. Are you using a custom Makefile?

    Please try enabling the verbose mode in Tools->Options->VisualGDB->General->Output and selecting Build->Clean Solution. VisualGDB will then show what exact commands it runs.

    If this does not help pinpoint the problem, please post the output of the verbose cleaning here so that we could provide further advice.

    #8325
    feos
    Participant

    I use a custom makefile indeed. And it does work alright from outside the MSVC. And I finally figured out the problem.

    My make command contained a custom target, to skip building of the entire thing every time. And “make” runs well from both command line and MSVC. But whenever I execute “clean”, VisualGDB also seems to add that custom target to my command. Like, it doesn’t just tell make.exe to “clean”, but it uses the entire make command and adds “clean” to that. With no option to change it.

    The log shows this difference:

    VisualGDB: Run “C:\cygwin\bin\make.exe -f GNUmakefile CONFIG=Debug clean DEBUG=true” in directory “D:\SVN\midp\midp2.0fcs/build\win32\kvm” on local computer (TaskId:4)

    VisualGDB: Run “C:\cygwin\bin\make.exe -f GNUmakefile CONFIG=Debug clean midp DEBUG=true” in directory “D:\SVN\midp\midp2.0fcs/build\win32\kvm” on local computer (TaskId:4)

    I think the solution to this problem would be to allow the user specify a custom clean command too, since some of the arguments from “make” won’t make sense for “clean”.

    #8341
    support
    Keymaster

    Hi,

    We normally recommend using the Custom build system with custom makefiles. The purpose of the “GNU Make” system is to provide a user-friendly front-end for GNU Make for those users who don’t want to go deep into customizing Makefiles and just prefer setting things like CFLAGS via GUI and expect everything to work out-of-the-box. So we intentionally keep the settings there simpler than in the Custom build subsystem.

    #8346
    feos
    Participant

    But can all the compilation be moved to custom steps? As long as one uses a GNU makefile, any specific targets like mine won’t let the clean work peoperly. And it doesn’t get more complex if “clean” is put there by default.

    Otherwise, instead of adding “clean” to the user’s “make” command, can it simply do just “clean” alone, while still working behind the scene? In that case custom clean won’t be needed.

    #8351
    support
    Keymaster

    Hi,

    Sorry for the confusion. We did not mean custom steps, we meant changing the build subsystem from Make to Custom on the first page of VisualGDB Project Properties. This will replace the Makefile settings page with a Custom build settings page allowing more customization of the build/clean commands.

    We add ‘clean’ to the default command in order to support cases when the default command passes extra variable values or command-line switches to GNU Make.

    #8356
    feos
    Participant

    IIRC, the makefile was needed to import the entire project and allow browsing it. Being fully custom allows to build/clean, but one will have to edit the files and search through them in a separate environment. Having to move back to Custom from GNUmake just because of that little issue doesn’t feel like a designed way, even if it is. It simply feels like a bug.

    Maybe I missed a way to import the project with Custom?

    #8361
    support
    Keymaster

    Hi,

    Indeed, you have probably missed the “Import a project -> Import a project built with other tools” option in the project wizard. As long as you select it, VisualGDB will create a project with a custom build system, but still import the source files you select. You can also import them later via right-clicking in the Solution Explorer and selecting “Add folder recursively”.

Viewing 9 posts - 1 through 9 (of 9 total)
  • You must be logged in to reply to this topic.