CCRX header dependencies


we use make to compile the objects out of the c-source files. We use pattern rules in the form of:

%.obj: %.c

Changes of a c-file will be noticed by make and a recompile of that file will happen.

Now the problem is of course, if just a header file (which is included in a c-file) changes, the makefile will not notice it and will therefore not recompile that file.

A solution is, to add the header files in the makefile to each c-file by hand to let make the dependencies know (a lot to add to the makefile, not a good solution). A recompile of everything is another solution but very time consuming.

My question is:

Does the ccrx compiler support any mechanism like the -MM option from the gcc compiler? (Scan of the c-files and the included headers and generation of a file with that information)

How can I let make know the header dependencies?

  • Hi Benjamin,

    It seems that no one yet responded to your post. Do you already know the answers? If not, please give the forum more time to understand your issue. Hope you understand. Thanks

    RenesasRulz Forum Moderator
  • In reply to JB:

    Hello JB,
    no, unfortunately I don't have a solution yet.
  • In reply to Benjamin:

    Hello, can anybody help me?
    I think this is a common Build-problem, which anybody should be dealing with, but I can't solve it.
    Any ideas?
  • In reply to Benjamin:

    CC-RX does not have anything like the -MM option. It cannot generate the dependencies for C files.
    e2 studio can do this. can you use the make files generated in e2 studio?

  • In reply to FrankL:

    Ok, with CC-RX there is no such option.
    So how can I handle it anyway? Is the only option to recompile everytime everything? I know this is now not a renesas RX question, more a make-build question. But how do you guys do your builds? All the time recompile of everything?
  • In reply to Benjamin:

    Some Ideas from anybody?
  • In reply to Benjamin:

    You should have a look at the makefiles generated in a CC-RX project in e2 studio.
    e2 studio uses GNU make.
    It looks like CC-RX knows the options -MM and -MP used to check dependencies.
    These options are not documented so you are on your own of you try to use them.
    In one of my projects the lines look like this:
    src/%.obj: ../src/%.c
    @echo 'Scanning and building file: $<'
    @echo 'Invoking: Scanner and Compiler'
    ccrx -MM -MP -output=dep="$(@:%.obj=%.d)" -MT="$(@:%.d=%.obj)" -MT="$(@:%.obj=%.d)" -isa=rxv2 -fpu -include="C:\Tool\Renesas\RX\2_7_0\include","Z:\_SharedDirectory\WorkSpace\e2studio\RX\Customer\Hamilton\DemoProject\generate" -lang=c99 -nomessage -debug -optimize=max -speed -nologo "$<"
    ccrx -isa=rxv2 -fpu -include="C:\Tool\Renesas\RX\2_7_0\include","Z:\_SharedDirectory\WorkSpace\e2studio\RX\Customer\Hamilton\DemoProject\generate" -lang=c99 -nomessage -output=obj -obj_path="src" -debug -optimize=max -speed -nologo "$<"
    @echo 'Finished Scanning and building: $<'

    My recommendation would still be to use the project utility in e2 studio to create the makefiles and then use them from an external build process if you like.
  • In reply to Benjamin:


    Have you had any success?

    Mike Clements
    RenesasRulz Moderator
  • In reply to Benjamin:

    This thread will be archived due to inactivity.

    Mike Clements
    RenesasRulz Moderator