Washington State University HomeWSU AdmissionsWSU CampusesWSU HomeWSU Search Tools*

edge graphic
image001

Home

Syllabus

Notes

Homework

Grades


Homework 4 - Make


Due via ANGEL Monday October 6, 2009, at 5pm

Given the following ridiculous example programming project:

File howdy.h

 
#include <stdio.h>

File main.c

 
#include "howdy.h"
 
main()
{
    printhowdy();
    credits();
}

File print.c

 
#include "howdy.h"
 
void printhowdy()
{
    printf ("Howdy world! (Texan for \”Hello world!\")\n");
}

File credits.c

 
#include "howdy.h"
 
void credits()
{
    printf ("\n(This ridiculous example of overkill was created for CptS 224.)\n");
}
  1. (7 points) Write a Makefile that will correctly compile subparts "main.o" and "print.o" and assemble a program called "howdyworld" from those parts. The dependencies should be correct so that if any of the 4 files is updated, the correct pieces will get rebuilt.
  2. (1 point) If you update "howdy.h" (you can use the touch command to update the modification time of the file) what happens?
  3. (1 point) If you update "print.c" what happens?
  4. (1 point) If you update both "print.c" and "credits.c"