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

Generating a dependency list

Is there a way to generate a text dependency list from the command prompt? I have seen this feature in many other compilers, but can't find it in the Keil package. I am trying to use gnu make to manage the build process instead of the uVision IDE (for a variety of reasons that I won't go into here). I know that uVision checks the obj, but I would rather have a precompile option. If this isn't possible, does anyone have something to parse the obj files (or c for that matter) already written to save me the time?

Thanks,
Peter.

Parents
  • Since you are using GNU make, perhaps you also have access to other GNU tools such as cpp, sed and a shell. If so, take a look at this makefile:

    http://dhenry.home.sprynet.com/lint/picc/makefile

    I had uploaded it for the benefit of a PICC user, but the auto-dependency stuff is independent of the toolchain, so the same sections of the makefile would apply. Specifically, the C-to-dependency file rule (%.d : %.c) that auto-builds a .d dependency file for each source file, and the "include $(DEPS)" that then includes them all.

Reply
  • Since you are using GNU make, perhaps you also have access to other GNU tools such as cpp, sed and a shell. If so, take a look at this makefile:

    http://dhenry.home.sprynet.com/lint/picc/makefile

    I had uploaded it for the benefit of a PICC user, but the auto-dependency stuff is independent of the toolchain, so the same sections of the makefile would apply. Specifically, the C-to-dependency file rule (%.d : %.c) that auto-builds a .d dependency file for each source file, and the "include $(DEPS)" that then includes them all.

Children
  • I do not currently have cpp, though I know that I can get it. However, am I correct in thinking that cpp is just part of GNU's compiler package?

    If it is, then this is actually the path I have already taken, i.e. using an existing compiler to generate the dependencies, then C51 to do the actual compile. I was just hoping to find a way to do this naturally in C51. I am writing a core OS for use in several products and didn't want to have to tell the individual designers to install more than one compiler.

    Thank you, though. At least I know I'm not the only one to have run into this.

    Peter.

  • "However, am I correct in thinking that cpp is just part of GNU's compiler package?"

    Yes, probably so, but possibly not exclusively. It turns out that I have been using cpp for quite some time as part of the MKS Toolkit, without having had a GNU compiler installed. Now that I have installed a couple of GNU compilers, I see cpp in those subdirectories too. MKS Toolkit isn't free, but it does include some of the FSF tools too (e.g., MKS supplies both their own make as well as the GNU make that I use), so I've got to believe that cpp is available as a "standalone" C preprocessing tool like I've been using it.

  • "However, am I correct in thinking that cpp is just part of GNU's compiler package?"

    Yes, probably so, but possibly not exclusively. It turns out that I have been using cpp for quite some time as part of the MKS Toolkit, without having had a GNU compiler installed. Now that I have installed a couple of GNU compilers, I see cpp in those subdirectories too. MKS Toolkit isn't free, but it does include some of the FSF tools too (e.g., MKS supplies both their own make as well as the GNU make that I use), so I've got to believe that cpp is available as a "standalone" C preprocessing tool like I've been using it.

  • "It turns out that I have been using cpp for quite some time"

    cpp is the nearest thing to a "standard" name for the 'C' Pre-Processor amongst 'C' tool providers - especially on UNIX (which is, after all, where 'C' came from!)
    eg the preprocessor in Borland's tools is called "cpp" (or "cpp32" for 32-bit Windoze).

    Similarly, the 'C' compiler is commonly called "cc" (lowercase of course - being of UNIX descent!)
    IIRC, GNU uses "gcc"