shithub: MicroHs

Download patch

ref: 64d12f8de6fe4fd8bacda105844a82e8c485cd4a
parent: d86f4ae08fd96bade8c7a333356cec60a16b04bf
author: Lennart Augustsson <lennart.augustsson@epicgames.com>
date: Sun Nov 26 06:24:35 EST 2023

Add target for running examples.

--- a/Makefile
+++ b/Makefile
@@ -18,7 +18,7 @@
 GHCPROF= # -prof -fprof-late #-prof -fprof-auto
 GHCFLAGS= $(GHCEXTS) $(GHCINCS) $(GHCWARNS) $(GHCOPTS) $(GHCTOOL) $(GHCPKGS) $(GHCOUT) $(GHCPROF)
 #
-.PHONY:	clean bootstrap install ghcgen newmhs cacheprelude timecompile
+.PHONY:	clean bootstrap install ghcgen newmhs cacheprelude timecompile exampletest
 
 all:	bin/mhs
 
@@ -105,9 +105,14 @@
 	@echo "*** Set environment variable MHSDIR to $(PREFIX)/lib/mhs"
 	@echo "***"
 
-everytest:	runtest bootcombtest
+everytest:	runtest bootcombtest exampletest
 
 bootcombtest:	bin/gmhs bin/mhseval
 	bin/gmhs -ilib -isrc -ogmhs.comb  MicroHs.Main
 	bin/mhseval +RTS -v -rgmhs.comb -RTS -ilib -isrc -omhs.comb MicroHs.Main
 	cmp gmhs.comb mhs.comb
+
+exampletest:	bin/mhs bin/mhseval Example.hs
+	bin/mhs -r Example
+	bin/mhs Example && bin/mhseval
+	bin/mhs Example -oEx && ./Ex && rm Ex
--