From 8b149c8ff9daf656ca8c5a0c5520a77d43e9d96b Mon Sep 17 00:00:00 2001 From: twinaphex Date: Sun, 14 Sep 2014 02:15:41 +0200 Subject: [PATCH] Move more to Makefile.common --- Makefile | 35 ----------------------------------- Makefile.common | 42 ++++++++++++++++++++++++++++++++++++++++++ Makefile.emscripten | 22 +++++++++++++++++----- Makefile.win | 44 +++----------------------------------------- 4 files changed, 62 insertions(+), 81 deletions(-) diff --git a/Makefile b/Makefile index f03a2cbb20..b5cad832f6 100644 --- a/Makefile +++ b/Makefile @@ -282,13 +282,6 @@ ifeq ($(HAVE_WAYLAND), 1) LIBS += $(WAYLAND_LIBS) endif -ifeq ($(HAVE_LIBXML2), 1) - LIBS += $(LIBXML2_LIBS) - DEFINES += $(LIBXML2_CFLAGS) -else - OBJ += compat/rxml/rxml.o -endif - ifeq ($(HAVE_DYLIB), 1) LIBS += $(DYLIB_LIB) OBJ += gfx/filter.o @@ -341,34 +334,6 @@ ifeq ($(HAVE_NEON),1) OBJ += audio/utils_neon.o endif -ifeq ($(HAVE_7ZIP),1) - HAVE_COMPRESSION = 1 - DEFINES += -DHAVE_7ZIP - 7ZOBJ = deps/7zip/7zIn.o \ - deps/7zip/7zAlloc.o \ - deps/7zip/Bra86.o \ - deps/7zip/CpuArch.o \ - deps/7zip/7zFile.o \ - deps/7zip/7zStream.o \ - deps/7zip/7zBuf2.o \ - deps/7zip/LzmaDec.o \ - deps/7zip/7zCrcOpt.o \ - deps/7zip/Bra.o \ - deps/7zip/7zDec.o \ - deps/7zip/Bcj2.o \ - deps/7zip/7zCrc.o \ - deps/7zip/Lzma2Dec.o \ - deps/7zip/7zBuf.o \ - decompress/7zip_support.o - OBJ += $(7ZOBJ) - RETROLAUNCH_OBJ += $(7ZOBJ) - JOYCONFIG_OBJ += $(7ZOBJ) -endif - -ifdef HAVE_COMPRESSION - DEFINES += -DHAVE_COMPRESSION -endif - ifeq ($(HAVE_PRESERVE_DYLIB),1) DEFINES += -DNO_DLCLOSE endif diff --git a/Makefile.common b/Makefile.common index b0081f86cf..a3e8286b5d 100644 --- a/Makefile.common +++ b/Makefile.common @@ -1,3 +1,11 @@ +ifeq ($(HAVE_FBO), 1) + DEFINES += -DHAVE_FBO +endif + +ifdef HAVE_COMPRESSION + DEFINES += -DHAVE_COMPRESSION +endif + OBJ += frontend/frontend.o \ frontend/frontend_context.o \ frontend/platform/platform_null.o \ @@ -151,3 +159,37 @@ ifeq ($(HAVE_CG), 1) LIBS += -lcg -lcgD3D9 endif endif + +ifeq ($(HAVE_LIBXML2), 1) + LIBS += $(LIBXML2_LIBS) + DEFINES += $(LIBXML2_CFLAGS) +else + OBJ += compat/rxml/rxml.o +endif + +# Compression/Archive + +ifeq ($(HAVE_7ZIP),1) + CFLAGS += -I./deps/7zip + HAVE_COMPRESSION = 1 + DEFINES += -DHAVE_7ZIP + 7ZOBJ = deps/7zip/7zIn.o \ + deps/7zip/7zAlloc.o \ + deps/7zip/Bra86.o \ + deps/7zip/CpuArch.o \ + deps/7zip/7zFile.o \ + deps/7zip/7zStream.o \ + deps/7zip/7zBuf2.o \ + deps/7zip/LzmaDec.o \ + deps/7zip/7zCrcOpt.o \ + deps/7zip/Bra.o \ + deps/7zip/7zDec.o \ + deps/7zip/Bcj2.o \ + deps/7zip/7zCrc.o \ + deps/7zip/Lzma2Dec.o \ + deps/7zip/7zBuf.o \ + decompress/7zip_support.o + OBJ += $(7ZOBJ) + RETROLAUNCH_OBJ += $(7ZOBJ) + JOYCONFIG_OBJ += $(7ZOBJ) +endif diff --git a/Makefile.emscripten b/Makefile.emscripten index 2924512e42..43d498f2fa 100644 --- a/Makefile.emscripten +++ b/Makefile.emscripten @@ -48,7 +48,23 @@ ifeq ($(HAVE_ZLIB), 1) OBJ += gfx/rpng/rpng.o file_extract.o DEFINES += -DHAVE_ZLIB ifeq ($(WANT_MINIZ), 1) - OBJ += deps/rzlib/adler32.o deps/rzlib/compress.o deps/rzlib/crc32.o deps/rzlib/deflate.o deps/rzlib/gzclose.o deps/rzlib/gzlib.o deps/rzlib/gzread.o deps/rzlib/gzwrite.o deps/rzlib/inffast.o deps/rzlib/inflate.o deps/rzlib/inftrees.o deps/rzlib/trees.o deps/rzlib/uncompr.o deps/rzlib/zutil.o deps/rzlib/ioapi.o deps/rzlib/unzip.o decompress/zip_support.o + OBJ += deps/rzlib/adler32.o \ + deps/rzlib/compress.o \ + deps/rzlib/crc32.o \ + deps/rzlib/deflate.o \ + deps/rzlib/gzclose.o \ + deps/rzlib/gzlib.o \ + deps/rzlib/gzread.o \ + deps/rzlib/gzwrite.o \ + deps/rzlib/inffast.o \ + deps/rzlib/inflate.o \ + deps/rzlib/inftrees.o \ + deps/rzlib/trees.o \ + deps/rzlib/uncompr.o \ + deps/rzlib/zutil.o \ + deps/rzlib/ioapi.o \ + deps/rzlib/unzip.o \ + decompress/zip_support.o DEFINES += -DWANT_MINIZ else OBJ += deps/rzlib/ioapi.o deps/rzlib/unzip.o decompress/zip_support.o @@ -57,10 +73,6 @@ ifeq ($(HAVE_ZLIB), 1) endif endif -ifeq ($(HAVE_FBO), 1) - DEFINES += -DHAVE_FBO -endif - ifneq ($(V), 1) Q := @ endif diff --git a/Makefile.win b/Makefile.win index 0c721aa8aa..4b1597ec59 100644 --- a/Makefile.win +++ b/Makefile.win @@ -34,6 +34,9 @@ endif FREETYPE_CFLAGS := -DHAVE_FREETYPE -Ifreetype2 FREETYPE_LIBS := -lfreetype +LIBXML2_CFLAGS := -Ilibxml2 -DHAVE_LIBXML2 -DHAVE_GLSL +LIBXML2_LIBS := -lxml2 -liconv + OBJDIR := obj-w32 OBJ := @@ -152,13 +155,6 @@ ifeq ($(HAVE_ZLIB), 1) endif endif -ifeq ($(HAVE_LIBXML2), 1) - DEFINES += -Ilibxml2 -DHAVE_LIBXML2 -DHAVE_GLSL - LIBS += -lxml2 -liconv -else - OBJ += compat/rxml/rxml.o -endif - ifeq ($(HAVE_DYLIB), 1) DEFINES += -DHAVE_DYLIB OBJ += gfx/filter.o @@ -181,10 +177,6 @@ else LIBS += $(libretro) endif -ifeq ($(HAVE_FBO), 1) - DEFINES += -DHAVE_FBO -endif - ifeq ($(HAVE_PYTHON), 1) LIBS += -lpython32 DEFINES += -DHAVE_PYTHON -Ipython @@ -205,36 +197,6 @@ ifeq ($(HAVE_FFMPEG), 1) DEFINES += -DHAVE_FFMPEG -Iffmpeg endif -ifeq ($(HAVE_7ZIP),1) - CFLAGS += -I./deps/7zip - DEFINES += -DHAVE_7ZIP - HAVE_COMPRESSION = 1 - compression = yes - 7ZOBJ = deps/7zip/7zIn.o \ - deps/7zip/7zAlloc.o \ - deps/7zip/Bra86.o \ - deps/7zip/CpuArch.o \ - deps/7zip/7zFile.o \ - deps/7zip/7zStream.o \ - deps/7zip/7zBuf2.o \ - deps/7zip/LzmaDec.o \ - deps/7zip/7zCrcOpt.o \ - deps/7zip/Bra.o \ - deps/7zip/7zDec.o \ - deps/7zip/Bcj2.o \ - deps/7zip/7zCrc.o \ - deps/7zip/Lzma2Dec.o \ - deps/7zip/7zBuf.o \ - decompress/7zip_support.o - OBJ += $(7ZOBJ) - RETROLAUNCH_OBJ += $(7ZOBJ) - JOYCONFIG_OBJ += $(7ZOBJ) -endif - -ifdef HAVE_COMPRESSION - DEFINES += -DHAVE_COMPRESSION -endif - ifneq ($(V), 1) Q := @ endif