From dd5ebd974e8ac9fa9bbc6f7387b083788ab2568e Mon Sep 17 00:00:00 2001 From: twinaphex Date: Sun, 14 Sep 2014 03:44:54 +0200 Subject: [PATCH] Update Makefile.common --- Makefile | 73 ------------------------------------------ Makefile.common | 78 +++++++++++++++++++++++++++++++++++++++++++++ Makefile.emscripten | 8 ++--- Makefile.win | 6 ---- 4 files changed, 80 insertions(+), 85 deletions(-) diff --git a/Makefile b/Makefile index c221973925..d7dddb2579 100644 --- a/Makefile +++ b/Makefile @@ -41,79 +41,6 @@ ifeq ($(REENTRANT_TEST), 1) OBJ += console/test.o endif -ifeq ($(HAVE_OPENGL), 1) - OBJ += gfx/gl.o \ - gfx/gfx_context.o \ - gfx/fonts/gl_font.o \ - gfx/fonts/gl_raster_font.o \ - gfx/math/matrix.o \ - gfx/state_tracker.o \ - gfx/glsym/rglgen.o - - ifeq ($(HAVE_KMS), 1) - OBJ += gfx/context/drm_egl_ctx.o - DEFINES += $(GBM_CFLAGS) $(DRM_CFLAGS) $(EGL_CFLAGS) - LIBS += $(GBM_LIBS) $(DRM_LIBS) $(EGL_LIBS) - endif - - ifeq ($(HAVE_VIDEOCORE), 1) - OBJ += gfx/context/vc_egl_ctx.o - DEFINES += $(EGL_CFLAGS) - LIBS += $(EGL_LIBS) - endif - - ifeq ($(HAVE_MALI_FBDEV), 1) - OBJ += gfx/context/mali_fbdev_ctx.o - endif - - ifeq ($(HAVE_VIVANTE_FBDEV), 1) - OBJ += gfx/context/vivante_fbdev_ctx.o - DEFINES += $(EGL_CFLAGS) - LIBS += $(EGL_LIBS) - endif - - ifeq ($(HAVE_X11), 1) - ifeq ($(HAVE_GLES), 0) - OBJ += gfx/context/glx_ctx.o - endif - ifeq ($(HAVE_EGL), 1) - OBJ += gfx/context/xegl_ctx.o - DEFINES += $(EGL_CFLAGS) - LIBS += $(EGL_LIBS) - endif - endif - - ifeq ($(HAVE_WAYLAND), 1) - ifeq ($(HAVE_EGL), 1) - OBJ += gfx/context/wayland_ctx.o - endif - endif - - ifeq ($(HAVE_GLES), 1) - LIBS += $(GLES_LIBS) - DEFINES += $(GLES_CFLAGS) -DHAVE_OPENGLES -DHAVE_OPENGLES2 - ifeq ($(HAVE_GLES3), 1) - DEFINES += -DHAVE_OPENGLES3 - endif - OBJ += gfx/glsym/glsym_es2.o - else - DEFINES += -DHAVE_GL_SYNC - OBJ += gfx/glsym/glsym_gl.o - ifeq ($(OSX), 1) - LIBS += -framework OpenGL - else ifneq ($(findstring Win32,$(OS)),) - LIBS += -lopengl32 -lgdi32 -lcomdlg32 - OBJ += gfx/context/wgl_ctx.o \ - gfx/context/win32_common.o - else - LIBS += -lGL - endif - endif - - OBJ += gfx/shader_glsl.o - DEFINES += -DHAVE_GLSL -endif - ifeq ($(HAVE_DYLIB), 1) LIBS += $(DYLIB_LIB) endif diff --git a/Makefile.common b/Makefile.common index 46be8edf08..8a9d3ee476 100644 --- a/Makefile.common +++ b/Makefile.common @@ -299,6 +299,84 @@ endif # Video +# +ifeq ($(HAVE_OPENGL), 1) + DEFINES += -DHAVE_OPENGL -DHAVE_GLSL -DHAVE_GL_SYNC + OBJ += gfx/gl.o \ + gfx/gfx_context.o \ + gfx/fonts/gl_font.o \ + gfx/fonts/gl_raster_font.o \ + gfx/math/matrix.o \ + gfx/state_tracker.o \ + gfx/glsym/rglgen.o + + ifeq ($(HAVE_KMS), 1) + OBJ += gfx/context/drm_egl_ctx.o + DEFINES += $(GBM_CFLAGS) $(DRM_CFLAGS) $(EGL_CFLAGS) + LIBS += $(GBM_LIBS) $(DRM_LIBS) $(EGL_LIBS) + endif + + ifeq ($(HAVE_VIDEOCORE), 1) + OBJ += gfx/context/vc_egl_ctx.o + DEFINES += $(EGL_CFLAGS) + LIBS += $(EGL_LIBS) + endif + + ifeq ($(HAVE_EMSCRIPTEN), 1) + OBJ += gfx/context/emscriptenegl_ctx.o + endif + + ifeq ($(HAVE_MALI_FBDEV), 1) + OBJ += gfx/context/mali_fbdev_ctx.o + endif + + ifeq ($(HAVE_VIVANTE_FBDEV), 1) + OBJ += gfx/context/vivante_fbdev_ctx.o + DEFINES += $(EGL_CFLAGS) + LIBS += $(EGL_LIBS) + endif + + ifeq ($(HAVE_X11), 1) + ifeq ($(HAVE_GLES), 0) + OBJ += gfx/context/glx_ctx.o + endif + ifeq ($(HAVE_EGL), 1) + OBJ += gfx/context/xegl_ctx.o + DEFINES += $(EGL_CFLAGS) + LIBS += $(EGL_LIBS) + endif + endif + + ifeq ($(HAVE_WAYLAND), 1) + ifeq ($(HAVE_EGL), 1) + OBJ += gfx/context/wayland_ctx.o + endif + endif + + ifeq ($(HAVE_GLES), 1) + LIBS += $(GLES_LIBS) + DEFINES += $(GLES_CFLAGS) -DHAVE_OPENGLES -DHAVE_OPENGLES2 + ifeq ($(HAVE_GLES3), 1) + DEFINES += -DHAVE_OPENGLES3 + endif + OBJ += gfx/glsym/glsym_es2.o + else + DEFINES += -DHAVE_GL_SYNC + OBJ += gfx/glsym/glsym_gl.o + ifeq ($(OSX), 1) + LIBS += -framework OpenGL + else ifneq ($(findstring Win32,$(OS)),) + LIBS += -lopengl32 -lgdi32 -lcomdlg32 + OBJ += gfx/context/wgl_ctx.o \ + gfx/context/win32_common.o + else + LIBS += -lGL + endif + endif + + OBJ += gfx/shader_glsl.o + DEFINES += -DHAVE_GLSL +endif ifeq ($(HAVE_SDL), 1) OBJ += gfx/sdl_gfx.o input/sdl_input.o input/sdl_joypad.o audio/sdl_audio.o diff --git a/Makefile.emscripten b/Makefile.emscripten index 707b4a28d8..e37770e68e 100644 --- a/Makefile.emscripten +++ b/Makefile.emscripten @@ -2,7 +2,8 @@ TARGET = retroarch.js OS = Emscripten OBJ := -DEFINES := -DRARCH_INTERNAL -DHAVE_CC_RESAMPLER +DEFINES := -DRARCH_INTERNAL -DHAVE_CC_RESAMPLER -DHAVE_OVERLAY +DEFINES += -DHAVE_OPENGL -DHAVE_OPENGLES -DHAVE_OPENGLES2 -DHAVE_EGL -DHAVE_OVERLAY -DHAVE_GLSL HAVE_OPENGL = 1 HAVE_EMSCRIPTEN = 1 @@ -32,11 +33,6 @@ OBJ += frontend/platform/platform_emscripten.o \ libretro = libretro_emscripten.bc -ifeq ($(HAVE_OPENGL), 1) - OBJ += gfx/gl.o gfx/math/matrix.o gfx/fonts/gl_font.o gfx/fonts/gl_raster_font.o gfx/gfx_context.o gfx/context/emscriptenegl_ctx.o gfx/shader_glsl.o gfx/glsym/rglgen.o gfx/glsym/glsym_es2.o - DEFINES += -DHAVE_OPENGL -DHAVE_OPENGLES -DHAVE_OPENGLES2 -DHAVE_EGL -DHAVE_OVERLAY -DHAVE_GLSL -endif - ifeq ($(HAVE_ZLIB), 1) OBJ += gfx/rpng/rpng.o file_extract.o DEFINES += -DHAVE_ZLIB diff --git a/Makefile.win b/Makefile.win index 9b579b0617..0f2dd9cc36 100644 --- a/Makefile.win +++ b/Makefile.win @@ -91,12 +91,6 @@ ifeq ($(TDM_GCC),) LDCXXFLAGS += -static-libstdc++ endif -ifeq ($(HAVE_OPENGL), 1) - OBJ += gfx/gl.o gfx/math/matrix.o gfx/fonts/gl_font.o gfx/fonts/gl_raster_font.o gfx/gfx_context.o gfx/context/wgl_ctx.o gfx/shader_glsl.o gfx/glsym/rglgen.o gfx/glsym/glsym_gl.o - DEFINES += -DHAVE_OPENGL -DHAVE_GLSL -DHAVE_GL_SYNC - LIBS += -lopengl32 -lgdi32 -lcomdlg32 -endif - ifeq ($(HAVE_ZLIB), 1) ZLIB_OBJS = deps/rzlib/unzip.o \ deps/rzlib/ioapi.o \