This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

C166 output directory

Hi all,

Is it possible to specify the output directory? Something like an OUTPUTDIR() directive. This would make it easier to set/unset other options in a global makefile. Now you have to add a complete filename to the directives if the output directory is different. Setting/unsetting only PRINT or PREPRINTONLY for example (without a path+filename) would be easier to maintain in a makefile.

Regards,
Joost Leeuwesteijn

  • When you specify the object file (OBJECT directive) including a pathname, I expected that path to be used for all related output files as well (.lst, .i, etc.) but that doesn't seem to work...

    --
    Joost Leeuwesteijn

  • "Now you have to add a complete filename to the directives if the output directory is different."

    You can easily set a symbol in the makefile, and get the makefile to build the full path, eg, $(OUT_DIR)\$(TARGET).lst

    "would be easier to maintain in a makefile."

    I think having the makefile define the symbols would be easier to maintain!
    You could have stuff like this:

    #------------------------------------------------------------------------------
    #   Path for code C files
    #------------------------------------------------------------------------------
    PATH_C = ../../src 
    
    #------------------------------------------------------------------------------
    #   Path for include C files
    #------------------------------------------------------------------------------
    PATH_H = ../../inc ../../itf \
    etc, etc,...

  • You can easily set a symbol in the makefile, and get the makefile to build the full path, eg, $(OUT_DIR)\$(TARGET).lst

    Yes, that's what I'm using now.

    I think having the makefile define the symbols would be easier to maintain!

    I think having -no symbols- (or make variables) at all would be much easier to maintain :-) Only specify

    $(CC) OBJECT($@) $(CFLAGS)
    
    in the makefiles and let developers modify options in a small settings makefile that only contains things like:
    CFLAGS += PRINT
    CFLAGS += PREPRINT
    

    That's not possible because the directives need an (output directory) pathname, which is different for every module in my project. You would need special if-then's or other constructs to handle each directive but that adds to the complexity, and complexity is more difficult to maintain. An OUTPUTDIR directive or more intelligent OBJECT directive would have solved that.

    --
    Joost Leeuwesteijn