fix building on OSX

requires latest bin2s from https://github.com/devkitPro/general-tools
This commit is contained in:
Dave Murphy 2018-03-03 17:33:14 +00:00 committed by plutoo
parent e93a484e86
commit 7d5617254a
2 changed files with 10 additions and 1 deletions

View File

@ -1,7 +1,14 @@
HOST_OS := $(shell uname -s)
ifeq ($(strip $(HOST_OS)),Darwin)
BIN2S_FLAGS := --apple-llvm
endif
# canned command sequence for binary data # canned command sequence for binary data
#--------------------------------------------------------------------------------- #---------------------------------------------------------------------------------
define bin2o define bin2o
bin2s $< | $(AS) -o $(@) bin2s $(BIN2S_FLAGS) $< | $(AS) -o $(@)
echo "extern const u8" `(echo $(<F) | sed -e 's/^\([0-9]\)/_\1/' | tr . _)`"_end[];" > `(echo $(<F) | tr . _)`.h echo "extern const u8" `(echo $(<F) | sed -e 's/^\([0-9]\)/_\1/' | tr . _)`"_end[];" > `(echo $(<F) | tr . _)`.h
echo "extern const u8" `(echo $(<F) | sed -e 's/^\([0-9]\)/_\1/' | tr . _)`"[];" >> `(echo $(<F) | tr . _)`.h echo "extern const u8" `(echo $(<F) | sed -e 's/^\([0-9]\)/_\1/' | tr . _)`"[];" >> `(echo $(<F) | tr . _)`.h
echo "extern const u32" `(echo $(<F) | sed -e 's/^\([0-9]\)/_\1/' | tr . _)`_size";" >> `(echo $(<F) | tr . _)`.h echo "extern const u32" `(echo $(<F) | sed -e 's/^\([0-9]\)/_\1/' | tr . _)`_size";" >> `(echo $(<F) | tr . _)`.h

View File

@ -10,7 +10,9 @@
#include <dirent.h> #include <dirent.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <unistd.h> #include <unistd.h>
#ifndef __APPLE__
#include <malloc.h> #include <malloc.h>
#endif
#include <math.h> #include <math.h>
#ifdef SWITCH #ifdef SWITCH
#include <switch.h> #include <switch.h>