Assignment 13

Due Nov 19, on line

Part of the homework for CS:2820, Fall 2020
by Douglas W. Jones
THE UNIVERSITY OF IOWA Department of Computer Science

Simple multiple choice questions, 1 point each:

  1. In a file, the Lines prefixed with # are equivalent to
    a) Lines prefixed with *
    b) Lines prefixed with -
    c) Lines underlined with a row of ----- marks
    d) Lines underelined with a row of ===== marks
    e) Lines prefixed with #####

  2. What is the difference between a markdown language and a markup language?
    a) Markdown is simpler to typeset because it can't have hyperlinks.
    b) Markup files are impossible to edit without special software tools.
    c) There are few markup languages, while there are many markdown ones.
    d) Markup languages are inherently subject to stronger standards.
    e) Markdown files are intended to be easy to read as plain text file.

  3. Consider this fragment of a makefile:
    a: b c
            d e

    In this file:
    a) files b and c must exist for the makefile to be valid.
    b) target a depends on files b and c.
    c) d e must be the shell command to create file a.
    d) target a must be a file name.
    e) e is the name of a file passed to shell command d.

  4. We usually structure a Makefile so that the primary make target is first, and whenever possible, all interfile dependencies go down, that is, we list the makefile entry for the dependent file before the entries for the files it depends on. If we do this, we can arrange the makefile to expose layers in the virtual machine hierarchy. Specifically, a division between layers in the hierarchy is a break between makefile entries that has:
    a) dependencies going up across it, not down.
    b) more than one dependency crossing it.
    c) dependencies going both up and down across it.
    d) dependencies going down across it, not up.
    e) only one dependency crossing it.

  5. Recall that the default rule is to re-make a file if its time of last modification is before the times of last modification of the files on which it depends. Consider this little example:
    Road.class: Intersection.class
    Intersection.class: Road.class

    Make has a special case to detect and deal with circular dependencies like the above. What would happen here if it did not have this special case?
    a) Nothing, because the Java compiler deals with this issue for make.
    b) It might miss the commands to build some required make target.
    c) It could go into an infinite loop.
    d) Nothing, because it just runs the shell commands in the order listed.
    e) It might fail to notice some of the make dependencies.

    (Note: In the above question, you will probably need to develop a hypothesis about what data structures make builds and how it uses them to process the makefile.)

Machine Problem 11 -- due Monday, Nov 30

Write a makefile for the Epidemic simulator. This makefile shoud do a careful jog of documenting all of the interfile dependencies in the project and it should be nicely written. It should work with either the solution to MP9 or MP10 (while these have different simulation frameworks, the interfile dependencies and the names of the source files are the same).

Note that you will be completely responsible for issues of style, and that your code will be checked by running it to actually build and test the simulator.

You should include support for:

Submit your code for the file Makefile.

A student asked: What kind of file type should the makefile have?

On Unix/Linux systems, the makefile is typically named Makefile with no dot or other suffix. Unix/Linux systems do not require that files have some kind of type. Mandatory file types are a foible of Microsoft systems.