]> git.xonotic.org Git - xonotic/netradiant.git/blobdiff - Makefile
bugfix in latest change
[xonotic/netradiant.git] / Makefile
index 8c6ee48998f11017eba1783e9c63e8caa71b030f..debc90e64e2caf3fcc4ec46c6d5fa90f6bd8927a 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 =
@@ -187,11 +191,15 @@ ifeq ($(OS),Darwin)
        DLL = dylib
        MWINDOWS =
 
+       # workaround for weird prints
+       ECHO_NOLF = /bin/echo -n
+
        # workaround: http://developer.apple.com/qa/qa2007/qa1567.html
        LIBS_GL += -lX11 -dylib_file /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib
        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
@@ -263,7 +271,8 @@ dependencies-check:
        checkbinary binutils "$(AR)"; \
        checkbinary pkg-config "$(PKGCONFIG)"; \
        [ "$(OS)" = "Win32" ] && checkbinary mingw32 "$(WINDRES)"; \
-       [ -n "$(lDD)" ] && checkbinary libc6 "$(LDD)"; \
+       [ -n "$(LDD)" ] && checkbinary libc6 "$(LDD)"; \
+       [ -n "$(OTOOL)" ] && checkbinary xcode "$(OTOOL)"; \
        $(ECHO) All required tools have been found!
        @$(ECHO)
        @if [ x"$(DEPENDENCIES_CHECK)" = x"verbose" ]; then set -x; fi; \
@@ -938,7 +947,7 @@ $(INSTALLDIR)/heretic2/h2data.$(EXE): \
 .PHONY: install-data
 install-data: binaries
        $(MKDIR) $(INSTALLDIR)/games
-       $(FIND) $(INSTALLDIR)/ -name .svn -exec $(RM_R) {} \; -prune
+       $(FIND) $(INSTALLDIR_BASE)/ -name .svn -exec $(RM_R) {} \; -prune
        [ "$(OS)" != "Darwin" ] || $(CP_R) setup/data/osx/NetRadiant.app/* $(INSTALLDIR_BASE)/NetRadiant.app/
        set -ex; \
        for GAME in games/*; do \
@@ -955,15 +964,20 @@ install-data: binaries
        $(ECHO) $(RADIANT_MINOR_VERSION) > $(INSTALLDIR)/RADIANT_MINOR
        $(ECHO) $(RADIANT_MAJOR_VERSION) > $(INSTALLDIR)/RADIANT_MAJOR
        $(CP_R) setup/data/tools/* $(INSTALLDIR)/
-       $(FIND) $(INSTALLDIR)/ -name .svn -exec $(RM_R) {} \; -prune
+       $(FIND) $(INSTALLDIR_BASE)/ -name .svn -exec $(RM_R) {} \; -prune
 
 .PHONY: install-dll
 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)