1@echo off
2rem Simple .bat script for creating the NMake Makefile snippets.
3
4if not "%1" == "header" if not "%1" == "file" if not "%1" == "footer" goto :error_cmd
5if "%2" == "" goto error_no_destfile
6
7if "%1" == "header" goto :header
8if "%1" == "file" goto :addfile
9if "%1" == "footer" goto :footer
10
11:header
12if "%3" == "" goto error_var
13echo %3 =	\>>%2
14goto done
15
16:addfile
17if "%3" == "" goto error_file
18echo.	%3	\>>%2
19goto done
20
21:footer
22echo.	$(NULL)>>%2
23echo.>>%2
24goto done
25
26:error_cmd
27echo Specified command '%1' was invalid.  Valid commands are: header file footer.
28goto done
29
30:error_no_destfile
31echo Destination NMake snippet file must be specified
32goto done
33
34:error_var
35echo A name must be specified for using '%1'.
36goto done
37
38:error_file
39echo A file must be specified for using '%1'.
40goto done
41
42:done