shithub: MicroHs

Download patch

ref: fe0aaa9d60284e366f09b362e4a5532a9d3bef88
parent: 4d0fc223dd82c1ca73d65c58e4c6a80c48ba595b
author: Lennart Augustsson <lennart@augustsson.net>
date: Thu Sep 5 07:01:31 EDT 2024

Cleanup

--- a/.gitignore
+++ b/.gitignore
@@ -21,3 +21,5 @@
 *.pkg
 targets.conf
 *.bak
+timing
+mdist/*
--- a/Makefile
+++ b/Makefile
@@ -140,7 +140,7 @@
 
 #
 clean:
-	rm -rf src/*/*.hi src/*/*.o *.comb *.tmp *~ bin/* a.out $(GHCOUTDIR) tmp/* Tools/*.o Tools/*.hi dist-newstyle generated/*-stage* .mhscache targets.conf .mhscache dist-mcabal cpphssrc Interactive.hs .mhsi
+	rm -rf src/*/*.hi src/*/*.o *.comb *.tmp *~ bin/* a.out $(GHCOUTDIR) Tools/*.o Tools/*.hi dist-newstyle generated/*-stage* .mhscache targets.conf .mhscache dist-mcabal cpphssrc Interactive.hs .mhsi
 	make clean -f Makefile.emscripten
 	cd tests; make clean
 	-cabal clean
--- /dev/null
+++ b/src/runtime/config-esp32.h
@@ -1,0 +1,89 @@
+/*
+ * Various platform specific configuration.
+ */
+
+/*
+ * Include stdio functions.
+ * Without this none of the file I/O in System.IO is available.
+ */
+#define WANT_STDIO 0
+
+/*
+ * Include ops for floating point arithmetic.
+ * Without this +,-,* etc will not be available for the Double type.
+ */
+#define WANT_FLOAT 1
+
+/*
+ * Include <math.h>
+ * Without this, exp,sin, etc are not available.
+ */
+#define WANT_MATH 0
+
+/*
+ * Include MD5 checksumming code
+ */
+#define WANT_MD5 0
+
+/*
+ * Include profiling code
+ */
+#define WANT_TICK 0
+
+/*
+ * Process argc, argv
+ */
+#define WANT_ARGS 0
+
+/*
+ * Number of bits in a word.  Only 32 and 64 are supported.
+ */
+//#define WORD_SIZE 32
+
+/*
+ * Find First Set
+ * This macro must be defined.
+ * It return the number of the least significant bit that is set.
+ * Numberings starts from 1.  If no bit is set, it should return 0.
+ */
+// #define FFS
+
+/*
+ * This is the character used for comma-separation in printf.
+ * Defaults to "'".
+ */
+/* #define PCOMMA "'" */
+
+
+/*
+ * Get a raw input character.
+ * If undefined, the default always returns -1
+ */
+/* #define GETRAW */
+
+
+/*
+ * Get time since some epoch in milliseconds.
+ */
+/* #define GETTIMEMILLI */
+
+
+/*
+ * The ERR macro should report an error and exit.
+ * If not defined, a generic one will be used.
+ */
+/* #define ERR(s) */
+/* #define ERR1(s,a) */
+
+#define GCRED    0              /* do some reductions during GC */
+#define FASTTAGS 1              /* compute tag by pointer subtraction */
+#define INTTABLE 1              /* use fixed table of small INT nodes */
+#define SANITY   1              /* do some sanity checks */
+#define STACKOVL 1              /* check for stack overflow */
+
+#define HEAP_CELLS 4000
+#define STACK_SIZE 500
+
+#define MAIN void app_main(void)
+
+#define INITIALIZATION
--- /dev/null
+++ b/src/runtime/eval-esp32.c
@@ -1,0 +1,6 @@
+/* Copyright 2023 Lennart Augustsson
+ * See LICENSE file for full license.
+ */
+#include "config-esp32.h"
+
+#include "eval.c"
--