I have a C ++ project that contains a generated file that all other C ++ files depend on. I am trying to get this file to be generated and compiled before starting any other compilation. Usually it would be as simple as moving this file to the target all:, but the complication is that my Makefile is also generated by the build system, and I can only add fragments to the Makefile and not edit it at all.
So, is there a way to force the created landing page of a file to force using dependencies or otherwise? I was thinking of using something like this:
cpp_files := $(wildcard src/*.cpp)
$(cpp_files): generated_file.cpp
generated_file.cpp:
But that does not work. For reference, my original dir structure looks like this, so I need to compile cpp files recursively:
src/
|
|
|
|
gen/
|
source
share