\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

\usepackage{xcolor}
\newcommand{\code}[1]{\colorbox{lightgray}{\texttt{#1}}}
\newcommand{\sh}[1]{\code{\$ #1}}

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

\title{Homework 10\\Libraries}
\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 \code{eecs201-hw10}.

\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/hw10-files.tar.gz
  tar xzf hw10-files.tar.gz
\end{Verbatim}

Initialize a Git repository \textbf{in the extracted \code{hw10-files} directory}.
Create a file called \code{REPORT} in this directory.
Add all of the present files and commit them.
\\\\
Create a \textbf{private} project named \code{eecs201-hw10} on the UMich GitLab (\url{gitlab.umich.edu})
and add the instructor \code{brng} as a \textbf{Reporter}.
Set this UMich GitLab project as your remote: you'll be pushing to it in order to submit.
\\\\
\textbf{For this assignment you're going to need to be in a Linux environment,
be it WSL or your Ubuntu VM or whatever else you have.}
\\\\
\textbf{This homework assignment assumes that you have a basic understanding of
Makefiles. If you did not do HW7 or ADV7, you may want to get brushed up on Makefiles.}

\section{Linking against libraries}
In this section you'll be linking against a static library and its dynamic version
with two different targets.
\begin{enumerate}
  \item \code{cd} into the \code{link} directory.
  \item Open the \code{Makefile}. Note the two TODOs.
  \item Address the two TODOs and modify the compilation
        commands so that the \code{dynamic} target links against
        \code{libthingy.so} and the \code{static} target links
        against \code{libthingy.a}.
        \\{\footnotesize{}When there's a naming conflict, which takes precedence?}
  \item You can use the \code{run-dynamic} target to see if you
        successfully linked against the dynamic library.
\end{enumerate}

\section{Creating libraries}
In this section you'll be performing the steps to build both a
static library and a dynamic library.
\begin{enumerate}
  \item \code{cd} into the \code{create} directory.
  \item Take a look at the directory structure.
    \begin{itemize}
      \item The \code{inc} directory contains library header(s).
      \item The \code{libsrc} directory contains the source code for the library.
      \item The \code{lib} directory (created by the Makefile) contains produced libraries.
    \end{itemize}
  \item Open the \code{Makefile}. Note the four TODOs.
  \item Add the necessary commands to the appropriate recipes to build the dynamic and
        static libraries and, like in \#1, update the \code{app-dynamic} and \code{app-static}
        targets to link against the appropriate libraries.
    \begin{itemize}
      \item Note that dynamic/shared library objects need to be compiled as position-independent code.
            You might notice that since both the dynamic and static libraries need object code
            the names of the object code files will conflict. Feel free to call the object code
            files whatever you want or put them where you want..
    \end{itemize}
\end{enumerate}

\section{Conclusion}
\begin{enumerate}
  \item Add and commit the files you created.
  \item Fill out the \code{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 \code{REPORT} file and push your commits to your remote.
\end{enumerate}

\end{document}
