Priority of rules in Makefile!!!


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users Priority of rules in Makefile!!!
# 1  
Old 09-24-2008
Priority of rules in Makefile!!!

Consider in a makefile i have the target defined as:

pgm: a.o b.o
cmd;

To build .o, 2 rules are defind

.pc.o:
cmds
.c.o:
cmds

My question is which rule will take priority for compiling a.o and b.o when the target pgm is built.

Despite the positoning of the 2 rules, .c.o always takes the priority. How to set the 1st priority to .pc.o ?
# 2  
Old 09-25-2008
Is this what you want?
Makefile -> pc precedence over c
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Help understanding makefile: static pattern rules

Hi all, I'm reading the GNU Make book I cannot understand the following syntax from the book. objects = foo.o bar.o all : $(objects) $(objects) : %.o : %.c $(CC) -c $(CFLAGS) $< -o $@ If I run: make, I get the output: cc -c foo.c cc -o foo foo.o I think I... (3 Replies)
Discussion started by: santiagorf
3 Replies

2. Red Hat

The priority of the log

Hi, I can't find the priority in my logs, which under the catalogue of /var/log/lmessages. For example, if the log below occur on my machine, there is no <30>. What should I do if I want to see <30> . <30>Oct 9 22:33:20 hlfedora auditd: The audit daemon is exiting. (0 Replies)
Discussion started by: zhaoyy
0 Replies

3. Homework & Coursework Questions

Help with Simple Multi-Level Makefile (Extremely New at Makefile)

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: Basically, the prompt is make a makefile with various sub makefiles in their respective subdirectories. All code... (1 Reply)
Discussion started by: Tatl
1 Replies

4. UNIX for Advanced & Expert Users

Makefile executing another Makefile first?

I have 2 libraries in 2 different directories that I build with Makefiles. library B depends on library A. If I modify a .cpp file in library A and run lib B's Makefile can I have B's makefile to automatically rebuild library A? I am now rebuilding A, followed by B... but I'd like B to... (0 Replies)
Discussion started by: wwuster
0 Replies

5. Red Hat

DNS priority

Hi All, Is this correct on DNS searching? (1st priority) /etc/hosts (2nd p.) /etc/resolv.conf Are there more things that I didn't know? Thank you for any comments you may add. (5 Replies)
Discussion started by: itik
5 Replies

6. AIX

priority for process

hi how to change the priority of a process for eg.if a,b,c these there process are running and if i have to give the b process as high priority and high severe level what should i do (3 Replies)
Discussion started by: senmak
3 Replies

7. UNIX for Advanced & Expert Users

Makefile problem - How to run module load in a Makefile

Hi, I'm trying to run the module load command in a Makefile and i'm getting the following error: make: module: command not found Why is this? Is there any way to run this command in a Makefile? NOTE: command - module load msjava/sunjdk/1.5.0 works fine outside of the Makefile (2 Replies)
Discussion started by: hernandinho
2 Replies

8. Programming

kill priority

hello everybody! i would like to post a question. If i embed in my C code the command kill(9,pid) inside an if command. Is this command(kill) executed in any way. Both if the if is true and false. Does kill have greater priority than the if command. thanx in advance! (5 Replies)
Discussion started by: nicos
5 Replies

9. Shell Programming and Scripting

Please Help me with this ..High Priority!

Hi, I am a nw bie to Schell Scripting, i have a same king of requirement as posted above. my input file is also a log file as below..... 28.05.2008 07:02:56,105 INFO Validation request recieved 28.05.2008 07:03:57,856 INFO 0:01:13.998 Response sent with: <?xml version="1.0"... (0 Replies)
Discussion started by: balaji_gopal
0 Replies
Login or Register to Ask a Question