]> git.xonotic.org Git - xonotic/netradiant.git/blobdiff - Makefile
always allocate bspEntData
[xonotic/netradiant.git] / Makefile
index b216c2cbc37d953c4b04a7f4dd64c5e568cc5ceb..3f702073011a3454fb5ca7d62f4262d9150ce66e 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -24,6 +24,7 @@ CXX                ?= g++
 RANLIB             ?= ranlib
 AR                 ?= ar
 LDD                ?= ldd # nothing on Win32
+OTOOL              ?= # only used on OS X
 WINDRES            ?= windres # only used on Win32
 
 PKGCONFIG          ?= pkg-config
@@ -85,6 +86,9 @@ WHICHDLL           ?= which
 ifeq ($(OS),MINGW32_NT-6.0)
        OS = Win32
 endif
+ifeq ($(OS),Windows_NT)
+       OS = Win32
+endif
 
 CFLAGS_COMMON = -MMD -W -Wall -Wcast-align -Wcast-qual -Wno-unused-parameter
 CPPFLAGS_COMMON =
@@ -195,6 +199,7 @@ ifeq ($(OS),Darwin)
        LIBS_GTKGLEXT += -lX11 -dylib_file /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib
        # workaround: we have no "ldd" for OS X, so...
        LDD =
+       OTOOL = otool
 
        INSTALLDIR := $(INSTALLDIR_BASE)/NetRadiant.app/Contents/MacOS/install
 else
@@ -233,6 +238,7 @@ else
 dependencies-check:
        @$(ECHO)
        @if [ x"$(DEPENDENCIES_CHECK)" = x"verbose" ]; then set -x; fi; \
+       failed=0; \
        checkbinary() \
        { \
                $(ECHO_NOLF) "Checking for $$2 ($$1)... "; \
@@ -243,7 +249,7 @@ dependencies-check:
                        $(ECHO) "not found, please install it or set PATH right!"; \
                        $(ECHO) "To see the failed commands, set DEPENDENCIES_CHECK=verbose"; \
                        $(ECHO) "To proceed anyway, set DEPENDENCIES_CHECK=off"; \
-                       exit 1; \
+                       failed=1; \
                fi; \
        }; \
        $(ECHO) checking that the build tools exist; \
@@ -266,10 +272,12 @@ dependencies-check:
        checkbinary binutils "$(AR)"; \
        checkbinary pkg-config "$(PKGCONFIG)"; \
        [ "$(OS)" = "Win32" ] && checkbinary mingw32 "$(WINDRES)"; \
-       [ -n "$(lDD)" ] && checkbinary libc6 "$(LDD)"; \
-       $(ECHO) All required tools have been found!
+       [ -n "$(LDD)" ] && checkbinary libc6 "$(LDD)"; \
+       [ -n "$(OTOOL)" ] && checkbinary xcode "$(OTOOL)"; \
+       [ "$$failed" = "0" ] && $(ECHO) All required tools have been found!
        @$(ECHO)
        @if [ x"$(DEPENDENCIES_CHECK)" = x"verbose" ]; then set -x; fi; \
+       failed=0; \
        checkheader() \
        { \
                $(ECHO_NOLF) "Checking for $$2 ($$1)... "; \
@@ -284,7 +292,7 @@ dependencies-check:
                        $(ECHO) "not found, please install it or set PKG_CONFIG_PATH right!"; \
                        $(ECHO) "To see the failed commands, set DEPENDENCIES_CHECK=verbose"; \
                        $(ECHO) "To proceed anyway, set DEPENDENCIES_CHECK=off"; \
-                       exit 1; \
+                       failed=1; \
                fi; \
        }; \
        $(ECHO) checking that the dependencies exist; \
@@ -296,7 +304,7 @@ dependencies-check:
        checkheader libgtkglext1-dev gtk/gtkglwidget.h gtk_widget_get_gl_context "$(CPPFLAGS_GTKGLEXT)" "$(LIBS_GTKGLEXT)"; \
        [ "$(OS)" != "Win32" ] && checkheader libc6-dev dlfcn.h dlopen "$(CPPFLAGS_DL)" "$(LIBS_DL)"; \
        checkheader zlib1g-dev zlib.h zlibVersion "$(CPPFLAGS_ZLIB)" "$(LIBS_ZLIB)"; \
-       $(ECHO) All required libraries have been found!
+       [ "$$failed" = "0" ] && $(ECHO) All required libraries have been found!
        @$(ECHO)
 endif
 
@@ -965,8 +973,13 @@ ifeq ($(OS),Win32)
 install-dll: binaries
        MKDIR="$(MKDIR)" CP="$(CP)" CAT="$(CAT)" GTKDIR="$(GTKDIR)" WHICHDLL="$(WHICHDLL)" INSTALLDIR="$(INSTALLDIR)" $(SH) install-dlls.sh
 else
+ifeq ($(OS),Darwin)
+install-dll: binaries
+       CP="$(CP)" OTOOL="$(OTOOL)" INSTALLDIR="$(INSTALLDIR)" $(SH) install-dylibs.sh
+else
 install-dll: binaries
        @$(ECHO) No DLL inclusion implemented for this target.
 endif
+endif
 
 -include $(shell find . -name \*.d)