Click here to Skip to main content
15,074,394 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I would like to redirect the object files to a different directory in a
Makefile (UNIX). Usually, the object files are placed in the same
directory as the source directory.

Please help me if anyone knows this and how to do it efficiently?

mv *.o /home/path where to be redirected

Solution1 works but if you change one source file and build,it will build all source files instead of one source files.Similarly,when you give complete build and if you make changes in one module,it will build all modules.It is a problem. So,Can you please suggest some efficient solution.

1 solution

do not move/copy the source code, you can use ln[^] to create links to the source files.

Best regards
Espen Harlinn

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900