@reyalp I managed to port the module metadata code to CHDK (to run as a module).Question: How do I go about sharing code between tools and modules, e.g. meta_modules.c that needs to be built in both.
If it was shared with a module, I'd probably put the code used by both in the modules directory or under lib.
This is currently implemented as a module. So I just put the common code under modules and have the tools makefile build it into tools?
I'm not clear on the reason to have this as a module.
Question: How do I go about sharing code between tools and modules, e.g. meta_modules.c that needs to be built in both.
meta_module$(EXE): $(modules)/meta_module.c @echo $< \-\> $@ $(HOSTCC) $(HOSTCFLAGS) -o $@ $^
Put the code in the 'modules' folder.Create a new folder in the 'tools' directory for your meta_module tool, with it's own makefile (see elf2flt or packfi2 for example).Add a custom build rule in the makefile, e.g.:Code: [Select]meta_module$(EXE): $(modules)/meta_module.c @echo $< \-\> $@ $(HOSTCC) $(HOSTCFLAGS) -o $@ $^Note, I have not tested the above so you make need to experiment with the build rule.Phil.