From a94abb3026f92fc3fb356126ac28c854cc7bfa8a Mon Sep 17 00:00:00 2001 From: divverent Date: Sat, 25 Jul 2009 10:23:32 +0000 Subject: [PATCH] allow specifying executable type git-svn-id: svn://svn.icculus.org/netradiant/trunk@391 61c419a2-8eb2-4b30-bcec-8cead039b335 --- Makefile | 11 +++++++---- radiant/qe3.cpp | 15 +-------------- 2 files changed, 8 insertions(+), 18 deletions(-) diff --git a/Makefile b/Makefile index 3f702073..352412bb 100644 --- a/Makefile +++ b/Makefile @@ -155,7 +155,7 @@ ifeq ($(OS),Linux) CFLAGS_COMMON += -fPIC LDFLAGS_DLL = -fPIC -ldl LIBS_COMMON = -lpthread - EXE = x86 + EXE ?= x86 A = a DLL = so MWINDOWS = @@ -166,7 +166,7 @@ ifeq ($(OS),Win32) CFLAGS_COMMON += -mms-bitfields LDFLAGS_DLL = --dll -Wl,--add-stdcall-alias LIBS_COMMON = -lws2_32 -luser32 -lgdi32 - EXE = exe + EXE ?= exe A = a DLL = dll MWINDOWS = -mwindows @@ -186,7 +186,7 @@ ifeq ($(OS),Darwin) CPPFLAGS_COMMON += -I/sw/include -I/usr/X11R6/include LDFLAGS_COMMON += -L/sw/lib -L/usr/lib -L/usr/X11R6/lib LDFLAGS_DLL += -dynamiclib -ldl - EXE = ppc + EXE ?= ppc A = a DLL = dylib MWINDOWS = @@ -215,13 +215,16 @@ RADIANT_MAJOR_VERSION = 5 RADIANT_MINOR_VERSION = 0 Q3MAP_VERSION = 2.5.17n +# Executable extension +RADIANT_EXECUTABLE := $(EXE) + SVN_VERSION := $(shell $(SVNVERSION) -n $(STDERR_TO_DEVNULL) | $(SED) 's/M$$//g; s/.*://g;') ifneq ($(SVN_VERSION),) RADIANT_VERSION := $(RADIANT_VERSION)-svn$(SVN_VERSION) Q3MAP_VERSION := $(Q3MAP_VERSION)-svn$(SVN_VERSION) endif -CPPFLAGS += -DRADIANT_VERSION="\"$(RADIANT_VERSION)\"" -DRADIANT_MAJOR_VERSION="\"$(RADIANT_MAJOR_VERSION)\"" -DRADIANT_MINOR_VERSION="\"$(RADIANT_MINOR_VERSION)\"" -DRADIANT_ABOUTMSG="\"$(RADIANT_ABOUTMSG)\"" -DQ3MAP_VERSION="\"$(Q3MAP_VERSION)\"" +CPPFLAGS += -DRADIANT_VERSION="\"$(RADIANT_VERSION)\"" -DRADIANT_MAJOR_VERSION="\"$(RADIANT_MAJOR_VERSION)\"" -DRADIANT_MINOR_VERSION="\"$(RADIANT_MINOR_VERSION)\"" -DRADIANT_ABOUTMSG="\"$(RADIANT_ABOUTMSG)\"" -DQ3MAP_VERSION="\"$(Q3MAP_VERSION)\"" -DRADIANT_EXECUTABLE="\"$(RADIANT_EXECUTABLE)\"" .PHONY: all all: \ diff --git a/radiant/qe3.cpp b/radiant/qe3.cpp index a526c608..451489b5 100644 --- a/radiant/qe3.cpp +++ b/radiant/qe3.cpp @@ -170,23 +170,10 @@ bool ConfirmModified(const char* title) return true; } - -const char* const EXECUTABLE_TYPE = -#if defined(__linux__) || defined (__FreeBSD__) -"x86" -#elif defined(__APPLE__) -"ppc" -#elif defined(WIN32) -"exe" -#else -#error "unknown platform" -#endif -; - void bsp_init() { build_set_variable("RadiantPath", AppPath_get()); - build_set_variable("ExecutableType", EXECUTABLE_TYPE); + build_set_variable("ExecutableType", RADIANT_EXECUTABLE); build_set_variable("EnginePath", EnginePath_get()); build_set_variable("MonitorAddress", (g_WatchBSP_Enabled) ? "127.0.0.1:39000" : ""); build_set_variable("GameName", gamename_get()); -- 2.39.2