Please sign in to comment.
Add a vpath for the local lexor_keyword.cc
This patch doesn't completely fix the problem, but with it the problem is at least manageable. The issues was that when the lexor_keyword.gperf file is updated and you are building outside the source directory the Makefile would create a local lexor_keyword.cc as expected. The problem is that it always looked in the source directory for the file. This patch adds a special vpath rule that says to look in the build directory first and then in the source directory for lexor_keyword.cc. This works as expected except for the first time the lexor_keyword.cc file is generated locally. During the make invocation it compares the source lexor_keyword.cc file to the gperf file and notices it is out of date. It then generates a new file in the build directory, but the make rule is still using the source file which didn't change so it doesn't rebuild as needed. To get the new file to compile you need to run make a second time to get the rule to execute using the local version of the file. This extra make invocation is only needed when the local file is first created since after that the rule always uses the local file. I plan to look at resolving the remaining issue, but there is much subtlety in this since you effectively need to break/rebuild the make dependency tree to get this to build correctly in a single run.
- Loading branch information...