CXXFLAGS = -std=c++23 -O2 -ffast-math
LDLIBS = -lstdc++ -lm

Out.txt : main.exe main
	mono main.exe > Out.txt
	./main >> Out.txt

main.exe : main.cs hello.dll
	mcs -target:exe -reference:hello.dll -out:main.exe main.cs

hello.dll : hello.cs
	mcs -target:library -out:hello.dll hello.cs

main : main.o hello.o
	$(CXX) $(LDFLAGS) $^ -o main $(LDLIBS)

hello.o : hello.h hello.cc
	$(CXX) $(CXXFLAGS) $(CPPFLAGS) -c -o hello.o hello.cc

main.o : hello.h main.cc
	$(CXX) $(CXXFLAGS) $(CPPFLAGS) -c -o $@ main.cc

.PHONEY: clean
clean:
	$(RM) *.o *.dll *.exe main [Oo]ut.txt

test:
	@echo $(CXX)
