Starting from:

$24.99

Assignment 1: Simple Make Solution

1    Purpose

 

Make is useful a utility which builds executable programs or libraries from source files based on a makefile which includes information on how to build targets (e.g.  executable programs or libraries).  In this assignment, you will write a simple version of Make (make4061) which 1) reads the makefile, 2) follows the specification in the file and

3) builds the targets in parallel (i.e. concurrently) using fork, exec and wait in a controlled fashion just like standard Make in Linux. Your make4061 will create a dependence graph of all the targets (files) to be compiled at runtime to support control- and data- dependencies. Independent files are compiled in parallel/concurrently while dependent files are compiled once all of its control dependencies have been resolved. You should work in groups of 3.

 

 

2    Description

 

Your make4061 will be responsible for analyzing dependencies of targets, determining which targets are eligible to be compiled (built). That is, each target may depend on other targets which should be evaluated first. As targets in makefile are compiled (built), your Make4061 will determine which targets in the makefile have become eligible to be compiled (built), and continue this process until final target is built. To make this work, you will need to make a DAG (Directed Acyclic Graph) which has no cycles from the makefile. For example, figure 1 shows the graph that is created by this makefile. There are two major aspects of this lab. One is the grungy low-level parsing you need to do to build the graph, and the other is the processing of the graph. All C programmers have to eventually deal with the former, even though the main intellectual aspect for us is the second part.

More products