Creating setup files in Linux

U

uniquerockrz

Guest
I have written a console program in C named main.c.

I want to turn it into an application, so that using a Makefile and 'make' and 'make install' commands one is able to install that in his/her computer.

Any ideas how to do that? I have searched tutorials for making the Makefile but they just tell me the way to compile the source files, not "install" them.

PS, I use Fedora 15 and Code::Blocks Ide, if that is of any help.

PPS : I have seen that copying the executable produced by gcc to /usr/bin directory does has the same result as installing. Is that what 'make install' command does?
 

khmadhu

change is constant!!
for a single file better use the binary file after compiling , that should work. but Linux binary is different from windows.thus u cannot use in windows, u need to rebuild again in windows environment.
thats why they told you to build from source..

'make install' does the same but in addition it does a lot in placing/checking files in correct path.

remember in Linux Everything is a file!
 

Garbage

God of Mistakes...
From What does "make install" actually do?

What does "make install" do entirely depends on the concrete case we are talking about. "make" is a tool that -unless otherwise instructed via command line options- looks into the current directory for a makefile, and builds the target you instructed it to build. In this case, the target is "install". Such target is usually scripted in a fashion that it will install a number of files after the program is compiled. Each file to the right place (i.e. binaries in /bin or /usr/bin, docs in /usr/share/doc..... ), but it will also set permissions and ownerships and maybe do some other tasks.

So, in short, to compile a program you usually do "make", and to install it after compiling you do "make install". Usually you do need root permissions if you want to install to /

what does this command do? Does it have something to do with shared libraries?
It usually installs the stuff in your system, however, this entirely depends on the one who scripted the makefile. It wouldn't make much sense to use the "install" target to launch a pacman clone, but it's certainly possible to do so.

But, you can safely assume that "make install" will install the program or whatever you just built in your system.
 
Top Bottom