Which commands does Make run?

A C project is built with Make using the Makefile below. The developer runs make app, which successfully builds everything, and then edits and saves only the file util.h. Saving util.h gives it a later modification time than the existing object files. No other file changes. Assume all commands succeed and modification times distinguish successive changes.


make
app: main.o parser.o util.o
	cc -o app main.o parser.o util.o

main.o: main.c parser.h
	cc -c main.c

parser.o: parser.c parser.h util.h
	cc -c parser.c

util.o: util.c util.h
	cc -c util.c


The developer then runs make app again. How many cc commands does Make execute on this second run? Give your answer as a whole number.

Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors

More Declarative Languages Questions: