all: build

reset:
	powershell -executionpolicy bypass .\scripts\reset_build.ps1

patch:
	powershell "cp ./patches/process.h ./subprojects/libgit2-1.9.0/src/util/process.h"

%.cpp : %.rl
	ragel -o $@ $<

build: lel_parser.cpp
	meson compile -C builddir

config:
	powershell "cp tarpit_sample.json .tarpit.json"

test: build
	./builddir/runtests

# make an install for real maybe copy dll and .exe to dir and zip?
install: build
	powershell "cp ./builddir/subprojects/libgit2-1.9.0/liblibgit2package.dll ."
	powershell "cp ./builddir/subprojects/efsw/libefsw.dll ."
	powershell "cp builddir/ttpit.exe ."

run: install test
	./ttpit.exe

debug_run: build
	gdb --nx -x .gdbinit --batch --ex run --ex bt --ex q --args builddir/ttpit.exe

clean:
	meson compile --clean -C builddir