I am trying to understand why I cannot specify the target as being in another directory.
I am trying to generate some php classes from json files, but I changed the line that php actually generates for a fictitious statement echo, so someone else can just copy the paste and see if they feel very generous.
Two more things can be added to the directory containing the makefile:
- Dummy dependency file called PatientDbPath.json
- Called directory
If I have a makefile with the following:
.SUFFIXES: .php .json .json.php: echo "HelloMe" > PatientDbPath.php PatientDbPath.php: PatientDbPath.json clean: $(RM) PatientDbPath.php
Then everything works when I run make; PatientDbPath.php is correctly created, and the next time I run make, I get the message make: 'PatientDbPath.php' is up to date.
However, I want to generate a php file in a separate directory, so I updated my makefile to the following:
.SUFFIXES: .php .json .json.php: echo "HelloMe" > out/PatientDbPath.php out/PatientDbPath.php: PatientDbPath.json clean: $(RM) out/PatientDbPath.php
As soon as I do this, Make tells me make: Nothing to be done for 'out/PatientDbPath.php' , although the PatientDbPath.php file is not in the out directory.
So, I thought it was something with the suffix rules, and I created a third make file.
out/PatientDbPath.php: PatientDbPath.json echo "Whatever" > out/PatientDbPath.php clean: rm out/PatientDbPath.php
This works well, like the first. Can someone see what I am doing wrong in my second makefile?
Thanks.