Compiling C programs


 
Thread Tools Search this Thread
Top Forums Programming Compiling C programs
# 1  
Old 11-06-2001
Compiling C programs

Hi everyone,

If you have a few c programs to compile, from a make file, how can you tell which program is compiled first. Descriptively, you may have:

objects = main.o xyz.o 123.o abc.o

target : $(objects)
$(CC) -o $@ $(objects)

Does this mean program xyz is called within main, compiled and linked before programs 123 and abc?

Any input greatly appreciated!

Thanks,

Rachael
# 2  
Old 11-06-2001
In general, yes, you are correct.
Remember however, if you made a change to
the source file abc.c then ran make
again, then only abc.o will be built
then all will be linked in order again.
The compile order is less significant than
link order. The order of the
object files and libraries must be correct
to resolve symbols properly.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Difference between inbuilt suid programs and user defined root suid programs under bash shell?

Hey guys, Suppose i run passwd via bash shell. It is a suid program, which temporarily runs as root(owner) and modifies the user entries. However, when i write a C file and give 4755 permission and root ownership to the 'a.out' file , it doesn't run as root in bash shell. I verified this by... (2 Replies)
Discussion started by: syncmaster
2 Replies

2. Shell Programming and Scripting

Scripting Programs

Hi does anyone know some good shell scripting programs, like visual studio for C++/C#? (8 Replies)
Discussion started by: Mack1982
8 Replies

3. Shell Programming and Scripting

Installation of programs

I have installed a program and put the stuff on /usr/local/ However when I run a script it gives an error GMT Fatal Error: /home/chrisd/Dimech/GMT4.5.2/share/PS_font_info.d: No such file or directory (1 Reply)
Discussion started by: kristinu
1 Replies

4. Shell Programming and Scripting

Running programs

I have installed a software called GMT, then writing a script that call the new programs ./example02.sh but I am getting ./example02.sh: line 20: gmtset: command not found I have done ./configure make make install (0 Replies)
Discussion started by: kristinu
0 Replies

5. UNIX for Advanced & Expert Users

Check programs used most

How can you check the programs that you use most often? (6 Replies)
Discussion started by: cokedude
6 Replies

6. UNIX for Dummies Questions & Answers

Are programs like sys_open( ) ,sys_read( ) et al examples of system level programs ?

Are the programs written on schedulers ,thread library , process management, memory management, et al called systems programs ? How are they different from the programs that implement functions like open() , printf() , scanf() , read() .. they have a prefix sys_open, sys_close, sys_read etc , right... (1 Reply)
Discussion started by: vishwamitra
1 Replies

7. Shell Programming and Scripting

Programs not compiling successfully

Preface: this is not a homework question. However, my teacher gave us a review packet with some C coding, and for some reason none of the C programs are compiling. First I compiled them from the shell, then I used a compiler to see if something was wrong with compiling from a shell. Both produced... (1 Reply)
Discussion started by: lazypeterson
1 Replies

8. Solaris

Compiling programs

Hi guys i have posted a thread months ago and a guy called dukenuke or smething like that told me that i have to install Sun Studio if i want to be able to compile programs. I have installed Sun Studio 12 and put it in my PATH but no success compiling anything. when i download some source (tar.gz)... (2 Replies)
Discussion started by: saveka
2 Replies

9. Programming

TSR programs

hi I want to write a tsr routine which use to replace the screen saver program, is it possible in unix? how to write a tsr in UNIX? what is address of screen saver program so that i can replace my routine in that address. (6 Replies)
Discussion started by: rajashekaran
6 Replies

10. UNIX for Dummies Questions & Answers

Where did my programs go?

I notice that (Mandrake) Linux and Windows do not seem to operate alike in terms of installing third party software. Windows, on one hand, creates icons and adds items to the Start Menu, with the help of the InstallShield--or equivalent, of course, but Linux, on the other hand, seems to care... (3 Replies)
Discussion started by: helvetica
3 Replies
Login or Register to Ask a Question