74 lines · 1.8 KB · Text
RawDownload
@echo offsetlocalset CC=gccset TESTS=if "%1"=="/?" goto :usagegoto :p0 :usageecho usage: test-win32.bat [options...] [tests...]echo options:echo   -c compiler  reference compiler (gcc or clang)echo   -p path      prepend path to PATHecho tests          tests to run (default all)echo requires:      make, gcc/clang, and sh in the PATHexit /B 1 :p2shift:p1shift:p0if "%1"=="-c" set CC=%2&&goto p2if "%1"=="-p" set PATH=%2;%PATH%&&goto p2if not "%1"=="" set TESTS=%TESTS% %1&&goto p1if "%TESTS%"=="" set TESTS=all -k set PATH=%CD%\..\win32;%PATH% for /f "delims=-" %%a in ('tcc.exe -dumpmachine') do set ARCH=%%aset ARCH=%ARCH:aarch=arm%set MACH=%ARCH:i386=x86%set MACH=%MACH:x86_64=amd64%rem echo ARCH:%ARCH%  MACHINE:%MACH% set CRTLIB=c:/windows/system32/msvcrt.dllset LIBTCC=libtcc.dllset LGCC=-lgccif %CC%==gcc goto :c2 set CRTLIB=msvcrt.libset LIBTCC=libtcc.libset LGCC=if exist %CRTLIB% goto :c3tcc -impdef msvcrt.dlllib >nul /def:msvcrt.def /out:%CRTLIB% /machine:%MACH%:c2if not exist %CRTLIB% echo test-win32.bat: error: %CRTLIB% not found&&exit /b 1:c3 set REF_LINK=-nostdlib msvcrt_start.c %LGCC% -lkernel32 %CRTLIB%set CFG_MAK=..\config.makset CFG_H=..\config.h echo>>%CFG_H% #define CC_NAME CC_%CC%echo>>%CFG_H% #define GCC_MAJOR 15 if exist %CFG_MAK% del %CFG_MAK%echo>>%CFG_MAK% CC = %CC%.exeecho>>%CFG_MAK% CC_NAME = %CC%echo>>%CFG_MAK% ARCH = %ARCH%echo>>%CFG_MAK% CFLAGS = -Wall -O0echo>>%CFG_MAK% LDFLAGS =echo>>%CFG_MAK% LIBSUF = .libecho>>%CFG_MAK% prefix = $(TOP)/binecho>>%CFG_MAK% EXESUF = .exeecho>>%CFG_MAK% DLLSUF = .dllecho>>%CFG_MAK% TARGETOS = WIN32echo>>%CFG_MAK% CONFIG_WIN32 = yesecho>>%CFG_MAK% TOPSRC = $(TOP)echo>>%CFG_MAK% SHELL = shecho>>%CFG_MAK% test.ref: CFLAGS += %REF_LINK% set GMAKE=make%GMAKE% TCC_LOCAL=tcc.exe LIBTCC=win32/%LIBTCC% %TESTS%

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t