Skip to content

Commit 64a909e

Browse files
pohmeliedpgeorge
authored andcommitted
unix: Add FreeDos target
1 parent a152836 commit 64a909e

2 files changed

Lines changed: 50 additions & 0 deletions

File tree

unix/Makefile

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,8 @@ ifeq ($(PROG),micropython)
126126
SRC_C += $(BUILD)/_frozen_upip.c
127127
else ifeq ($(PROG),micropython_coverage)
128128
SRC_C += $(BUILD)/_frozen_upip.c
129+
else ifeq ($(PROG), micropython_freedos)
130+
SRC_C += $(BUILD)/_frozen_upip.c
129131
endif
130132

131133
LIB_SRC_C = $(addprefix lib/,\
@@ -169,6 +171,16 @@ fast:
169171
minimal:
170172
$(MAKE) COPT="-Os -DNDEBUG" CFLAGS_EXTRA='-DMP_CONFIGFILE="<mpconfigport_minimal.h>"' BUILD=build-minimal PROG=micropython_minimal MICROPY_PY_TIME=0 MICROPY_PY_TERMIOS=0 MICROPY_PY_SOCKET=0 MICROPY_PY_FFI=0 MICROPY_USE_READLINE=0
171173

174+
freedos:
175+
$(MAKE) \
176+
CC=i586-pc-msdosdjgpp-gcc \
177+
CFLAGS_EXTRA='-DMP_CONFIGFILE="<mpconfigport_freedos.h>" -DMICROPY_NLR_SETJMP -Dtgamma=gamma -DMICROPY_EMIT_X86=0 -DMICROPY_NO_ALLOCA=1 -DMICROPY_PY_USELECT=0' \
178+
BUILD=build-freedos \
179+
PROG=micropython_freedos \
180+
MICROPY_PY_SOCKET=0 \
181+
MICROPY_PY_FFI=0 \
182+
MICROPY_PY_JNI=0
183+
172184
# build an interpreter for coverage testing and do the testing
173185
coverage:
174186
$(MAKE) COPT="-O0" CFLAGS_EXTRA='-fprofile-arcs -ftest-coverage -Wdouble-promotion -Wformat -Wmissing-declarations -Wmissing-prototypes -Wold-style-definition -Wpointer-arith -Wshadow -Wsign-compare -Wuninitialized -Wunused-parameter -DMICROPY_UNIX_COVERAGE' LDFLAGS_EXTRA='-fprofile-arcs -ftest-coverage' BUILD=build-coverage PROG=micropython_coverage

unix/mpconfigport_freedos.h

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
/*
2+
* This file is part of the MicroPython project, http://micropython.org/
3+
*
4+
* The MIT License (MIT)
5+
*
6+
* Copyright (c) 2015 Damien P. George
7+
*
8+
* Permission is hereby granted, free of charge, to any person obtaining a copy
9+
* of this software and associated documentation files (the "Software"), to deal
10+
* in the Software without restriction, including without limitation the rights
11+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12+
* copies of the Software, and to permit persons to whom the Software is
13+
* furnished to do so, subject to the following conditions:
14+
*
15+
* The above copyright notice and this permission notice shall be included in
16+
* all copies or substantial portions of the Software.
17+
*
18+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24+
* THE SOFTWARE.
25+
*/
26+
27+
// options to control how MicroPython is built
28+
29+
#include <mpconfigport.h>
30+
31+
#undef MICROPY_STREAMS_NON_BLOCK
32+
#define MICROPY_STREAMS_NON_BLOCK (0)
33+
34+
#undef MICROPY_PY_SYS_PLATFORM
35+
#define MICROPY_PY_SYS_PLATFORM "freedos"
36+
37+
// djgpp dirent struct does not have d_ino field
38+
#define _DIRENT_HAVE_D_INO (0)

0 commit comments

Comments
 (0)