View Full Version : compiling a file from a program


^3aFrEt^
asslamu alikom

i changed a line in a program that i have
.c file

now should i comple it again and put the .o file in the program folder or do i have to compile the whole program again ?

i.e is there special compilation options done when compiling a program or comiling a program is the sam as compiling its individual files ??

uniball
It depends on what you are doing.
Some programs come with libraries that they link static to, and several targets
depending on this library or file you have changed
some doesn't
in most cases running make'll handle this
if you change a .c file make'll compile that file, relink all the targets that
depend on it
to compile
gcc -c ffile.c -I/include/dir/1 -I/inc/dir/2
to link
gcc -o foo file1.o file2.o -L/path/to/lib/dir -llib1 -llib2

^3aFrEt^
Uni basha 3lshan 7`aterna faddy el inbox beta3ak :)


so i only should change the .c fiel and run make again and it will be fine ?


just make ??
this won`t affect the installed program after that ??

uniball
empty my inbox ? why!
i have one place for a private message :-)
ok, You have my mail :D

make'll compile the program, and rebuild any targets that depend on the .c file "if there is a Makefile". you'll end with an executable
to install it use: make install. and unless you make install, you'll not affect your previously installed copy.

^3aFrEt^
ya3ny should it be make then make install ?

or just make ??

3lshan bas teb2a fel sora this for mplayer to make it support one of the real audio format and i found the solution somewhere

uniball
make
make install
mplayer supports real media fine here without editing any file !