Skip to content

Commit 7ea0c74

Browse files
committed
examples/natmod/deepcraft: Refactor makefile to allow exec in windows.
Signed-off-by: NikhitaR-IFX <nikhita.rajasekhar@infineon.com>
1 parent 7087aee commit 7ea0c74

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

examples/natmod/deepcraft/Makefile

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,23 @@ ARCH = armv7emsp
1313
# Link with libm.a and libgcc.a from the toolchain
1414
LINK_RUNTIME = 1
1515

16+
# OS-specific settings
17+
ifeq ($(OS), Windows_NT)
18+
RM = del /Q /F
19+
CP = copy
20+
override MKDIR = cmd /C "if not exist $(1) mkdir $(1)"
21+
override PYTHON = python
22+
override ARCH_UPPER = $(shell powershell -Command "Write-Output '$(ARCH)'.ToUpper()")
23+
override MICROPY_FLOAT_IMPL_UPPER = $(shell powershell -Command "Write-Output '$(MICROPY_FLOAT_IMPL)'.ToUpper()")
24+
CLEAN_CMD = del /Q /F .mpy_ld_cache\* build\* $(MOD).mpy 2>nul
25+
endif
26+
27+
CFLAGS += -Wno-error=implicit-function-declaration
28+
1629
override LIBGCC_PATH := gcc/lib/gcc/arm-none-eabi/11.3.1/thumb/v7e-m+fp/hard/libgcc.a
1730
override LIBM_PATH := gcc/arm-none-eabi/lib/thumb/v7e-m+fp/hard/libm.a
1831

1932
include $(MPY_DIR)/py/dynruntime.mk
2033

21-
# Custom clean target
22-
clean:
23-
rm -rf .mpy_ld_cache/ build/ $(MOD).mpy
34+
$(BUILD_DIRS):
35+
$(Q)$(call MKDIR, $@)

0 commit comments

Comments
 (0)