Question: How do I go about sharing code between tools and modules, e.g. meta_modules.c that needs to be built in both.
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.:
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.