mirror of
https://github.com/libretro/RetroArch
synced 2024-12-29 12:31:05 +00:00
63 lines
1.3 KiB
Makefile
63 lines
1.3 KiB
Makefile
|
|
ifeq ($(platform),)
|
|
platform = unix
|
|
ifeq ($(shell uname -a),)
|
|
platform = win
|
|
else ifneq ($(findstring MINGW,$(shell uname -a)),)
|
|
platform = win
|
|
else ifneq ($(findstring Darwin,$(shell uname -a)),)
|
|
platform = osx
|
|
else ifneq ($(findstring win,$(shell uname -a)),)
|
|
platform = win
|
|
endif
|
|
endif
|
|
|
|
TARGET_NAME := test
|
|
|
|
ifeq ($(platform), unix)
|
|
TARGET := $(TARGET_NAME)_libretro.so
|
|
fpic := -fPIC
|
|
SHARED := -shared -Wl,--version-script=link.T -Wl,--no-undefined
|
|
else ifeq ($(platform), osx)
|
|
TARGET := $(TARGET_NAME)_libretro.dylib
|
|
fpic := -fPIC
|
|
SHARED := -dynamiclib
|
|
else ifeq ($(platform), qnx)
|
|
TARGET := $(TARGET_NAME)_libretro_qnx.so
|
|
fpic := -fPIC
|
|
SHARED := -shared -Wl,--version-script=link.T -Wl,--no-undefined
|
|
else
|
|
CC = gcc
|
|
TARGET := retro.dll
|
|
SHARED := -shared -static-libgcc -static-libstdc++ -s -Wl,--version-script=link.T -Wl,--no-undefined
|
|
endif
|
|
|
|
ifeq ($(DEBUG), 1)
|
|
CFLAGS += -O0 -g
|
|
else
|
|
CFLAGS += -O3
|
|
endif
|
|
|
|
OBJECTS := libretro-test.o
|
|
CFLAGS += -Wall -pedantic $(fpic)
|
|
|
|
ifeq ($(platform), qnx)
|
|
CFLAGS += -Wc,-std=gnu99
|
|
else
|
|
CFLAGS += -std=gnu99
|
|
endif
|
|
|
|
all: $(TARGET)
|
|
|
|
$(TARGET): $(OBJECTS)
|
|
$(CC) $(fpic) $(SHARED) $(INCLUDES) -o $@ $(OBJECTS) -lm
|
|
|
|
%.o: %.c
|
|
$(CC) $(CFLAGS) -c -o $@ $<
|
|
|
|
clean:
|
|
rm -f $(OBJECTS) $(TARGET)
|
|
|
|
.PHONY: clean
|
|
|