Skip to content

Commit

Permalink
Windows build updates for xsHosts migration
Browse files Browse the repository at this point in the history
  • Loading branch information
andycarle committed Jan 6, 2022
1 parent ad4745d commit 5a4647b
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
11 changes: 9 additions & 2 deletions tools/mcconfig/nmake.esp.mk
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ XS_DIRS = \
-I$(XS_DIR)\sources \
-I$(XS_DIR)\sources\pcre \
-I$(XS_DIR)\platforms\esp \
-I$(XS_DIR)\platforms\mc \
-I$(BUILD_DIR)\devices\esp
XS_HEADERS = \
$(XS_DIR)\includes\xs.h \
Expand All @@ -153,6 +154,7 @@ XS_HEADERS = \
$(XS_DIR)\sources\xsAll.h \
$(XS_DIR)\sources\xsCommon.h \
$(XS_DIR)\platforms\esp\xsHost.h \
$(XS_DIR)\platforms\mc\xsHosts.h \
$(XS_DIR)\platforms\esp\xsPlatform.h
SDK_SRC = \
$(CORE_DIR)\abi.cpp \
Expand Down Expand Up @@ -381,9 +383,9 @@ delAr:
@del $(APP_ARCHIVE)
@del $(LIB_ARCHIVE)

$(APP_ARCHIVE): $(TMP_DIR)\mc.xs.o $(TMP_DIR)\mc.resources.o $(OBJECTS) $(TMP_DIR)\xsHost.o $(TMP_DIR)\xsPlatform.o $(TMP_DIR)\main.o
$(APP_ARCHIVE): $(TMP_DIR)\mc.xs.o $(TMP_DIR)\mc.resources.o $(OBJECTS) $(TMP_DIR)\xsHost.o $(TMP_DIR)\xsHosts.o $(TMP_DIR)\xsPlatform.o $(TMP_DIR)\main.o
@echo # archive $(APP_ARCHIVE)
$(AR) $(AR_OPTIONS) $@ $(TMP_DIR)\mc.xs.o $(TMP_DIR)\xsHost.o $(TMP_DIR)\xsPlatform.o $(TMP_DIR)\mc.resources.o $(TMP_DIR)\main.o
$(AR) $(AR_OPTIONS) $@ $(TMP_DIR)\mc.xs.o $(TMP_DIR)\xsHost.o $(TMP_DIR)\xsHosts.o $(TMP_DIR)\xsPlatform.o $(TMP_DIR)\mc.resources.o $(TMP_DIR)\main.o

$(LIB_ARCHIVE): $(XS_OBJ) $(SDK_OBJ)
@echo # archive $(LIB_ARCHIVE)
Expand Down Expand Up @@ -475,6 +477,11 @@ $(TMP_DIR)\xsHost.o: $(XS_DIR)\platforms\esp\xsHost.c
$(CC) $? $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -mforce-l32 -o $@.unmapped
$(TOOLS_BIN)\xtensa-lx106-elf-objcopy --rename-section .data=.irom0.str.1 --rename-section .rodata=.irom0.str.1 --rename-section .rodata.str1.1=.irom0.str.1 $@.unmapped $@

$(TMP_DIR)\xsHosts.o: $(XS_DIR)\platforms\mc\xsHosts.c
@echo # cc $(@F)
$(CC) $? $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -mforce-l32 -o $@.unmapped
$(TOOLS_BIN)\xtensa-lx106-elf-objcopy --rename-section .data=.irom0.str.1 --rename-section .rodata=.irom0.str.1 --rename-section .rodata.str1.1=.irom0.str.1 $@.unmapped $@

$(TMP_DIR)\xsPlatform.o: $(XS_DIR)\platforms\esp\xsPlatform.c
@echo # cc $(@F)
$(CC) $? $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -mforce-l32 -o $@.unmapped
Expand Down
9 changes: 8 additions & 1 deletion tools/mcconfig/nmake.esp32.mk
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2016-2021 Moddable Tech, Inc.
# Copyright (c) 2016-2022 Moddable Tech, Inc.
#
# This file is part of the Moddable SDK Tools.
#
Expand Down Expand Up @@ -171,6 +171,7 @@ INC_DIRS = \

XS_OBJ = \
$(LIB_DIR)\xsHost.o \
$(LIB_DIR)\xsHosts.o \
$(LIB_DIR)\xsPlatform.o \
$(LIB_DIR)\xsAll.o \
$(LIB_DIR)\xsAPI.o \
Expand Down Expand Up @@ -229,6 +230,7 @@ XS_DIRS = \
-I$(XS_DIR)\includes \
-I$(XS_DIR)\sources \
-I$(XS_DIR)\platforms\esp \
-I$(XS_DIR)\platforms\mc \
-I$(SDKCONFIG_H_DIR) \
-I$(PLATFORM_DIR)\lib\pow

Expand All @@ -238,6 +240,7 @@ XS_HEADERS = \
$(XS_DIR)\sources\xsAll.h \
$(XS_DIR)\sources\xsCommon.h \
$(XS_DIR)\platforms\esp\xsHost.h \
$(XS_DIR)\platforms\mc\xsHosts.h \
$(XS_DIR)\platforms\esp\xsPlatform.h

!IF "$(SDKCONFIGPATH)"==""
Expand Down Expand Up @@ -530,6 +533,10 @@ $(XS_OBJ): $(XS_HEADERS)
@echo # cc $(@F) (strings in flash)
$(CC) $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) $< -o $@

{$(XS_DIR)\platforms\mc\}.c{$(LIB_DIR)\}.o:
@echo # cc $(@F) (strings in flash)
$(CC) $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) $< -o $@

{$(PLATFORM_DIR)\lib\pow\}.c{$(LIB_DIR)\}.o:
@echo # cc $(@F) (strings in flash)
$(CC) $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) $< -o $@
Expand Down

0 comments on commit 5a4647b

Please sign in to comment.