Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,9 @@ Current versions should be installed via ebuild or built using the makefile,
however, in earlier versions (3.pre-*) the recommended way of building the
software was by using the BAT and SH scripts in the top directory of the
distribution as appropriate for your platform. On Win32, the script
build_w32vc.bat builds the software with Microsoft Visual C++ version
5 or 6 (locations within the script may need to be modified according
build_w32vc.bat builds the software with Microsoft Visual C++. Newer versions
(vs2017 and newer) should work automatically. Older versions like 5 or 6:
locations within the script may need to be modified according
to which you have and whether it is installed at the default position
in the filesystem). On Linux and similar platforms the shell script
build_posixgcc.sh should still work.
Expand Down
2 changes: 1 addition & 1 deletion README_install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ For MSVC on windows you can follow the same basic procedure, but use the

$ git clone https://github.com/sarnold/cccc
$ cd cccc
$ ./build_msvc.bat --clean
$ ./build_w32vc.bat


.. note:: On windows the executable name is ``cccc.exe``.
Expand Down
31 changes: 20 additions & 11 deletions build_w32vc.bat
Original file line number Diff line number Diff line change
@@ -1,38 +1,51 @@
@rem build_w32vc.bat
@echo off
setlocal enabledelayedexpansion

if not exist "%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" goto no_vswhere
for /f "usebackq tokens=*" %%i in (`"%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" -latest -prerelease -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath`) do (
set InstallDir=%%i
)
if not exist "%InstallDir%\Common7\Tools\vsdevcmd.bat" goto no_vswhere
call "%InstallDir%\Common7\Tools\vsdevcmd.bat" %*
goto have_vc

:no_vswhere
rem This file builds and tests CCCC under Microsoft Visual Studio.
rem Path to Microsoft Visual Studio standard edition release 6.0
set VCDIR=c:\Program Files\Microsoft Visual Studio\vc98
if not exist "%VCDIR%\bin\vcvars32.bat" goto no_vc

call "%VCDIR%\bin\vcvars32.bat"
:have_vc
if not exist pccts\bin mkdir pccts\bin

cd pccts\dlg
if exist *.obj del *.obj
nmake -f DlgMS.mak
nmake -nologo -f DlgMS.mak
copy dlg.exe ..\bin
cd ..\..

cd pccts\antlr
if exist *.obj del *.obj
nmake -f AntlrMS.mak
nmake -nologo -f AntlrMS.mak
copy antlr.exe ..\bin
cd ..\..

cd cccc
if exist *.obj del *.obj
if exist *.cpp del *.cpp
nmake -f w32vc.mak
nmake -nologo -f w32vc.mak
cd ..

cd test
nmake -f w32vc.mak
nmake -nologo -f w32vc.mak
cd ..

rem vswhere is a vs2017+ thing, ancient vcaddin won't compile.
if exist "%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" goto end
cd vcaddin
nmake -f CcccDevStudioAddIn.mak CFG="CcccDevStudioAddIn - Win32 Release"
nmake -nologo -f CcccDevStudioAddIn.mak CFG="CcccDevStudioAddIn - Win32 Release"
cd ..


Expand All @@ -45,9 +58,5 @@ echo Please modify the script if the location is different.


:end






rem show "Press any key to continue" if build_w32vc.bat was run from exlorer
IF %0 == "%~0" pause
2 changes: 1 addition & 1 deletion cccc/w32vc.mak
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ LDFLAGS_DEBUG=-Zi
PATHSEP=\\
CCC=cl.exe -nologo
LD=cl.exe -nologo
CFLAGS=-c -I$(PCCTS_H) $(CFLAGS_DEBUG) -GX -TP -DCCCC_CONF_W32VC
CCC_OPTS=-c -I$(PCCTS_H) $(CFLAGS_DEBUG) -GX -TP -D_CRT_SECURE_NO_WARNINGS -DCCCC_CONF_W32VC
C_OFLAG=-Fo
LDFLAGS=$(LDFLAGS_DEBUG)
LD_OFLAG=-Fe
Expand Down
4 changes: 2 additions & 2 deletions pccts/antlr/AntlrMS.mak
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ SET=$(PCCTS_HOME)\support\set


# Compiler stuff
CC = cl
CC = cl -nologo
CFLAGS = -I "." -I "$(PCCTS_H)" -I "$(SET)" -D "USER_ZZSYN" -D "PC" \
-D "ZZLEXBUFSIZE=65536" /D "LONGFILENAMES" /W3
-D "ZZLEXBUFSIZE=65536" -D_CRT_SECURE_NO_WARNINGS /D "LONGFILENAMES" /W3

ANTLR_OBJS = antlr.obj scan.obj err.obj bits.obj build.obj fset2.obj \
fset.obj gen.obj globals.obj hash.obj lex.obj main.obj \
Expand Down
4 changes: 2 additions & 2 deletions pccts/dlg/DlgMS.mak
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ SET=$(PCCTS_HOME)\support\set


# Compiler stuff
CC = cl
CC = cl -nologo
CFLAGS = -I "." -I "$(PCCTS_H)" -I "$(SET)" -D "USER_ZZSYN" -D "PC" \
-D "ZZLEXBUFSIZE=65536" /D "LONGFILENAMES" /W3
-D "ZZLEXBUFSIZE=65536" -D_CRT_SECURE_NO_WARNINGS /D "LONGFILENAMES" /W3

DLG_OBJS = dlg_p.obj dlg_a.obj main.obj err.obj support.obj \
output.obj relabel.obj automata.obj
Expand Down