We have an ActionScript (Flex) project that we create using GNU make. We would like to add the M4 preprocessing step to the build process (for example, so that we can create an ASSERT () macro that includes file and line numbers).
We have a wonderful difficulty.
Our current strategy:
- Create the "src / build" directory (assuming the source code is in src / and subdirectories).
- Inside src / build, create a Makefile.
- Run make inside src / build.
Desired behavior: make will use the rules we write to send * .as src / files and its sub-files, creating new * .as files in the assembly. For instance:
src/bar.as -> m4 -> src/build/bar.as
src/a/foo.as -> m4 -> src/build/a/foo.as
An obvious make rule would be:
%.as : ../%.as
echo "m4 --args < $< > $@"
bar.as, a/foo.as, -, , make "" . make -d :
Trying implicit prerequisite `a/../foo.as'.
Looking for a rule with intermediate file `a/../foo.as'.
, "../a/foo.as". ( ), -, (http://www.gnu.org/software/make/manual/make.html#Pattern-Match).
? , , ?
VPATH, , .as ( VPATH).
.