\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[a4paper, margin=0.75in]{geometry}

% set up hyperlink coloring
\usepackage{hyperref}
\hypersetup{
    colorlinks=true,
    linkcolor=blue,
    filecolor=magenta,
    urlcolor=cyan
}

\setlength{\parindent}{0pt} % no indentation

\renewcommand{\familydefault}{\sfdefault} % default to sans serif

% code support: listings and fancy verbatim
\usepackage{listings}
\lstset{basicstyle=\ttfamily\footnotesize}
\usepackage{fancyvrb}

\renewcommand{\familydefault}{\sfdefault} % default to sans serif

%%%%%%%%%%%%%%%%
\begin{document}

\title{Homework 7\\Make}
\author{EECS 201 Winter 2020}
\date{}
\maketitle

\section*{Submission Instructions}
This homework will be submitted as a repository on the UMich GitLab server.
The repository you submit will be a \textbf{private} project called \texttt{eecs201-hw7}.

\section*{Preface}
In this homework you'll be provided yet another zipped archive containing some starter files.

\begin{Verbatim}[fontsize=\footnotesize]
  curl -O https://www.eecs.umich.edu/courses/eecs201/files/assignments/hw7-files.tar.gz
  tar xzf hw7-files.tar.gz
  cd hw7-files
\end{Verbatim}

Initialize a Git repository in the extracted \texttt{hw7-files} directory.
Create a file called \texttt{REPORT} in this directory.
Add all of the present files and commit them.
\\\\
Create a \textbf{private} project named \texttt{eecs201-hw7} on the UMich GitLab (\url{gitlab.umich.edu})
and add the instructor \texttt{brng} as a \textbf{Reporter}.
Set this UMich GitLab project as your remote: you'll be pushing to it in order to submit.
\\\\
In this assignment you will be incrementally building up more complex Makefiles.
First, we'll start at the beginning.

\section{A fresh start}
\begin{enumerate}
  \item \texttt{cd} into the \texttt{1} directory.
  \item Create a file named \texttt{Makefile}.
  \item Create a rule with a target called \texttt{all} that has this for a recipe:\\
        \texttt{gcc -o nocat nocat.c}
  \item Create a rule with target called \texttt{clean} that has this for a recipe:\\
        \texttt{rm -f nocat}
  \item Move the \texttt{all} rule so that it'll run by default when \texttt{make}
        is run without a target specified.
  \item Make sure that your Makefile works correctly.
  \item Add and commit \texttt{Makefile}.
\end{enumerate}

\section{Phonies}
\begin{enumerate}
  \item \texttt{cd} into the \texttt{2} directory.
  \item Take a look at the Makefile and note the existing rules.
  \item Try running \texttt{make all}, \texttt{make clean}, and \texttt{make test}.
  \item Note that their recipes do not run.
  \item Fix the Makefile so that each of the rules can run their recipes.
\end{enumerate}

\section{Dependencies}
\begin{enumerate}
  \item \texttt{cd} into the \texttt{3} directory.
  \item Take a look at the Makefile. Note what each target in the Makefile requires which file.
  \item Edit the Makefile so that the \texttt{all} target will build the \texttt{nekosay} application.
        The best way to test this is to run \texttt{\$ make clean} then \texttt{\$ make all}.
        \texttt{\$ make all} as a clean build should successfully build the application.
\end{enumerate}

\section{Not repeating yourself}
\begin{enumerate}
  \item \texttt{cd} into the \texttt{4} directory.
  \item Create a file named \texttt{Makefile}.
  \item Edit the \texttt{Makefile} so that:
    \begin{itemize}
      \item It has a \texttt{CC} variable that is set to \texttt{gcc}\\
            This variable represents which C compiler to use.
      \item It has a \texttt{BIN} variable that is set to \texttt{sum30}\\
            This variable represents what the output executable binary is named.
      \item It has a \texttt{SRCS} variable that contains all the \texttt{.c} files
            under the \texttt{src} directory.\\
            (You shouldn't have to list each file individually...)
      \item It has a rule to build the output executable binary.
            Don't worry about object code.
            Note that the \texttt{-o} flag for \texttt{gcc} sets the output name.
            This rule should have \texttt{SRCS} as a prerequisite.
            In addition, the recipe should make use of existing variables and
            \textbf{automatic variables} that refer to the target and prerequisites
            to avoid repeating yourself
            (e.g. you shouldn't be referring to \texttt{SRCS} or \texttt{BIN} in the compilation command).
      \item There is a phony \texttt{all} target that builds the output executable binary.
      \item There is a phony \texttt{clean} target that removes the output executable binary.
      \item The \texttt{all} target should run when \texttt{\$ make} is run (without a target specified).
    \end{itemize}
\end{enumerate}

\section{Conclusion}
\begin{enumerate}
  \item Add and commit any changes you intend to submit.
  \item Fill out the \texttt{REPORT} file in the following steps:
  \item On the first line provide an integer time in minutes of how long it took
        for you to complete this assignment. It should just be an integer: no letters or words.
  \item On the second line and beyond, write down what you learned while doing this assignment.
        If you already knew how to do all of this, put down ``N/A''.
  \item Commit your \texttt{REPORT} file and push your commits to your remote.
\end{enumerate}

\end{document}
