Converting a CSC 309 UNIX Makefile to a DOS Batch File



Listed below are the editing steps necessary to convert a CSC 309 Makefile into a DOS batch file. Note that these conversion steps work for the particular format of Makefiles used in CSC 309, not for all UNIX makefiles in general.

  1. Rename the file from "Makefile" to "make.bat".
  2. Add the line "@echo off" to the top of the file.
  3. Change all "#" comment characters on the start of a line to "REM".
  4. For each variable assignment command (lines containing "="):
    1. Remove all space and tab characters around the "=" operators.
    2. Add the command "set" at the beginning of the line.
  5. Change all "/" characters in file paths to "\".
  6. Change any absolute UNIX paths of the form "/users/gfisher/..." to an appropriate path on the computer where the batch file will be run.
  7. Change all make commands of the form:
    commandname:
        command1; \
        command2; \
        ...
    
    to a DOS command sequence of the form
    command1
    command2
    ...
    
  8. Change all (remaining) multi-line commands to single lines. A multi-line command is one where continuation lines end in a backslash character.
  9. Change all variable references of the form
    $(VARNAME)
    
    to
    %VARNAME%
    
  10. Run the following UNIX shell command on falcon:
    ~gfisher/classes/309/lib/add-ctrl-ms.csh make.bat
    
    where the command-line argument "make.bat" is the file you just converted. This will convert UNIX-style the end-of-line characters to DOS- style.

For an example of these conversion steps applied to a Makefile, compare the files Makefile and make.bat in the directory ~gfisher/classses/309/examples/milestone2a/design.