Makefile Questions & Answers – 1

This set of Linux / Unix questions and answers focuses on makefile. This is set 1.

1. 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 the mentioned
View Answer

Answer: a
Explanation: None.

2. 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 the mentioned
View Answer

Answer: a
Explanation: None.

3. 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 the mentioned
View Answer

Answer: a
Explanation: None.

4. 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 the mentioned
View Answer

Answer: c
Explanation: None.
advertisement
advertisement

5. 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 the mentioned
View Answer

Answer: a
Explanation: None.

6. 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
View Answer

Answer: b
Explanation: None.
Sanfoundry Certification Contest of the Month is Live. 100+ Subjects. Participate Now!

7. 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
View Answer

Answer: b
Explanation: None.

8. 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
View Answer

Answer: a
Explanation: None.
advertisement

9. Which make command option ignores all errors in commands executed to remark files?
a) -i
b) -j
c) -k
d) -l
View Answer

Answer: a
Explanation: None.

10. 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 the mentioned
View Answer

Answer: a
Explanation: None.
advertisement

Sanfoundry Global Education & Learning Series – Linux Administration & Programming.
Here’s the list of Best Books in Linux Commands & Shell Programming.
Here’s the list of Best Books in Linux Kernel, Device-Drivers & System Programming.

To practice all questions on Linux Administration & Programming, here is complete set of 1000+ Multiple Choice Questions and Answers on Linux.

If you find a mistake in question / option / answer, kindly take a screenshot and email to [email protected]

advertisement
advertisement
Subscribe to our Newsletters (Subject-wise). Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!

Youtube | Telegram | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.