SDKDIR=$(HOME)/.dotnet/sdk/6.0.102# or whatever your sdk is
CSCPATH=$(SDKDIR)/Roslyn/bincore/csc.dll
NETSTANDARD=$(SDKDIR)/ref/netstandard.dll
CONFIG=$(SDKDIR)/vstest.console.runtimeconfig.json
DOTNET=DOTNET_CLI_TELEMETRY_OPTOUT=1; dotnet
CSC=$(DOTNET) $(CSCPATH) -reference:$(NETSTANDARD)
RUN=$(DOTNET) exec --runtimeconfig $(CONFIG)
CSC = mcs
RUN = mono

all:Out.txt Out_for.txt

Out_for.txt: apfor.exe pfor.exe afor.exe Makefile
	cat /dev/null > $@
	/bin/time --portability --output $@ --append $(RUN) apfor.exe 2e6 >> $@
	/bin/time --portability --output $@ --append $(RUN) afor.exe 2e6 >> $@

Out.txt: t2.exe t1.exe pfor.exe Makefile
	cat /dev/null > $@
	/bin/time -p -a -o $@ $(RUN) t1.exe   5e7 >> $@
	/bin/time -p -a -o $@ $(RUN) t2.exe   5e7 >> $@
	/bin/time -p -a -o $@ $(RUN) pfor.exe 5e7 >> $@

apfor.exe: apfor.cs
	$(CSC) -target:exe -out:$@ $<

pfor.exe: pfor.cs
	$(CSC) -target:exe -out:$@ $<

afor.exe: afor.cs
	$(CSC) -target:exe -out:$@ $<

t2.exe: t2.cs
	$(CSC) -target:exe -out:$@ $<

t1.exe: t1.cs
	$(CSC) -target:exe -out:$@ $<

clean:
	$(RM) *.dll *.exe [Oo]ut* [Ll]og*
