Makefile Questions & Answers – 2

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

1. If we want to execute the makefile by just giving the “make” command, makefile should be named as
a) Makefile
b) makefile
c) MAKEFILE
d) None of the mentioned
View Answer

Answer: a
Explanation: None.

2. Running “make” command without the arguments starts the target ____ in the makefile.
a) “.phony”
b) “clean”
c) first
d) none of the mentioned
View Answer

Answer: c
Explanation: None.

3. In makefile the comment begins with the character
a) $
b) #
c) /*
d) none of the mentioned
View Answer

Answer: b
Explanation: None.

4. Which one of the following is used for the target filename in the makefile?
a) $@
b) $*
c) $?
d) none of the mentioned
View Answer

Answer: a
Explanation: None.
advertisement
advertisement

5. Which one of the following can be used to specify the directory to search the dependencies and target files?
a) VPATH
b) CPATH
c) FPATH
d) None of the mentioned
View Answer

Answer: a
Explanation: None.

6. In the makefile the target and dependencies are separated by the character
a) –
b) :
c) /
d) none of the mentioned
View Answer

Answer: b
Explanation: None.

7. Macros for the makefile can be defined in
a) makefile
b) command line
c) both makefile and command line
d) none of the mentioned
View Answer

Answer: c
Explanation: None.

8. Which one of the following is not a valid makefile directive?
a) if
b) elif
c) endif
d) none of the mentioned
View Answer

Answer: d
Explanation: None.
advertisement

9. When a target of makefile fails to execute
a) make does not executes any other target dependent on it
b) it returns a status
c) make does not executes any other target dependent on it & it returns a status
d) none of the mentioned
View Answer

Answer: c
Explanation: None.

10. Which one of the following provides all dependencies in the makefile?
a) $^
b) $*
c) $:
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.