Using a separate tool is much more convenient and, by all means, better.
I've used
awk to generate precomputed (trigonometric etc. fixed point) tables used on architectures without hardware floating point support, as simple header files. I do recommend splitting the generated part into a separate file you simply
#include in the actual header or source file, instead of using some sort of templates (as certain development environments do), and use an easily recognized file name or extension for it. Keep It Simple, and consider the human who happens to have to maintain the code a year or two from now: it often is yourself, and you'll be glad then of the consideration. I am, almost constantly.
I've even used a pre-build C program to generate (and verify perfectness) of a hash table of known keywords/tokens, to speed up configuration file parsing. Essentially, it uses the given hash function, the list of tokens, and generates the minimum size hash table that has no collisions, brute-forcing it, and emits the result as a nice C header file. (In this case, it is important to check that the host and target architectures use the same hash algorithm and hash size. If the hash algorithm works on a byte-by-byte basis, byte order does not matter.)
I've also used
objcopy to generate ELF object files directly from binary data, without processing it through the compiler. I usually use a scriptlet that generates a suitable header file describing the object too (including the size, which otherwise would be a link time constant, not a compile time constant).
ELF-based toolchains have a
lot of useful tricks you can do to make maintenance easier. Using
sections to collect entries in different files into a single contiguous array is one of my favourites: the linker does all the hard work for you, and you only need to make sure that the size of the entries is a multiple of the alignment. You can even make it an sort-of-list of variable-length entries, if each entry begins with its size. Very useful for compile-time extensions, menus, and such on embedded environments, as all that data can be put into ROM/Flash, without having to run some "registration" functions at run time: if the facility is linked to the final binary, then the related menu entries are too. Simples.
There are a lot of useful tools, from macros to data/code generation to pure binary tools, but without additional information on the task at hand, we're just discussing the various options and possible scenarios.
@jealcuna, why did you leave us hanging?