I am tasked with porting old code to C ++, from Unix to Linux. The project consists of several Makefiles for different "modules" of the library. I solved some problems, but now I have problems with the include directive.
Apparently, the way to create Make files is to have separate include directives for different files, and it worked on the Unix server for many years.
For instance:
include ../../../../util/genmake.def processControl.slOBJS = processControl.o outputControlOBJS = outputControl.o inputControlOBJS = inputControl.o cleanList = *.o *.C *.out processControl.sl outputControl inputControl all: processControl.sl outputControl inputControl processControl.sl: $(processControl.slOBJS) include ../../../../util/genmake.slinc outputControl: $(outputControlOBJS) include ../../../../util/genmake.exeinc inputControl: $(inputControlOBJS) include ../../../../util/genmake.exeinc include ../../../../util/genmake.inc
You can see here that, including the tabs, apply only to the indicated goals! They are part of the recipe for this purpose.
However, this construct does NOT work on Linux, I get this error:
include ../../../../util/genmake.slinc make: include: Command not found make: *** [processControl.sl] Error 127
Obviously, I cannot just remove the tab, because include should only be for this purpose ...
So, I tried replacing it with the 'source' command for the source of the incoming file, for example:
source ../../../../util/genmake.slinc
This does not work, and I also tried to include the included code directly in the include file (commenting on the include command) - this handles errors related to the Makefile, but this is not a good solution, since it is really difficult to port and maintain it in order to reproduce the same code throughout the project in all modules, and then, of course, every small change that I would have to reflect in all the files.
Can someone make an expert, please, advice on this issue? In addition, as a rule, any recommendations on how best to approach this migration task will be welcome :)
Thanks!
EDIT- Additional Information: Content genmake.slinc:
These are the tabs before @.
Now the contents of genmake.exeinc:
If I go into the Makefile and delete the leading tabs in the include, I get this error: .. /../../../util/genmake.slinc:10: *** the commands start before the first goal. Stop.