Build tweaks:

Set up the use of {Windows,Apple}/{include,lib} regardless of feature toggles in Makefile.common using $(abspath ) in reference to the directory Makefile.common is in.
Add the three DirectX headers that are actually used to the repo. (from: http://alleg.sourceforge.net/files/dx9mgw.zip)
Since current MinGW versions include DirectX libs (for dynamic linking), remove "-L$(DXROOT)/lib".
The DirectX headers are no longer a separate dependency for building.
Add $(SDLROOT_OVERRIDE). $(SDLROOT) only functions for Windows and Mac OS X.
Factor handling of $(DXROOT_OVERRIDE) and $(SDLROOT_OVERRIDE) into Makefile.shared using $(abspath ).

git-svn-id: https://svn.eduke32.com/eduke32@3275 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
hendricks266 2012-12-13 02:34:30 +00:00
parent 6f2fa332dd
commit 9fcba228b1
8 changed files with 12626 additions and 53 deletions

View file

@ -5,15 +5,6 @@
include Makefile.common include Makefile.common
# SDK locations for Windows - adjust to match your setup
#
ifneq ($(DXROOT_OVERRIDE),)
DXROOT=$(DXROOT_OVERRIDE)
else
DXROOT=../sdk/dx
#DXROOT=c:/sdks/directx/dx8
endif
# Build locations # Build locations
# #
SRC=source SRC=source
@ -64,15 +55,10 @@ endif
include $(EROOT)/Makefile.shared include $(EROOT)/Makefile.shared
OURLIBS=$(LIBS) $(BASELIBS) $(BUILDLIBS) OURLIBS=$(LIBS) $(BASELIBS) $(BUILDLIBS)
ifneq (0,$(USE_LIBVPX)) ifneq (0,$(USE_LIBVPX))
ifeq ($(PLATFORM),WINDOWS)
LIBS+= -LWindows/lib
OURCOMMONFLAGS+= -IWindows/include
endif
ifeq ($(PLATFORM),DARWIN) ifeq ($(PLATFORM),DARWIN)
# vpx headers and lib from 'port install libvpx' or 'brew install libvpx' # vpx headers and lib from 'port install libvpx' or 'brew install libvpx'
LIBS+= -L/opt/local/lib -L/usr/local/lib LIBS+= -L/opt/local/lib -L/usr/local/lib
@ -221,7 +207,7 @@ ifeq ($(PLATFORM),WII)
endif endif
ifeq ($(PLATFORM),DARWIN) ifeq ($(PLATFORM),DARWIN)
OURCOMMONFLAGS += -fno-pic -I$(abspath Apple) -I$(abspath Apple/include) OURCOMMONFLAGS += -fno-pic
ifneq ($(findstring x86_64,$(ARCH)),x86_64) ifneq ($(findstring x86_64,$(ARCH)),x86_64)
ifeq (,$(ARCH)) ifeq (,$(ARCH))
@ -273,7 +259,7 @@ ifeq ($(PLATFORM),WINDOWS)
JAUDIOLIB=libjfaudiolib_win32.a JAUDIOLIB=libjfaudiolib_win32.a
ENETLIB=libenet_win32.a ENETLIB=libenet_win32.a
ifeq ($(RENDERTYPE),WIN) ifeq ($(RENDERTYPE),WIN)
OURCOMMONFLAGS += -I$(DXROOT)/include OURCOMMONFLAGS += -I$(DXROOT) -I$(DXROOT)/include
LIBS+= -ldsound LIBS+= -ldsound
GAMEOBJS+= $(OBJ)/music.$o $(OBJ)/midi.$o $(OBJ)/mpu401.$o GAMEOBJS+= $(OBJ)/music.$o $(OBJ)/midi.$o $(OBJ)/mpu401.$o
endif endif
@ -281,7 +267,8 @@ endif
# -lGLU to build with gluBuild2DMipmaps # -lGLU to build with gluBuild2DMipmaps
ifeq ($(RENDERTYPE),SDL) ifeq ($(RENDERTYPE),SDL)
ifeq ($(PLATFORM),WINDOWS) ifeq ($(PLATFORM),WINDOWS)
LIBS+= Windows/lib/SDL_mixer.lib OURCOMMONFLAGS += -I$(SDLROOT)/include -I$(SDLROOT)/include/SDL
LIBS+= Windows/lib/SDL_mixer.lib -L$(SDLROOT)/lib
else else
ifneq ($(PLATFORM),DARWIN) ifneq ($(PLATFORM),DARWIN)
LIBS+= -l$(SDLNAME)_mixer LIBS+= -l$(SDLNAME)_mixer

View file

@ -2,6 +2,8 @@
## common definitions for Makefile, build/Makefile, source/enet/Makefile and ## common definitions for Makefile, build/Makefile, source/enet/Makefile and
## source/jaudiolib/Makefile ## source/jaudiolib/Makefile
MAKEFILE_COMMON:=$(lastword $(MAKEFILE_LIST))
# Use colored output # Use colored output
PRETTY_OUTPUT ?= 1 PRETTY_OUTPUT ?= 1
@ -90,11 +92,6 @@ endif
# Binary suffix override: # Binary suffix override:
EXESUFFIX_OVERRIDE ?= EXESUFFIX_OVERRIDE ?=
# DirectX SDK location - if nonempty, overrides the DXROOTs of the individual
# Makefiles. Should be set to an absolute path since this Makefile is included
# at different directory levels
DXROOT_OVERRIDE:=
# Mac OS X Frameworks location # Mac OS X Frameworks location
# Like above, use absolute paths. # Like above, use absolute paths.
APPLE_FRAMEWORKS ?=/Library/Frameworks APPLE_FRAMEWORKS ?=/Library/Frameworks
@ -331,6 +328,16 @@ ifeq (0,$(NETCODE))
endif endif
# Set up target-specific headers and libs that work across all Makefiles
ifeq ($(PLATFORM),WINDOWS)
BASELIBS+= -L$(abspath $(dir $(MAKEFILE_COMMON))Windows/lib)
BASECOMMONFLAGS+= -I$(abspath $(dir $(MAKEFILE_COMMON))Windows/include)
endif
ifeq ($(PLATFORM),DARWIN)
BASELIBS+= -L$(abspath $(dir $(MAKEFILE_COMMON))Apple/lib)
BASECOMMONFLAGS+= -I$(abspath $(dir $(MAKEFILE_COMMON))Apple/include)
endif
#### Lunatic development, do not touch! #### Lunatic development, do not touch!
LUNATIC=0 LUNATIC=0
LUAJIT=luajit LUAJIT=luajit
@ -351,7 +358,7 @@ ifneq ($(LUNATIC),0)
BASECOMMONFLAGS+= -I$(SRC)/lunatic -DLUNATIC BASECOMMONFLAGS+= -I$(SRC)/lunatic -DLUNATIC
ifeq ($(PLATFORM),WINDOWS) ifeq ($(PLATFORM),WINDOWS)
BASELIBS+= -LWindows/lib -lluajit BASELIBS+= -lluajit
else else
BASELIBS+= -lluajit-5.1 BASELIBS+= -lluajit-5.1
endif endif

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -5,15 +5,6 @@
include ../Makefile.common include ../Makefile.common
# SDK locations for Windows - adjust to match your setup
#
ifneq ($(DXROOT_OVERRIDE),)
DXROOT=$(DXROOT_OVERRIDE)
else
DXROOT=../../sdk/dx
#DXROOT=c:/sdks/directx/dx8
endif
# Build locations - OBJ gets overridden to the game-specific objects dir # Build locations - OBJ gets overridden to the game-specific objects dir
# #
OBJ?=obj.gnu OBJ?=obj.gnu
@ -135,6 +126,10 @@ endif
ifeq ($(RENDERTYPE),SDL) ifeq ($(RENDERTYPE),SDL)
ENGINEOBJS+= $(OBJ)/sdlayer.$o ENGINEOBJS+= $(OBJ)/sdlayer.$o
ifeq ($(PLATFORM),WINDOWS)
OURCOMMONFLAGS += -I$(SDLROOT)/include -I$(SDLROOT)/include/SDL
endif
ifeq ($(PLATFORM),DARWIN) ifeq ($(PLATFORM),DARWIN)
ifneq ($(findstring x86_64,$(ARCH)),x86_64) ifneq ($(findstring x86_64,$(ARCH)),x86_64)
ifeq (,$(ARCH)) ifeq (,$(ARCH))
@ -164,7 +159,7 @@ ifeq ($(RENDERTYPE),SDL)
endif endif
endif endif
ifeq ($(RENDERTYPE),WIN) ifeq ($(RENDERTYPE),WIN)
OURCOMMONFLAGS+= -I$(DXROOT)/include OURCOMMONFLAGS+= -I$(DXROOT) -I$(DXROOT)/include
ENGINEOBJS+= $(OBJ)/winlayer.$o $(OBJ)/rawinput.$o ENGINEOBJS+= $(OBJ)/winlayer.$o $(OBJ)/rawinput.$o
endif endif
@ -261,13 +256,13 @@ cacheinfo$(EXESUFFIX): $(OBJ)/cacheinfo.$o $(OBJ)/compat.$o $(OBJ)/compat_tools.
if $(LINKER) -o $@ $^ $(OURLDFLAGS) $(UTILLIBS); then $(ONESTEP_OK); else $(ONESTEP_FAILED); fi if $(LINKER) -o $@ $^ $(OURLDFLAGS) $(UTILLIBS); then $(ONESTEP_OK); else $(ONESTEP_FAILED); fi
enumdisplay$(EXESUFFIX): $(OBJ)/enumdisplay.$o $(UTILADDOBJS) enumdisplay$(EXESUFFIX): $(OBJ)/enumdisplay.$o $(UTILADDOBJS)
$(ONESTEP_STATUS) $(ONESTEP_STATUS)
if $(LINKER) -o $@ $^ $(OURLDFLAGS) $(UTILLIBS) -I$(DXROOT)/include -lgdi32; then $(ONESTEP_OK); else $(ONESTEP_FAILED); fi if $(LINKER) -o $@ $^ $(OURLDFLAGS) $(UTILLIBS) -I$(DXROOT) -I$(DXROOT)/include -lgdi32; then $(ONESTEP_OK); else $(ONESTEP_FAILED); fi
getdxdidf$(EXESUFFIX): $(OBJ)/getdxdidf.$o $(UTILADDOBJS) getdxdidf$(EXESUFFIX): $(OBJ)/getdxdidf.$o $(UTILADDOBJS)
$(ONESTEP_STATUS) $(ONESTEP_STATUS)
if $(LINKER) -o $@ $^ $(OURLDFLAGS) $(UTILLIBS) -I$(DXROOT)/include -ldinput; then $(ONESTEP_OK); else $(ONESTEP_FAILED); fi if $(LINKER) -o $@ $^ $(OURLDFLAGS) $(UTILLIBS) -I$(DXROOT) -I$(DXROOT)/include -ldinput; then $(ONESTEP_OK); else $(ONESTEP_FAILED); fi
makesdlkeytrans$(EXESUFFIX): $(OBJ)/makesdlkeytrans.$o $(UTILADDOBJS) makesdlkeytrans$(EXESUFFIX): $(OBJ)/makesdlkeytrans.$o $(UTILADDOBJS)
$(ONESTEP_STATUS) $(ONESTEP_STATUS)
if $(LINKER) -o $@ $^ $(OURLDFLAGS) $(UTILLIBS); then $(ONESTEP_OK); else $(ONESTEP_FAILED); fi if $(LINKER) -o $@ $^ $(OURLDFLAGS) $(UTILLIBS) -I$(SDLROOT)/include -I$(SDLROOT)/include/SDL; then $(ONESTEP_OK); else $(ONESTEP_FAILED); fi
arttool$(EXESUFFIX): $(OBJ)/arttool.$o $(UTILADDOBJS) arttool$(EXESUFFIX): $(OBJ)/arttool.$o $(UTILADDOBJS)
$(ONESTEP_STATUS) $(ONESTEP_STATUS)
if $(L_CXX) -o $@ $^ $(OURLDFLAGS) $(STATICSTDCPP) $(STDCPPLIB) $(UTILLIBS); then $(ONESTEP_OK); else $(ONESTEP_FAILED); fi if $(L_CXX) -o $@ $^ $(OURLDFLAGS) $(STATICSTDCPP) $(STDCPPLIB) $(UTILLIBS); then $(ONESTEP_OK); else $(ONESTEP_FAILED); fi

View file

@ -1,11 +1,21 @@
# Shared make information between Build engine and games # Shared make information between Build engine and games
MAKEFILE_SHARED:=$(lastword $(MAKEFILE_LIST))
ENGINELIB=libengine.a ENGINELIB=libengine.a
EDITORLIB=libbuild.a EDITORLIB=libbuild.a
# SDK locations - adjust to match your setup
# Overrides must use absolute paths since this Makefile is included at different directory levels
#
SDLCONFIG = /usr/local/bin/sdl-config SDLCONFIG = /usr/local/bin/sdl-config
SDLNAME = SDL SDLNAME = SDL
DXROOT=$(abspath $(dir $(MAKEFILE_COMMON))../sdk/dx)
#DXROOT=/c/sdks/directx/dx8
SDLROOT=$(abspath $(dir $(MAKEFILE_COMMON))../sdk/SDL)
ifeq ($(wildcard $(SDLCONFIG)),$(SDLCONFIG)) ifeq ($(wildcard $(SDLCONFIG)),$(SDLCONFIG))
# $(info Detected locally installed SDL 1.X) # $(info Detected locally installed SDL 1.X)
SDLROOT = /usr/local SDLROOT = /usr/local
@ -27,6 +37,16 @@ endif
SDL_FRAMEWORK = 0 SDL_FRAMEWORK = 0
DXROOT_OVERRIDE ?=
SDLROOT_OVERRIDE ?=
ifneq ($(DXROOT_OVERRIDE),)
DXROOT=$(DXROOT_OVERRIDE)
endif
ifneq ($(SDLROOT_OVERRIDE),)
SDLROOT=$(SDLROOT_OVERRIDE)
endif
ifeq (4,$(GCC_MAJOR)) ifeq (4,$(GCC_MAJOR))
L_SSP := -lssp L_SSP := -lssp
endif endif
@ -202,7 +222,7 @@ ifeq ($(RENDERTYPE),SDL)
endif endif
else else
ifeq ($(RENDERTYPE),WIN) ifeq ($(RENDERTYPE),WIN)
BUILDLIBS+= -L$(DXROOT)/lib -ldxguid BUILDLIBS+= -ldxguid
endif endif
endif endif
@ -247,9 +267,7 @@ endif
ifeq ($(PLATFORM),WINDOWS) ifeq ($(PLATFORM),WINDOWS)
ifneq ($(USE_LIBPNG),0) ifneq ($(USE_LIBPNG),0)
# XXX: these assume that the compiler runs from build/. Ugh. BUILDLIBS+= -lpng_mini -lz_mini
BUILDLIBS+= -L../Windows/lib -lpng_mini -lz_mini
BUILDCOMMONFLAGS+= -I../Windows/include
endif endif
else else
ifeq ($(PLATFORM),DARWIN) ifeq ($(PLATFORM),DARWIN)

View file

@ -6,14 +6,6 @@ OBJNAME=libjfaudiolib.a
SRC=src SRC=src
INC=include INC=include
# SDK locations - adjust to match your setup
ifneq ($(DXROOT_OVERRIDE),)
DXROOT ?= $(DXROOT_OVERRIDE)
else
DXROOT=../../../sdk/dx
#DXROOT ?= c:/sdks/directx/dx8
endif
# for BUILD_ECHOFLAGS: # for BUILD_ECHOFLAGS:
OURCOMMONFLAGS=$(BASECOMMONFLAGS) $(BUILDCOMMONFLAGS) -I$(INC) -I$(SRC) OURCOMMONFLAGS=$(BASECOMMONFLAGS) $(BUILDCOMMONFLAGS) -I$(INC) -I$(SRC)
ifneq ($(PLATFORM),WII) ifneq ($(PLATFORM),WII)
@ -29,11 +21,12 @@ OURCXXFLAGS=$(BASECXXFLAGS)
PRINTLDFLAGS=$(BASELDFLAGS) PRINTLDFLAGS=$(BASELDFLAGS)
OURASFLAGS=$(BASEASFLAGS) OURASFLAGS=$(BASEASFLAGS)
ifeq (1,$(SDL_FRAMEWORK)) ifeq ($(PLATFORM),DARWIN)
ifeq ($(PLATFORM),DARWIN) ifeq (1,$(SDL_FRAMEWORK))
APPLE_INCLUDE_DIR:=../../Apple/include OURCOMMONFLAGS += -I$(APPLE_FRAMEWORKS)/SDL.framework/Headers \
OURCOMMONFLAGS += -I$(APPLE_INCLUDE_DIR) -I$(APPLE_FRAMEWORKS)/SDL.framework/Headers \
-I$(APPLE_FRAMEWORKS)/SDL_mixer.framework/Headers -I$(APPLE_FRAMEWORKS)/SDL_mixer.framework/Headers
else
OURCOMMONFLAGS += -I$(SDLROOT)/include -I$(SDLROOT)/include/SDL
endif endif
endif endif
@ -54,7 +47,7 @@ OBJECTS=$(OBJ)/drivers.o \
ifeq ($(PLATFORM),WINDOWS) ifeq ($(PLATFORM),WINDOWS)
ifeq ($(RENDERTYPE),WIN) ifeq ($(RENDERTYPE),WIN)
OURCOMMONFLAGS+= -DHAVE_DS -I$(DXROOT)/include OURCOMMONFLAGS+= -DHAVE_DS -I$(DXROOT) -I$(DXROOT)/include
OBJECTS+= $(OBJ)/driver_directsound.o OBJECTS+= $(OBJ)/driver_directsound.o
endif endif
@ -65,6 +58,9 @@ endif
ifeq ($(RENDERTYPE),SDL) ifeq ($(RENDERTYPE),SDL)
OURCOMMONFLAGS+= -DHAVE_SDL OURCOMMONFLAGS+= -DHAVE_SDL
ifeq ($(PLATFORM),WINDOWS)
OURCOMMONFLAGS += -I$(SDLROOT)/include -I$(SDLROOT)/include/SDL
endif
ifneq ($(PLATFORM),DARWIN) ifneq ($(PLATFORM),DARWIN)
ifneq ($(PLATFORM),WINDOWS) ifneq ($(PLATFORM),WINDOWS)
OURCOMMONFLAGS+=`pkg-config --cflags vorbis` OURCOMMONFLAGS+=`pkg-config --cflags vorbis`