Skip to content

Commit

Permalink
winbuild: MS-DOS batch tidy-ups
Browse files Browse the repository at this point in the history
- prefer `.bat` extension over `.cmd` for MS-DOS batch, which also
  avoids confusion with OS/400 `.cmd` files.
- cleanup `echo` quotes, drop them consistently.
- delete empty output line from one of the error branches.
- prefer lowercase commands like the rest of MS-DOS batches.
- delete a contraction.
- drop backticks from error message.
- use `nmake.exe` consistently.
- use equal/not-equal operator style consistently.
- inline a single-line `if` branch.
- delete exceptions and rules dealing with Windows `.cmd` extension.

Closes curl#14084
  • Loading branch information
vszakats committed Jul 2, 2024
1 parent 480883c commit 092c07d
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 19 deletions.
3 changes: 1 addition & 2 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ configure.ac eol=lf
*.sh eol=lf
*.[ch] whitespace=tab-in-indent

# Batch files (bat,cmd) must be run with CRLF line endings.
# Batch files must be run with CRLF line endings.
# Refer to https://github.com/curl/curl/pull/6442
*.bat text eol=crlf
*.cmd text eol=crlf
4 changes: 2 additions & 2 deletions .github/scripts/spacecheck.pl
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"^m4/zz40-xc-ovr.m4",
"Makefile\\.[a-z]+\$",
"/mkfile",
"\\.(bat|cmd|sln|vc)\$",
"\\.(bat|sln|vc)\$",
"^tests/certs/.+\\.der\$",
"^tests/data/test",
);
Expand All @@ -43,7 +43,7 @@

my @need_crlf = (
"\\.(bat|sln)\$",
"^winbuild/.+\\.(cmd|md)\$",
"^winbuild/.+\\.md\$",
);

my @space_at_eol = (
Expand Down
2 changes: 1 addition & 1 deletion Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ VC_DIST = projects/README.md \
projects/wolfssl_override.props

WINBUILD_DIST = winbuild/README.md winbuild/gen_resp_file.bat \
winbuild/MakefileBuild.vc winbuild/Makefile.vc winbuild/makedebug.cmd
winbuild/MakefileBuild.vc winbuild/Makefile.vc winbuild/makedebug.bat

PLAN9_DIST = plan9/include/mkfile \
plan9/include/mkfile \
Expand Down
6 changes: 0 additions & 6 deletions packages/OS400/.gitattributes

This file was deleted.

13 changes: 5 additions & 8 deletions winbuild/makedebug.cmd → winbuild/makedebug.bat
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,9 @@ rem ***************************************************************************

where.exe nmake.exe >nul 2>&1

IF %ERRORLEVEL% == 1 (
ECHO Error: Can't find `nmake.exe` - be sure to run this script from within a Developer Command-Prompt
ECHO.
) ELSE (
nmake /f Makefile.vc mode=static DEBUG=yes GEN_PDB=yes
IF %ERRORLEVEL% NEQ 0 (
ECHO "Error: Build Failed"
)
if %ERRORLEVEL% EQU 1 (
echo Error: Cannot find nmake.exe - be sure to run this script from within a Developer Command-Prompt
) else (
nmake.exe /f Makefile.vc mode=static DEBUG=yes GEN_PDB=yes
if %ERRORLEVEL% NEQ 0 echo Error: Build Failed
)

0 comments on commit 092c07d

Please sign in to comment.