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.
-
Rename the file from "Makefile" to "make.bat".
-
Add the line "@echo off" to the top of the file.
-
Change all "#" comment characters on the start of a line to "REM".
-
For each variable assignment command (lines containing "="):
-
Remove all space and tab characters around the "=" operators.
-
Add the command "set" at the beginning of the line.
-
Change all "/" characters in file paths to "\".
-
Change any absolute UNIX paths of the form "/users/gfisher/..." to an
appropriate path on the computer where the batch file will be run.
-
Change all make commands of the form:
commandname:
command1; \
command2; \
...
to a DOS command sequence of the form
command1
command2
...
-
Change all (remaining) multi-line commands to single lines. A multi-line
command is one where continuation lines end in a backslash character.
-
Change all variable references of the form
$(VARNAME)
to
%VARNAME%
-
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.