2013-03-27 15:15:15 +00:00
|
|
|
|
|
|
|
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
|
|
|
|
|
2013-05-12 14:02:49 +00:00
|
|
|
TARGET_NAME = testgl
|
|
|
|
|
2013-03-27 15:15:15 +00:00
|
|
|
ifeq ($(platform), unix)
|
2013-05-12 14:02:49 +00:00
|
|
|
TARGET := $(TARGET_NAME)_libretro.so
|
2013-03-27 15:15:15 +00:00
|
|
|
fpic := -fPIC
|
|
|
|
SHARED := -shared -Wl,--version-script=link.T -Wl,--no-undefined
|
2013-03-28 11:46:40 +00:00
|
|
|
GL_LIB := -lGL
|
2013-03-27 15:15:15 +00:00
|
|
|
else ifeq ($(platform), osx)
|
2013-05-12 14:02:49 +00:00
|
|
|
TARGET := $(TARGET_NAME)_libretro.dylib
|
2013-03-27 15:15:15 +00:00
|
|
|
fpic := -fPIC
|
|
|
|
SHARED := -dynamiclib
|
2013-03-28 11:46:40 +00:00
|
|
|
GL_LIB := -framework OpenGL
|
2013-05-18 13:37:05 +00:00
|
|
|
else ifeq ($(platform), pi)
|
|
|
|
TARGET := $(TARGET_NAME)_libretro.so
|
|
|
|
fpic := -fPIC
|
|
|
|
SHARED := -shared -Wl,--version-script=link.T -Wl,--no-undefined
|
|
|
|
CFLAGS += -I/opt/vc/include -I/opt/vc/include/interface/vcos/pthreads -I/opt/vc/include/vmcs_host/linux
|
|
|
|
GLES := 1
|
|
|
|
LIBS += -L/opt/vc/lib
|
2013-05-12 14:02:49 +00:00
|
|
|
else ifeq ($(platform), ios)
|
|
|
|
TARGET := $(TARGET_NAME)_libretro_ios.dylib
|
|
|
|
fpic := -fPIC
|
|
|
|
SHARED := -dynamiclib
|
|
|
|
GL_LIB := -framework OpenGLES
|
2013-05-18 13:37:05 +00:00
|
|
|
DEFINES := -DIOS
|
|
|
|
CFLAGS += -DGLES $(DEFINES)
|
|
|
|
CC = clang -arch armv7 -isysroot $(IOSSDK)
|
2013-05-16 11:22:26 +00:00
|
|
|
else ifeq ($(platform), qnx)
|
|
|
|
TARGET := $(TARGET_NAME)_libretro_qnx.so
|
|
|
|
fpic := -fPIC
|
|
|
|
SHARED := -shared -Wl,--version-script=link.T
|
|
|
|
GL_LIB := -lGL
|
|
|
|
|
|
|
|
CC = qcc -Vgcc_ntoarmv7le
|
|
|
|
AR = qcc -Vgcc_ntoarmv7le
|
2014-05-20 00:48:11 +00:00
|
|
|
CFLAGS += -DGLES
|
2013-05-18 13:37:05 +00:00
|
|
|
GL_LIB := -lGLESv2
|
2013-07-14 11:37:37 +00:00
|
|
|
else ifneq (,$(findstring armv,$(platform)))
|
|
|
|
CC = gcc
|
|
|
|
TARGET := $(TARGET_NAME)_libretro.so
|
|
|
|
fpic := -fPIC
|
|
|
|
SHARED := -shared -Wl,--version-script=link.T -Wl,--no-undefined
|
|
|
|
CFLAGS += -I.
|
|
|
|
ifneq (,$(findstring gles,$(platform)))
|
|
|
|
GLES := 1
|
|
|
|
else
|
|
|
|
GL_LIB := -lGL
|
|
|
|
endif
|
|
|
|
ifneq (,$(findstring cortexa8,$(platform)))
|
|
|
|
CFLAGS += -marm -mcpu=cortex-a8
|
|
|
|
else ifneq (,$(findstring cortexa9,$(platform)))
|
|
|
|
CFLAGS += -marm -mcpu=cortex-a9
|
|
|
|
endif
|
|
|
|
CFLAGS += -marm
|
|
|
|
ifneq (,$(findstring neon,$(platform)))
|
|
|
|
CFLAGS += -mfpu=neon
|
|
|
|
HAVE_NEON = 1
|
|
|
|
endif
|
|
|
|
ifneq (,$(findstring softfloat,$(platform)))
|
|
|
|
CFLAGS += -mfloat-abi=softfp
|
|
|
|
else ifneq (,$(findstring hardfloat,$(platform)))
|
|
|
|
CFLAGS += -mfloat-abi=hard
|
|
|
|
endif
|
|
|
|
CFLAGS += -DARM
|
2013-03-27 15:15:15 +00:00
|
|
|
else
|
|
|
|
CC = gcc
|
2013-05-12 14:02:49 +00:00
|
|
|
TARGET := $(TARGET_NAME)_retro.dll
|
2013-03-27 15:15:15 +00:00
|
|
|
SHARED := -shared -static-libgcc -static-libstdc++ -s -Wl,--version-script=link.T -Wl,--no-undefined
|
2013-03-28 11:46:40 +00:00
|
|
|
GL_LIB := -lopengl32
|
2013-03-29 01:12:08 +00:00
|
|
|
CFLAGS += -I..
|
2013-03-27 15:15:15 +00:00
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(DEBUG), 1)
|
|
|
|
CFLAGS += -O0 -g
|
|
|
|
else
|
|
|
|
CFLAGS += -O3
|
|
|
|
endif
|
|
|
|
|
2013-05-16 11:25:27 +00:00
|
|
|
ifeq ($(platform), qnx)
|
2013-07-05 16:36:40 +00:00
|
|
|
CFLAGS += -Wc,-std=gnu99
|
2013-05-16 11:25:27 +00:00
|
|
|
else
|
2013-07-05 16:36:40 +00:00
|
|
|
CFLAGS += -std=gnu99
|
2013-05-16 11:25:27 +00:00
|
|
|
endif
|
|
|
|
|
2013-07-06 10:47:26 +00:00
|
|
|
OBJECTS := libretro-test.o ../gfx/glsym/rglgen.o
|
2013-05-16 11:25:27 +00:00
|
|
|
CFLAGS += -Wall -pedantic $(fpic)
|
2013-03-27 15:15:15 +00:00
|
|
|
|
2013-03-28 11:46:40 +00:00
|
|
|
ifeq ($(GLES), 1)
|
2013-07-05 16:36:40 +00:00
|
|
|
CFLAGS += -DGLES -DHAVE_OPENGLES2
|
2014-05-03 13:21:14 +00:00
|
|
|
ifeq ($(GLES31), 1)
|
|
|
|
CFLAGS += -DHAVE_OPENGLES3 -DGLES31 -DGLES3
|
|
|
|
else ifeq ($(GLES3), 1)
|
2013-12-13 13:19:25 +00:00
|
|
|
CFLAGS += -DHAVE_OPENGLES3 -DGLES3
|
|
|
|
endif
|
|
|
|
LIBS += -lGLESv2 # Still link against GLESv2 when using GLES3 API, at least on desktop Linux.
|
2013-07-06 10:47:26 +00:00
|
|
|
OBJECTS += ../gfx/glsym/glsym_es2.o
|
2013-03-28 11:46:40 +00:00
|
|
|
else
|
2013-07-06 10:47:26 +00:00
|
|
|
OBJECTS += ../gfx/glsym/glsym_gl.o
|
2013-03-28 11:46:40 +00:00
|
|
|
LIBS += $(GL_LIB)
|
|
|
|
endif
|
|
|
|
|
2013-06-23 09:55:21 +00:00
|
|
|
ifeq ($(CORE), 1)
|
|
|
|
CFLAGS += -DCORE
|
|
|
|
endif
|
|
|
|
|
2013-03-27 15:15:15 +00:00
|
|
|
all: $(TARGET)
|
|
|
|
|
|
|
|
$(TARGET): $(OBJECTS)
|
2014-06-05 12:30:45 +00:00
|
|
|
$(CC) $(fpic) $(SHARED) $(INCLUDES) -o $@ $(OBJECTS) $(LIBS) -lm $(EXTRA_GL_LIBS)
|
2013-03-27 15:15:15 +00:00
|
|
|
|
|
|
|
%.o: %.c
|
|
|
|
$(CC) $(CFLAGS) -c -o $@ $<
|
|
|
|
|
|
|
|
clean:
|
|
|
|
rm -f $(OBJECTS) $(TARGET)
|
|
|
|
|
|
|
|
.PHONY: clean
|
|
|
|
|