For this assignment, you’ll explore the Makefile of scdoc. scdoc is an open-source project used to generate man pages—which have a notoriously ugly formatting language—from a more friendly, Markdown-like language. The scdoc source repository is located here1. You can click “tree” to see a web listing of the repository’s files, or you can clone it and browse around using the CLI. You’ll eventually need to clone it to answer some questions.
Open up the Makefile for the “scdoc” project and answer the following questions. Please provide both the answer and how you arrived at that answer (show your work or cite your sources, as appropriate):
makebuild if you run it with no arguments? Assume GNU Make.
scdocbinary, includes a number of Make variable expansions (the words starting with
LDFLAGS. What three places can these values come from?
make scdocfrom a clean directory (i.e. after initial checkout or running “make clean”), you will see 10 commands that get run. Please do this and tell us the commands. Annotate each command with the line number of the Makefile that generated the command. Many of these will share a line number—that’s okay.
make scdocbeyond the ones you annotated in the previous question? If so, what are they and why were they not included in the output?
make .build/main.o? Be specific and do not assume anything about the state of the
installrule copies the resulting binary and documentation to various special system directories so that you can use the program from anywhere on your system. To do this, it runs the
installcommand. What does the
installprogram do? Why might you use it instead of
.PHONYand lists a number of targets. What is the purpose of this line? What could happen if it were not present?
You should write your answers in a file,
Please submit with
provide comp50isdt bld-investigative answers.txt. You must
be logged into the homework server to use Provide.
You may notice that, unlike many of the other projects you’ve encountered, scdoc is hosted on SourceHut and not GitHub. SourceHut and GitHub are just two examples of Git hosting platforms; GitLab is another. Regardless of what hosting platform a project’s main repository uses, the repository itself is still plain Git. That means you can clone it, make local commits, and even push your own copy (or fork) to a different hosting provider! This illustrates the distributed nature of Git—your local clone contains the entire repository and all metadata needed to reconstruct it elsewhere. ↩