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

Project File Dependancies

In a Keil uVision IDE project it is possible to enter a list of source files that are to be compiled / assembled into a program. After a build is completed the IDE will display the various include file dependancies in the project file list window. These will display similar to the picture shown here:

i.stack.imgur.com/EXO3P.png

Does anyone know of a way to extract this information out of the Keil tool?

Michael Karas

Note: Cross Posted at www.8052.com/.../188738

Parents
  • In which form do you wish to receive this list? Why can't you generate it from the original code?

    For small project it is obviously easiest to just manually copy the data out of the view in the uVision screen window. For very large project this is clearly not the best way to do it due to being error prone.

    My goals are not particularly dependant on any particular format. I am interested that the dependency information include both file names and path information. My other reality goal is that I want this process to be scriptable (automated) so that if the sources and includes defined in the Keil project change that the tool (script) can be run again to update the export information.

Reply
  • In which form do you wish to receive this list? Why can't you generate it from the original code?

    For small project it is obviously easiest to just manually copy the data out of the view in the uVision screen window. For very large project this is clearly not the best way to do it due to being error prone.

    My goals are not particularly dependant on any particular format. I am interested that the dependency information include both file names and path information. My other reality goal is that I want this process to be scriptable (automated) so that if the sources and includes defined in the Keil project change that the tool (script) can be run again to update the export information.

Children
  • I have a script that does that:
    sourceforge.net/.../includes.awk

    It creates a dependency tree in make syntax. It shouldn't be difficult to adopt for whatever kind of format you desire. It's written in awk(1) and calls test(1).

    The output looks like that:

    > scripts/includes.awk src/main.c
    src/hsk_isr/hsk_isr.h: src/hsk_isr/hsk_isr.isr
    
    src/hsk_flash/hsk_flash.h: src/hsk_isr/hsk_isr.isr
    
    src/hsk_timers/hsk_timer01.c: src/hsk_timers/hsk_timer01.h
    
    src/hsk_timers/hsk_timer01.h: src/hsk_timers/hsk_timer01.isr
    
    src/hsk_icm7228/hsk_icm7228.c: src/hsk_icm7228/hsk_icm7228.h
    
    src/hsk_pwc/hsk_pwc.c: src/hsk_pwc/hsk_pwc.h src/hsk_isr/hsk_isr.h
    
    src/hsk_pwm/hsk_pwm.c: src/hsk_pwm/hsk_pwm.h
    
    src/hsk_adc/hsk_adc.c: src/hsk_adc/hsk_adc.h src/hsk_isr/hsk_isr.h
    
    src/hsk_can/hsk_can.c: src/hsk_can/hsk_can.h
    
    src/hsk_pwc/hsk_pwc.h: src/hsk_isr/hsk_isr.isr
    
    src/hsk_adc/hsk_adc.h: src/hsk_isr/hsk_isr.isr
    
    src/hsk_wdt/hsk_wdt.c: src/hsk_wdt/hsk_wdt.h src/hsk_isr/hsk_isr.h
    
    src/hsk_boot/hsk_boot.c: src/hsk_boot/hsk_boot.h src/hsk_isr/hsk_isr.h src/hsk_io/hsk_io.h
    
    src/main.c: src/config.h src/hsk_boot/hsk_boot.h src/hsk_timers/hsk_timer01.h src/hsk_can/hsk_can.h src/hsk_icm7228/hsk_icm7228.h src/hsk_adc/hsk_adc.h src/hsk_pwm/hsk_pwm.h src/hsk_pwc/hsk_pwc.h src/hsk_flash/hsk_flash.h src/hsk_wdt/hsk_wdt.h src/hsk_io/hsk_io.h
    
    src/hsk_boot/hsk_boot.h: src/hsk_isr/hsk_isr.isr
    
    src/hsk_isr/hsk_isr.c: src/hsk_isr/hsk_isr.h
    
    src/hsk_flash/hsk_flash.c: src/hsk_flash/hsk_flash.h src/hsk_isr/hsk_isr.h
    

  • How does it handle system include files?

  • You have to pass it the include directory, ending with a / to mark that it's not a file.

    > scripts/includes.awk src/main.c inc/
    src/hsk_isr/hsk_isr.h: src/hsk_isr/hsk_isr.isr
    
    src/hsk_flash/hsk_flash.h: src/hsk_isr/hsk_isr.isr
    
    src/hsk_timers/hsk_timer01.c: inc/Infineon/XC878.h src/hsk_timers/hsk_timer01.h
    ...