aboutsummaryrefslogtreecommitdiff
path: root/windows
diff options
context:
space:
mode:
Diffstat (limited to 'windows')
-rw-r--r--windows/Makefile36
-rw-r--r--windows/file.c2
-rw-r--r--windows/main.c5
-rw-r--r--windows/mpconfigport.h36
-rw-r--r--windows/qstrdefsport.h8
5 files changed, 87 insertions, 0 deletions
diff --git a/windows/Makefile b/windows/Makefile
new file mode 100644
index 000000000..a9a39a620
--- /dev/null
+++ b/windows/Makefile
@@ -0,0 +1,36 @@
+include ../py/mkenv.mk
+
+# define main target
+PROG = micropython.exe
+
+# qstr definitions (must come before including py.mk)
+QSTR_DEFS = qstrdefsport.h
+
+# include py core make definitions
+include ../py/py.mk
+
+# compiler settings
+CFLAGS = -I. -I$(PY_SRC) -Wall -Werror -ansi -std=gnu99 -DUNIX
+LDFLAGS = -lm
+
+# Debugging/Optimization
+ifdef DEBUG
+CFLAGS += -O0 -g
+else
+CFLAGS += -Os #-DNDEBUG
+endif
+
+# source files
+SRC_C = \
+ main.c \
+ file.c \
+
+OBJ = $(PY_O) $(addprefix $(BUILD)/, $(SRC_C:.c=.o))
+LIB = -lreadline
+LIB += -lws2_32
+LIB += -lmman
+# the following is needed for BSD
+#LIB += -ltermcap
+
+include ../py/mkrules.mk
+
diff --git a/windows/file.c b/windows/file.c
new file mode 100644
index 000000000..2651ffafb
--- /dev/null
+++ b/windows/file.c
@@ -0,0 +1,2 @@
+#include <stdio.h>
+#include "../unix/file.c" \ No newline at end of file
diff --git a/windows/main.c b/windows/main.c
new file mode 100644
index 000000000..64e34fa35
--- /dev/null
+++ b/windows/main.c
@@ -0,0 +1,5 @@
+#include "../unix/main.c"
+
+void rawsocket_init() {
+ // Do nothing here
+} \ No newline at end of file
diff --git a/windows/mpconfigport.h b/windows/mpconfigport.h
new file mode 100644
index 000000000..10abb8ce7
--- /dev/null
+++ b/windows/mpconfigport.h
@@ -0,0 +1,36 @@
+// options to control how Micro Python is built
+
+// Linking with GNU readline causes binary to be licensed under GPL
+#ifndef MICROPY_USE_READLINE
+#define MICROPY_USE_READLINE (1)
+#endif
+
+#define MICROPY_EMIT_X64 (1)
+#define MICROPY_EMIT_THUMB (0)
+#define MICROPY_EMIT_INLINE_THUMB (0)
+#define MICROPY_MEM_STATS (1)
+#define MICROPY_DEBUG_PRINTERS (1)
+#define MICROPY_ENABLE_REPL_HELPERS (1)
+#define MICROPY_ENABLE_LEXER_UNIX (1)
+#define MICROPY_ENABLE_FLOAT (1)
+#define MICROPY_LONGINT_IMPL (MICROPY_LONGINT_IMPL_LONGLONG)
+
+// type definitions for the specific machine
+
+#ifdef __LP64__
+typedef long machine_int_t; // must be pointer size
+typedef unsigned long machine_uint_t; // must be pointer size
+#else
+// These are definitions for machines where sizeof(int) == sizeof(void*),
+// regardless for actual size.
+typedef int machine_int_t; // must be pointer size
+typedef unsigned int machine_uint_t; // must be pointer size
+#endif
+
+#define BYTES_PER_WORD sizeof(machine_int_t)
+
+typedef void *machine_ptr_t; // must be of pointer size
+typedef const void *machine_const_ptr_t; // must be of pointer size
+typedef double machine_float_t;
+
+machine_float_t machine_sqrt(machine_float_t x);
diff --git a/windows/qstrdefsport.h b/windows/qstrdefsport.h
new file mode 100644
index 000000000..8a4c47f0b
--- /dev/null
+++ b/windows/qstrdefsport.h
@@ -0,0 +1,8 @@
+// qstrs specific to this port
+
+Q(sys)
+Q(argv)
+Q(open)
+Q(stdin)
+Q(stdout)
+Q(stderr) \ No newline at end of file