Hi,

I'm practicing for my test and I'm really confused on this question
This is the content of make file assuming that part1 and part3 has been modified. list the sequence of command activation in the correct order for make to run

I understand it looks at the target then the dependencies and then it does the action, so wouldn't the commands be in the same order as in the make file.. I'm really confused plz help

all: part1.o part2.o
gcc part1.o part2.o -o whole

part1.o: part1.c part3.o
gcc -c part1.c
gcc part1.o part3.o -o part3.out

part2.o: part2.c
gcc -c part2.c

part3.o: part3.c
gcc -c part3.c

part1.o: part1.c part3.o
It needs to do part3 first, because of this.

Thank you for your relpy


So your saying it has to look to the object file inside of the dependencies in order to do give the sequence then it going to look in part3.o and do its command

gcc -c part3.c
gcc -c part1.c
gcc part1.o part3.o -o part3.out
gcc -c part2.c
gcc part1.o part2.o -o whole

Is that right??

Where did part2 come from?

all: part1.o part2.o

part2.c didn't change, so there's no need to regenerate part2.o

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.