summaryrefslogtreecommitdiff
path: root/bootstrap.bat
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2025-04-02 21:54:55 +0200
committerBent Bisballe Nyeng <deva@aasimon.org>2025-04-03 08:31:44 +0200
commitca7b8d7e94e0bef7e56072f02c871bf385f21784 (patch)
tree2bf16180ecc21a304eaf48afb124ca46da7c679c /bootstrap.bat
parentcd6c3ea1c3ca853fc38da4fa5fd62545c31aa92d (diff)
WIP
Diffstat (limited to 'bootstrap.bat')
-rw-r--r--bootstrap.bat25
1 files changed, 25 insertions, 0 deletions
diff --git a/bootstrap.bat b/bootstrap.bat
new file mode 100644
index 0000000..3802663
--- /dev/null
+++ b/bootstrap.bat
@@ -0,0 +1,25 @@
+@echo off
+
+set CXX=cl.exe
+set CC=cl.exe
+set AR=lib.exe
+set LD=link.exe
+
+echo Bootstrapping...
+%CXX% /nologo /MT /std:c++20 /D_X86_ /EHsc /Isrc /Fo:build\ ctor.cc src\bootstrap.cc /link /out:ctor.exe
+@if %errorlevel% neq 0 exit /b %errorlevel%
+
+ctor.exe
+@if %errorlevel% neq 0 exit /b %errorlevel%
+
+%CXX% /nologo /std:c++20 /D_X86_ /EHsc /Isrc /Fo:build\ ctor.cc /c
+@if %errorlevel% neq 0 exit /b %errorlevel%
+%CXX% /nologo /std:c++20 /D_X86_ /EHsc /Isrc /Fo:build\test\ test\ctor.cc /c
+@if %errorlevel% neq 0 exit /b %errorlevel%
+%LD% /nologo build\libctor.lib build\ctor.obj build\test\ctor.obj /subsystem:console /out:ctor.exe
+@if %errorlevel% neq 0 exit /b %errorlevel%
+
+ctor.exe configure --ctor-includedir=src --ctor-libdir=build
+@if %errorlevel% neq 0 exit /b %errorlevel%
+
+@echo Done. Now run ctor.exe to (re)build.