From 40f12007aa1517b22ee60e8e8c62c3b3bbb6b50f Mon Sep 17 00:00:00 2001 From: twinaphex Date: Tue, 3 Mar 2015 09:38:27 +0100 Subject: [PATCH] (Libretro test) Add linux-portable target --- libretro-test/Makefile | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/libretro-test/Makefile b/libretro-test/Makefile index 24b4413111..770877792e 100644 --- a/libretro-test/Makefile +++ b/libretro-test/Makefile @@ -17,11 +17,18 @@ endif endif TARGET_NAME := test +LIBM = -lm ifeq ($(platform), unix) TARGET := $(TARGET_NAME)_libretro.so fpic := -fPIC SHARED := -shared -Wl,--version-script=link.T -Wl,--no-undefined +else ifeq ($(platform), linux-portable) + TARGET := $(TARGET_NAME)_libretro.so + fpic := -fPIC -nostdlib + SHARED := -shared -Wl,--version-script=link.T -Wl,--no-undefined + LIBM := + LDFLAGS += -L. -lmusl else ifeq ($(platform), osx) TARGET := $(TARGET_NAME)_libretro.dylib fpic := -fPIC @@ -46,6 +53,8 @@ else SHARED := -shared -static-libgcc -static-libstdc++ -s -Wl,--version-script=link.T -Wl,--no-undefined endif +LDFLAGS += $(LIBM) + ifeq ($(DEBUG), 1) CFLAGS += -O0 -g else @@ -64,7 +73,7 @@ endif all: $(TARGET) $(TARGET): $(OBJECTS) - $(CC) $(fpic) $(SHARED) $(INCLUDES) -o $@ $(OBJECTS) -lm + $(CC) $(fpic) $(SHARED) $(INCLUDES) -o $@ $(OBJECTS) $(LDFLAGS) %.o: %.c $(CC) $(CFLAGS) -c -o $@ $<