Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[cdt-dev] extending the toolchain

Hi,

I extended the toolchain and added my own tool. The tool is called properly when building a project, so this works. However, I run into quite some trouble when the target of the makefile is build. The rule there says that it should simply add all objects. Nothing wrong with that, but objects generated with my tool are not recognized properly. The problem is that my tool generates a file with a prefix (output prefix). However, the objects pulled in the target rule do not reflect this prefix.

If I have a source file "foo.b", my tool generates "prefix_foo.u". I.e. that the target step tries to pull in "foo.u" which does of course not exists.

The stuff which breaks it is in GnuMakefileGenerator. You generate a rule:

 * Create the pattern rule in the format:
 * <relative_path>/%.<outputExtension>: $(ROOT)/<relative_path>/%.<inputExtension>

instead it should be:
 * <relative_path>/<outputPrefix>%.<outputExtension>: $(ROOT)/<relative_path>/%.<inputExtension>

So, in the objects.mk file we should get something like:

OBJS := ... $(B_SRCS:$(ROOT)/%.b=prefix_%.u)

and in the subdir.mk file:

prefix_%.u: $(ROOT)/%.b
	@echo 'Building file: $<'
         ....


Another question: Is it possible to add a tool/compiler which generates something which should not be linked to the target, because the compiler does not generate any object code?



Kind regards,

Thomas



______________________________________________________________
Verschicken Sie romantische, coole und witzige Bilder per SMS!
Jetzt bei WEB.DE FreeMail: http://f.web.de/?mc=021193



Back to the top