Makefile Questions & Answers – 1

DigitalOcean Referral Badge DigitalOcean Referral Badge

1.

If make command is executed as “make -j 2”, then

   A.) two jobs will run simultaneously
   B.) only two will be executed
   C.) it will give an error
   D.) none of these

Answer: Option 'A'

two jobs will run simultaneously

DigitalOcean Referral Badge

2.

Which make command option ignores all errors in commands executed to remark files?

   A.) -i
   B.) -j
   C.) -k
   D.) -l

Answer: Option 'A'

-i

DigitalOcean Referral Badge

3.

If we want to get the exit status that specified targets are up to date or not, we have to execute the make command with option

   A.) -q
   B.) -r
   C.) -s
   D.) -t

Answer: Option 'A'

-q

DigitalOcean Referral Badge

4.

Which option of make command print the commands that would be executed, but do not execute them?

   A.) -m
   B.) -n
   C.) -o
   D.) -p

Answer: Option 'B'

-n

DigitalOcean Referral Badge
    DigitalOcean Referral Badge DigitalOcean Referral Badge

5.

If our makefile is named as “sanfoundry”, then which one of the following command will compile the code with this makefile

   A.) make -a sanfoundry
   B.) make -f sanfoundry
   C.) make sanfoudry
   D.) make

Answer: Option 'B'

make -f sanfoundry

DigitalOcean Referral Badge

6.

The command “make sanfoundry” will

   A.) create the executable if sanfoundry.c file is present in the current directory
   B.) create the object file named as sanfoundry.o
   C.) give an error
   D.) none of these

Answer: Option 'A'

create the executable if sanfoundry.c file is present in the current directory

DigitalOcean Referral Badge

7.

The makefile starts executing from

   A.) first target
   B.) first target whose name starts with “.”
   C.) first target whose name does not starts with “.”
   D.) none of these

Answer: Option 'C'

first target whose name does not starts with “.”

DigitalOcean Referral Badge

8.

As we type “make” command on the terminal

   A.) make reads the makefile in the current directory
   B.) make reads the makefile in the parent directory
   C.) make reads the makefile in the predefined environment variable
   D.) none of these

Answer: Option 'A'

make reads the makefile in the current directory

DigitalOcean Referral Badge

9.

What is phony target in the makefile?

   A.) the target which is not a filename
   B.) the target which is a filename
   C.) the target which does not used for compilation
   D.) none of these

Answer: Option 'A'

the target which is not a filename

DigitalOcean Referral Badge
    DigitalOcean Referral Badge DigitalOcean Referral Badge

10.

What is makefile?

   A.) makefile describes to the make command that how to compile the program
   B.) makefile contains various statements related with the compilation of target
   C.) makefile contains various statements
   D.) none of these

Answer: Option 'A'

makefile describes to the make command that how to compile the program
 

DigitalOcean Referral Badge

Makefile Questions & Answers – 1 Download Pdf

Recent Posts