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?
2 replies to this topic
#1
Posted 11 October 2011 - 10:47 PM
|
|
|
#2
Posted 12 October 2011 - 05:23 AM
Installing a program on *nix involves copying the compiled files to specific locations with specific permissions. How much do you know about the file system on *nix?
In response to your PPS: basically, yes.
In response to your PPS: basically, yes.
#3
Posted 12 October 2011 - 06:23 PM
A make file can reduce the need for multiple scripts to configure, compile, test, install, and possibly uninstall programs. There is no need to have a compiling step, or to use a make file all together if you have no need for one.
Within your make install: directive (within Makefile) or in a shell script you can easily have the following:
The install program being the key executable to set permissions and do the copy in more safe manner.
Within your make install: directive (within Makefile) or in a shell script you can easily have the following:
prefix=/usr/local
install: somebinary
install -m 0755 somebinary $(prefix)/bin
...
.PHONY: install
The install program being the key executable to set permissions and do the copy in more safe manner.
Be sure to read the updated FAQ! || Health is achieved through the same 10,000 steps.
If a suggested code/method fails, informing us is less important than telling us why or what errors occurred.
If a suggested code/method fails, informing us is less important than telling us why or what errors occurred.
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users


Sign In
Create Account

Back to top









