The following changes to PlaydateSDK/C_API/buildsupport/common.mk kind of work, but different x86_64 and arm .s files need to be supplied to make pdc
and make device
, respectively.
$ diff PlaydateSDK/C_API/buildsupport/common.mk CustomPlaydateSDK/C_API/buildsupport/common.mk
59c59
< __OBJS = $(SRC:.c=.o)
---
> __OBJS = $(SRC:.c=.o) $(ASRC:.s=.o)
144c144
< clang $(DYLIB_FLAGS) -lm $(CLANGFLAGS) -DTARGET_SIMULATOR=1 -DTARGET_EXTENSION=1 $(INCDIR) -o $(OBJDIR)/pdex.${DYLIB_EXT} $(SRC)
---
> clang $(DYLIB_FLAGS) -lm $(CLANGFLAGS) -DTARGET_SIMULATOR=1 -DTARGET_EXTENSION=1 $(INCDIR) -o $(OBJDIR)/pdex.${DYLIB_EXT} $(SRC) $(ASRC)
152a153,154
Part of the makefile follows. Basically, switching is being done manually and there is no hardware to test on at this point.
ASMTest/Makefile
# List C source files here
SRC = src/main.c
#SRC = src/main.c src/dummy_sqrt.c
# List ASM source files here
#ASRC = src/fast_sqrt_x86_64.s
ASRC = src/fast_sqrt_arm.s
Having said that, the x86_64 ASM appears to be working properly in the simulator.
// modified Hello World example message
pd->system->formatString(&message, "d=%.3f", fast_sqrt(x*x+y*y));