Updating makefile

Sysprogs forums Forums VisualGDB Updating makefile

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #825
    darksilence
    Participant

    Hello!

    I wonder how can I easily update make files.

    For example: my project has Debug and Release targets, so it has Debug.mak and Release.mak. When I’m working with a debug target I add some files and debug.mak will be updated automaticly, but when I switch to release – release.mak doesn’t have those files. So I need to delete and add at least on file to the project to update my release.mak. Is there any other way to do that?

    #3175
    support
    Keymaster

    You can add exclusion lists to Makefile:

    ifeq($(CONFIG),DEBUG)
    EXCLUDED_FILES = file1.cpp file2.cpp
    endif
    

    And then add the following code instead of the source_obj1 line:

    all_source_files_filtered := $(filter-out $(EXCLUDED_FILES),$(all_source_files_filtered))
    source_obj1 := $(all_source_files_filtered:.cpp=.o)
    #3176
    darksilence
    Participant

    wait, did I understand you write?.. You mean that VisualGDB does all this things automaticly, but I can’t push it to remake make-file?
    And I have to add all my source files manualy?

    #3179
    support
    Keymaster

    VisualGDB automatically updates the list of all sources in Makefile, however it does not support excluding files for separate configurations yet. You won’t need to add all source files manually, you will only need to specify the files you want to exclude.

    #3178
    darksilence
    Participant

    I didn’t ask about excluding files.

    My question was that make file doesn’t refresh for all configurations (Debug/Release).
    So, for example, right now I’m working with Debug target, i’m adding one C-file, it works, it compiles. it’s good. But, now i’m switching target to Release, trying to build project and it doesn’t work, becase release.mak doesn’t have information about that new C-file.

    #3177
    support
    Keymaster

    Hi,

    VisualGDB stores the list of source files in the Makefile itself that is shared between configurations. Configuration-specific flags are stored in .mak files that are not affected by adding/removing source files.

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