how to generate the intermediate files (i.e.,*.s, *.i ) in a different directory ?
ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I run the makefile at /home/user/ . So, the ".o" file generate at the corresponding location of ".c" files, this is as expected.
When I pass the "-dg" highlighted in bold in the above code, it generates "*.c.100.dg" file at the current working directory. So, I need this intermediate file in /home/user/debug_files/. I can not change the path of running the makefile.
this is not related to clearcase, but the compiler you use. if there was no other way you can add a line:
<tab>mv *dg /home/user/debug_files/
or similar
and it fails saying mv: cannot stat `*.c.100.dg': No such file or directory
am I placing the right "mv" command at right place ? is it possible (or) do we have a rule to move/generate the files as and when the *.c.100.dg files generated ?
Naah, that seems to me to be a red-herring dead end: you don't want to move the files. You just gotta see if your compiler has a command-line option that will specify where its output files should be placed.
I do not really know that compiler, so I don't know where should you put that line. You posted one line of a makefile, that will not help a lot....
Also I do not know if moving those files is a good idea or not. But if those files were generated during execution of .c.o rules (together with .o files) the mv command should be ok, although I would use $<.100.dg probably, and also insert a - before the command.
without knowing the compiler and knowing what's really happening .....
You ought to be strict, so move only the "current" .dg file(s), not the one created by another target (otherwise you may have very strange error messages)
> I am not interested in the names. But, with their extension(*.dg).
Trouble is, you know neither. Or if you know, you cannot properly tell. Also you fail to see difference between [quote] and [code] Nonetheless, here is your code:
Please let's start from the very beginning: What is in your Makefile? What do you expect to happen? What happens instead of that? Is there an error message?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.