| CIS 330 Home Page | Last updated 2008/02/08 11:08:51 |
Naturally, the tests are dependent on their corresponding problem program.
Use makefile macros to parameterize your Makefile appropriately. For example, you should be able to switch between the Solaris and Gnu compilers without editing the Makefile.
Use the published Assignment 2 solution source along with the driver code from the assignment for checking your solution. Note that the array3d code in the published solution uses the array2d solution. The drivers for the first three problems should be named ilistTest, array2dTest, and array3dTest with the corresponding source files named similarly. The fourth problem solution should consist of just one source file named quicksortTest.c and the resulting executable named quicksortTest.
Test your solution with two assignment subdirectories, but be sure it will work with additional directories with a minimum of editing of the makefile.
See if you can use the special makefile macros for current dependent and target and so avoid duplication in the makefile for different assignments.
Here is an example scenario for this script. Suppose I have a directory of digital photos. When I unload pictures from my camera into this directory, the file names are not very useful since my camera names the files as CIMG0005.JPG, CIMG0006.JPG, etc. The pictures are from a trip to Yosemite, so I would like them all to be named yosemite01.jpg, yosemite02.jpg, etc. I can do this with my shell script by executing it as follows:
If there were N jpg files beginning with CIMG, this should produce a set of N files named yosemite01.jpg, yosemite02.jpg, ..., yosemiteNN.jpg Note that the N CIMG files need not have been a continuous sequence numbered 1 through N since I may have deleted files on the camera, creating holes in the numbering sequence. But I do want the renamed files to be a continuous numbering sequence from 1 to N.rename.sh 'CIMG*' yosemite
Note - it is safest to work on this shell script in an empty directory so that you don't inadvertenly remove or rename files as you work the bugs out of your script.
Your shell script should work with the standard Unix shell /bin/sh.