Forum     

Go Back   Digit Technology Discussion Forum > Software > Programming
Register FAQ Calendar Mark Forums Read

Programming The destination for developers - C, C++, Java, Python and the lot


Reply
 
LinkBack Thread Tools Display Modes
Old 12-10-2011, 11:58 AM   #1 (permalink)
Linux Struggler
 
uniquerockrz's Avatar
 
Join Date: Feb 2011
Location: Kolkata
Posts: 15
Exclamation Creating setup files in Linux


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?
__________________
My blog -> http://intoanotherdawn.tk
uniquerockrz is offline   Reply With Quote
Advertisements. Register and be a member of the community to get rid of them.
Advertisement

Old 12-10-2011, 01:59 PM   #2 (permalink)
change is constant!!
 
khmadhu's Avatar
 
Join Date: Jan 2010
Location: Bengaluru
Posts: 445
Default Re: Creating setup files in Linux

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!
__________________
If you really wanna think, try to think from Atom to Universe!!

cpu: core i5 2500k, mobo: DP67BG, RAM:Corsair 8GB(4x2) 1600 Mhz, XFX HD 5770, 1TB seagate 6Gbps 7200 rpm , SAGA II 500W
khmadhu is offline   Reply With Quote
Old 12-10-2011, 03:38 PM   #3 (permalink)
God of Mistakes...
 
Garbage's Avatar
 
Join Date: Dec 2005
Location: Pune, Maharashtra
Posts: 1,923
Default Re: Creating setup files in Linux

From What does "make install" actually do?

Quote:
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 /

Quote:
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.
__________________
Registered Linux User #468778
----------------------------------
http://twitter.com/_Garbage_
Garbage is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


 
Latest Threads
- by Charan
- by Sarath
- by clmlbx

Advertisement




All times are GMT +5.5. The time now is 12:35 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.

Search Engine Optimization by vBSEO 3.3.2