I have a makefile that creates a certain executable. This executable has to be in a certain directory to be able to run, so everytime I compile and make, i have to move it manually
Is there any way to tell the makefile to also move the file to a location.
For example, "test" is the output, what is the instruction to move from /home/user/Desktop to /var/lib/asterisk

Thanks

Recommended Answers

All 4 Replies

You could create a rule called 'install', which copies from the build directory to the target directory.

I tried this

install:
        $ mv /home/juan/Desktop/Codigos\IVR/ppal.agi /var/lib/asterisk/agi-bin

but doesn't seem to work when I make it.
I'm kinda noob to makefiles

install: /home/juan/Desktop/Codigos/IVR/ppal.agi
        mv /home/juan/Desktop/Codigos/IVR/ppal.agi /var/lib/asterisk/agi-bin

I was thinking along these lines

Worked perfectly thanks!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.