2008-08-20 22:58:09 +00:00
|
|
|
#
|
2006-04-13 20:47:06 +00:00
|
|
|
# EDuke32 Makefile for GNU Make
|
2008-08-20 22:58:09 +00:00
|
|
|
#
|
|
|
|
|
|
|
|
# DEFINES
|
2006-04-13 20:47:06 +00:00
|
|
|
|
2008-10-19 12:14:04 +00:00
|
|
|
# Use colored output
|
|
|
|
PRETTY_OUTPUT = 1
|
|
|
|
|
2006-04-13 20:47:06 +00:00
|
|
|
# SDK locations - adjust to match your setup
|
2008-03-08 05:23:15 +00:00
|
|
|
DXROOT=../sdk/dx
|
2008-08-20 22:58:09 +00:00
|
|
|
|
|
|
|
ALROOT = AL
|
2008-10-24 01:33:53 +00:00
|
|
|
|
2006-04-13 20:47:06 +00:00
|
|
|
# Engine options
|
|
|
|
SUPERBUILD = 1
|
|
|
|
POLYMOST = 1
|
2008-08-20 22:58:09 +00:00
|
|
|
POLYMER = 0
|
2006-04-13 20:47:06 +00:00
|
|
|
USE_OPENGL = 1
|
|
|
|
NOASM = 0
|
2007-08-17 19:32:56 +00:00
|
|
|
LINKED_GTK = 0
|
2008-02-16 22:27:08 +00:00
|
|
|
BUILD32_ON_64 = 0
|
2008-11-12 04:16:41 +00:00
|
|
|
RANCID_NETWORKING = 1
|
2006-04-13 20:47:06 +00:00
|
|
|
|
2008-08-20 22:58:09 +00:00
|
|
|
# Debugging/Build options
|
2006-04-13 20:47:06 +00:00
|
|
|
RELEASE?=1
|
2006-11-20 04:55:37 +00:00
|
|
|
NOSOUND?=0
|
2008-08-20 22:58:09 +00:00
|
|
|
USE_OPENAL ?= 1
|
2008-06-14 09:25:22 +00:00
|
|
|
OPTLEVEL?=2
|
2006-04-13 20:47:06 +00:00
|
|
|
|
2008-08-20 22:58:09 +00:00
|
|
|
# Build locations
|
2006-08-31 01:54:23 +00:00
|
|
|
SRC=source
|
|
|
|
RSRC=rsrc
|
2008-10-20 03:09:19 +00:00
|
|
|
EROOT=build
|
2006-08-31 01:54:23 +00:00
|
|
|
ESRC=$(EROOT)/src
|
|
|
|
EINC=$(EROOT)/include
|
2006-04-13 20:47:06 +00:00
|
|
|
INC=$(SRC)
|
|
|
|
o=o
|
2008-11-12 04:16:41 +00:00
|
|
|
# ENETROOT=$(ESRC)/enet
|
2006-04-13 20:47:06 +00:00
|
|
|
|
|
|
|
ifneq (0,$(RELEASE))
|
2008-08-20 22:58:09 +00:00
|
|
|
# Debugging disabled
|
2008-09-26 17:20:10 +00:00
|
|
|
debug=-fomit-frame-pointer -funswitch-loops -O$(OPTLEVEL)
|
2006-04-13 20:47:06 +00:00
|
|
|
else
|
2008-08-20 22:58:09 +00:00
|
|
|
# Debugging enabled
|
2006-11-18 08:13:33 +00:00
|
|
|
debug=-ggdb -O0 -DDEBUGGINGAIDS
|
2006-04-13 20:47:06 +00:00
|
|
|
endif
|
|
|
|
|
|
|
|
CC=gcc
|
|
|
|
CXX=g++
|
2006-11-19 08:24:46 +00:00
|
|
|
|
2008-09-26 17:20:10 +00:00
|
|
|
GCC_MAJOR := $(shell $(CC) -dumpversion 2>&1 | cut -d'.' -f1)
|
|
|
|
GCC_MINOR := $(shell $(CC) -dumpversion 2>&1 | cut -d'.' -f2)
|
|
|
|
|
|
|
|
ifeq (4,$(GCC_MAJOR))
|
|
|
|
ifneq (0,$(GCC_MINOR))
|
2008-11-14 11:04:22 +00:00
|
|
|
# debug += -ftree-vectorize
|
2008-09-26 17:20:10 +00:00
|
|
|
ifneq (1,$(GCC_MINOR))
|
|
|
|
ifneq (2,$(GCC_MINOR))
|
2008-11-14 11:04:22 +00:00
|
|
|
# debug += -finline-small-functions -fpredictive-commoning
|
2008-09-26 17:20:10 +00:00
|
|
|
endif
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
2008-03-21 04:01:38 +00:00
|
|
|
OURCFLAGS=$(debug) -W -Wall -Wimplicit -Werror-implicit-function-declaration \
|
2008-08-20 22:58:09 +00:00
|
|
|
-funsigned-char -fno-strict-aliasing -DNO_GCC_BUILTINS -DNOCOPYPROTECT \
|
2008-12-19 00:53:54 +00:00
|
|
|
-I$(INC) -I$(EINC) -I$(SRC)/jmact -I$(SRC)/jaudiolib -D_FORTIFY_SOURCE=2 \
|
2008-12-10 11:36:53 +00:00
|
|
|
# -march=pentium3 -mtune=generic -mmmx -m3dnow -msse -mfpmath=sse
|
2006-04-13 20:47:06 +00:00
|
|
|
OURCXXFLAGS=-fno-exceptions -fno-rtti
|
|
|
|
LIBS=-lm
|
2006-04-15 03:12:08 +00:00
|
|
|
|
2008-08-20 22:58:09 +00:00
|
|
|
NASMFLAGS = -s
|
2006-04-13 20:47:06 +00:00
|
|
|
EXESUFFIX=
|
|
|
|
|
2006-08-31 01:54:23 +00:00
|
|
|
include $(EROOT)/Makefile.shared
|
2006-04-13 20:47:06 +00:00
|
|
|
|
2007-08-17 03:16:46 +00:00
|
|
|
ifeq ($(PLATFORM),WINDOWS)
|
|
|
|
OBJ=obj_win
|
|
|
|
EOBJ=eobj_win
|
|
|
|
else
|
|
|
|
OBJ=obj
|
|
|
|
EOBJ=eobj
|
|
|
|
endif
|
2006-04-13 20:47:06 +00:00
|
|
|
|
2006-08-31 01:54:23 +00:00
|
|
|
JMACTOBJ=$(OBJ)/util_lib.$o \
|
|
|
|
$(OBJ)/file_lib.$o \
|
|
|
|
$(OBJ)/control.$o \
|
|
|
|
$(OBJ)/keyboard.$o \
|
|
|
|
$(OBJ)/mouse.$o \
|
|
|
|
$(OBJ)/mathutil.$o \
|
2008-10-20 03:09:19 +00:00
|
|
|
$(OBJ)/scriplib.$o \
|
|
|
|
$(OBJ)/animlib.$o
|
2006-08-31 01:54:23 +00:00
|
|
|
|
2006-11-18 08:46:58 +00:00
|
|
|
AUDIOLIB_FX_STUB=$(OBJ)/audiolib_fxstub.$o
|
|
|
|
AUDIOLIB_MUSIC_STUB=$(OBJ)/audiolib_musicstub.$o
|
|
|
|
|
2007-12-12 23:07:52 +00:00
|
|
|
AUDIOLIB_FX_SDL=$(OBJ)/ll_man.$o \
|
2006-11-16 03:02:42 +00:00
|
|
|
$(OBJ)/fx_man.$o \
|
2006-11-18 08:46:58 +00:00
|
|
|
$(OBJ)/dsl.$o \
|
|
|
|
$(OBJ)/pitch.$o \
|
2008-03-08 05:23:15 +00:00
|
|
|
$(OBJ)/multivoc.$o
|
|
|
|
|
2007-08-17 03:16:46 +00:00
|
|
|
AUDIOLIB_MUSIC_SDL=$(OBJ)/sdlmusic.$o
|
2006-11-16 03:02:42 +00:00
|
|
|
|
2007-12-12 23:07:52 +00:00
|
|
|
AUDIOLIB_FX=$(OBJ)/pitch.$o \
|
2006-08-31 01:54:23 +00:00
|
|
|
$(OBJ)/multivoc.$o \
|
|
|
|
$(OBJ)/ll_man.$o \
|
|
|
|
$(OBJ)/fx_man.$o \
|
2008-03-08 05:23:15 +00:00
|
|
|
$(OBJ)/dsoundout.$o
|
|
|
|
|
|
|
|
ifeq ($(USE_OPENAL),1)
|
|
|
|
AUDIOLIB_FX += $(OBJ)/openal.$o
|
|
|
|
endif
|
|
|
|
|
2006-08-31 01:54:23 +00:00
|
|
|
AUDIOLIB_MUSIC=$(OBJ)/midi.$o \
|
|
|
|
$(OBJ)/mpu401.$o \
|
|
|
|
$(OBJ)/music.$o
|
|
|
|
|
2007-12-12 23:07:52 +00:00
|
|
|
ifeq (0,$(NOASM))
|
|
|
|
# Assembly sound mixing code
|
|
|
|
AUDIOLIB_FX_SDL += $(OBJ)/mv_mix.$o $(OBJ)/mv_mix16.$o $(OBJ)/mvreverb.$o
|
|
|
|
AUDIOLIB_FX += $(OBJ)/mv_mix.$o $(OBJ)/mv_mix16.$o $(OBJ)/mvreverb.$o
|
|
|
|
else
|
|
|
|
# C fallbacks for sound mixing code
|
|
|
|
AUDIOLIB_FX_SDL += $(OBJ)/mv_mix-c.$o $(OBJ)/mvreverb-c.$o
|
|
|
|
AUDIOLIB_FX += $(OBJ)/mv_mix-c.$o $(OBJ)/mvreverb-c.$o
|
|
|
|
endif
|
|
|
|
|
|
|
|
|
2006-08-31 01:54:23 +00:00
|
|
|
GAMEOBJS=$(OBJ)/game.$o \
|
|
|
|
$(OBJ)/actors.$o \
|
|
|
|
$(OBJ)/anim.$o \
|
|
|
|
$(OBJ)/config.$o \
|
|
|
|
$(OBJ)/gamedef.$o \
|
|
|
|
$(OBJ)/gameexec.$o \
|
2006-12-10 19:32:44 +00:00
|
|
|
$(OBJ)/gamevars.$o \
|
2006-08-31 01:54:23 +00:00
|
|
|
$(OBJ)/global.$o \
|
|
|
|
$(OBJ)/menus.$o \
|
|
|
|
$(OBJ)/namesdyn.$o \
|
|
|
|
$(OBJ)/player.$o \
|
|
|
|
$(OBJ)/premap.$o \
|
|
|
|
$(OBJ)/savegame.$o \
|
|
|
|
$(OBJ)/sector.$o \
|
|
|
|
$(OBJ)/rts.$o \
|
|
|
|
$(OBJ)/testcd.$o \
|
|
|
|
$(OBJ)/osdfuncs.$o \
|
|
|
|
$(OBJ)/osdcmds.$o \
|
2006-11-16 03:02:42 +00:00
|
|
|
$(OBJ)/grpscan.$o \
|
2006-04-13 20:47:06 +00:00
|
|
|
$(JMACTOBJ)
|
|
|
|
|
2006-08-31 01:54:23 +00:00
|
|
|
EDITOROBJS=$(OBJ)/astub.$o
|
2006-04-13 20:47:06 +00:00
|
|
|
|
2008-08-20 22:58:09 +00:00
|
|
|
# PLATFORM SPECIFIC SETTINGS
|
|
|
|
|
|
|
|
ifeq ($(PLATFORM),LINUX)
|
|
|
|
OURCFLAGS += -fno-pic
|
|
|
|
NASMFLAGS += -f elf
|
2008-12-04 00:31:16 +00:00
|
|
|
LIBS += -lvorbisfile -lvorbis -logg
|
2008-09-26 17:20:10 +00:00
|
|
|
USE_OPENAL = 0
|
2008-08-20 22:58:09 +00:00
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(PLATFORM),DARWIN)
|
|
|
|
ALROOT = Apple
|
|
|
|
ifeq (1,$(SDL_FRAMEWORK))
|
2008-08-22 05:39:13 +00:00
|
|
|
OURCFLAGS += -fno-pic -I$(ALROOT)/include -I/Library/Frameworks/SDL.framework/Headers \
|
2008-08-20 22:58:09 +00:00
|
|
|
-I-I/Library/Frameworks/SDL_mixer.framework/Headers
|
2008-08-22 05:39:13 +00:00
|
|
|
LIBS += -read_only_relocs suppress -L$(ALROOT)/lib -lvorbisfile -lvorbis -logg -lm \
|
2008-08-20 22:58:09 +00:00
|
|
|
-Wl,-framework,SDL -Wl,-framework,SDL_mixer $(ALROOT)/lib/libSDLmain.a \
|
|
|
|
-Wl,-framework,Cocoa -Wl,-framework,Carbon -Wl,-framework,OpenGL \
|
|
|
|
-Wl,-framework,CoreMidi -Wl,-framework,AudioUnit \
|
|
|
|
-Wl,-framework,AudioToolbox -Wl,-framework,IOKit -Wl,-framework,AGL \
|
|
|
|
-Wl,-framework,QuickTime -lm
|
|
|
|
|
|
|
|
else
|
2008-08-22 05:39:13 +00:00
|
|
|
OURCFLAGS += -fno-pic -I$(ALROOT)/include -I$(SDLROOT)/include -I$(SDLROOT)/include/SDL
|
|
|
|
LIBS += -read_only_relocs suppress -L$(ALROOT)/lib -lvorbisfile -lvorbis -logg -lm -lSDL_mixer \
|
2008-08-20 22:58:09 +00:00
|
|
|
-Wl,-framework,Cocoa -Wl,-framework,Carbon -Wl,-framework,OpenGL \
|
|
|
|
-Wl,-framework,CoreMidi -Wl,-framework,AudioUnit \
|
|
|
|
-Wl,-framework,AudioToolbox -Wl,-framework,IOKit -Wl,-framework,AGL \
|
|
|
|
-Wl,-framework,QuickTime -lm
|
|
|
|
endif
|
|
|
|
NASMFLAGS += -f Mach-O
|
|
|
|
endif
|
|
|
|
|
2006-04-13 20:47:06 +00:00
|
|
|
ifeq ($(PLATFORM),WINDOWS)
|
2008-11-12 04:16:41 +00:00
|
|
|
OURCFLAGS += -fno-pic -DUNDERSCORES -I$(DXROOT)/include -I$(ALROOT)/include # -I$(ENETROOT)/include
|
2006-04-13 20:47:06 +00:00
|
|
|
NASMFLAGS+= -DUNDERSCORES -f win32
|
2008-11-12 04:16:41 +00:00
|
|
|
LIBS += -L$(ALROOT)/lib -lvorbisfile -lvorbis -logg -lwsock32 -lws2_32 -lwinmm #-L$(ENETROOT)
|
2006-08-31 01:54:23 +00:00
|
|
|
GAMEOBJS+= $(OBJ)/gameres.$o $(OBJ)/winbits.$o $(OBJ)/startwin.game.$o
|
|
|
|
EDITOROBJS+= $(OBJ)/buildres.$o
|
2006-04-13 20:47:06 +00:00
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(RENDERTYPE),SDL)
|
2008-08-20 22:58:09 +00:00
|
|
|
ifeq (0,$(SDL_FRAMEWORK))
|
2008-09-30 17:27:23 +00:00
|
|
|
OURCFLAGS+= $(subst -Dmain=SDL_main,,$(shell $(SDLCONFIG) --cflags))
|
2008-08-20 22:58:09 +00:00
|
|
|
else
|
|
|
|
OURCFLAGS += -DSDL_FRAMEWORK
|
|
|
|
endif
|
2006-04-15 03:12:08 +00:00
|
|
|
|
2006-11-18 08:46:58 +00:00
|
|
|
ifneq ($(PLATFORM),WINDOWS)
|
|
|
|
AUDIOLIBOBJ=$(AUDIOLIB_MUSIC_SDL) $(AUDIOLIB_FX_SDL) $(OBJ)/sounds.$o
|
2008-08-20 22:58:09 +00:00
|
|
|
ifeq (0,$(SDL_FRAMEWORK))
|
2006-11-18 08:46:58 +00:00
|
|
|
LIBS+= -lSDL_mixer
|
2008-08-20 22:58:09 +00:00
|
|
|
endif
|
2006-11-18 08:46:58 +00:00
|
|
|
else
|
|
|
|
AUDIOLIBOBJ=$(AUDIOLIB_MUSIC_STUB) $(AUDIOLIB_FX_STUB) $(OBJ)/sounds.$o
|
|
|
|
endif
|
2006-04-13 20:47:06 +00:00
|
|
|
|
|
|
|
ifeq (1,$(HAVE_GTK2))
|
|
|
|
OURCFLAGS+= -DHAVE_GTK2 $(shell pkg-config --cflags gtk+-2.0)
|
2006-08-31 01:54:23 +00:00
|
|
|
GAMEOBJS+= $(OBJ)/game_banner.$o $(OBJ)/startgtk.game.$o
|
|
|
|
EDITOROBJS+= $(OBJ)/editor_banner.$o
|
2006-04-13 20:47:06 +00:00
|
|
|
endif
|
|
|
|
|
2006-08-31 01:54:23 +00:00
|
|
|
GAMEOBJS+= $(OBJ)/game_icon.$o
|
|
|
|
EDITOROBJS+= $(OBJ)/build_icon.$o
|
2006-04-13 20:47:06 +00:00
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(RENDERTYPE),WIN)
|
2006-08-31 01:54:23 +00:00
|
|
|
AUDIOLIBOBJ=$(AUDIOLIB_MUSIC) $(AUDIOLIB_FX) $(OBJ)/sounds.$o
|
2006-04-13 20:47:06 +00:00
|
|
|
endif
|
|
|
|
|
2006-11-20 04:55:37 +00:00
|
|
|
ifeq ($(NOSOUND),1)
|
|
|
|
AUDIOLIBOBJ=$(AUDIOLIB_MUSIC_STUB) $(AUDIOLIB_FX_STUB) $(OBJ)/sounds.$o
|
|
|
|
endif
|
|
|
|
|
2006-04-13 20:47:06 +00:00
|
|
|
GAMEOBJS+= $(AUDIOLIBOBJ)
|
|
|
|
OURCFLAGS+= $(BUILDCFLAGS)
|
|
|
|
OURCXXFLAGS+= $(BUILDCFLAGS)
|
|
|
|
|
2008-03-08 05:23:15 +00:00
|
|
|
ifeq ($(USE_OPENAL),1)
|
|
|
|
OURCFLAGS+= -DUSE_OPENAL
|
|
|
|
endif
|
|
|
|
|
2008-10-19 12:14:04 +00:00
|
|
|
ifeq ($(PRETTY_OUTPUT),1)
|
2008-10-18 12:37:26 +00:00
|
|
|
.SILENT:
|
2008-10-19 12:14:04 +00:00
|
|
|
endif
|
2006-08-31 01:54:23 +00:00
|
|
|
.PHONY: clean all engine $(EOBJ)/$(ENGINELIB) $(EOBJ)/$(EDITORLIB)
|
2006-04-13 20:47:06 +00:00
|
|
|
|
|
|
|
# TARGETS
|
|
|
|
|
2008-10-18 12:37:26 +00:00
|
|
|
all: notice eduke32$(EXESUFFIX) mapster32$(EXESUFFIX)
|
2006-04-13 20:47:06 +00:00
|
|
|
|
2008-10-18 12:37:26 +00:00
|
|
|
all:
|
2008-10-18 13:25:23 +00:00
|
|
|
$(BUILD_FINISHED)
|
|
|
|
@ls -l eduke32$(EXESUFFIX)
|
|
|
|
@ls -l mapster32$(EXESUFFIX)
|
2008-10-18 12:37:26 +00:00
|
|
|
|
|
|
|
notice:
|
2008-10-18 13:25:23 +00:00
|
|
|
$(BUILD_STARTED)
|
2008-10-18 12:37:26 +00:00
|
|
|
|
2006-08-31 01:54:23 +00:00
|
|
|
eduke32$(EXESUFFIX): $(GAMEOBJS) $(EOBJ)/$(ENGINELIB)
|
2008-10-18 13:25:23 +00:00
|
|
|
$(LINK_STATUS)
|
2008-10-19 12:14:04 +00:00
|
|
|
if $(CC) -o $@ $^ $(LIBS) $(STDCPPLIB); then $(LINK_OK); else $(LINK_FAILED); fi
|
2008-10-18 12:37:26 +00:00
|
|
|
ifeq (1,$(RELEASE))
|
2006-04-13 20:47:06 +00:00
|
|
|
strip eduke32$(EXESUFFIX)
|
2008-10-18 12:37:26 +00:00
|
|
|
endif
|
2006-04-13 20:47:06 +00:00
|
|
|
|
2006-08-31 01:54:23 +00:00
|
|
|
mapster32$(EXESUFFIX): $(EDITOROBJS) $(EOBJ)/$(EDITORLIB) $(EOBJ)/$(ENGINELIB)
|
2008-10-18 13:25:23 +00:00
|
|
|
$(LINK_STATUS)
|
2008-11-11 13:24:05 +00:00
|
|
|
if $(CC) $(CFLAGS) $(OURCFLAGS) -o $@ $^ $(LIBS) $(STDCPPLIB); then $(LINK_OK); else $(LINK_FAILED); fi
|
2008-10-18 12:37:26 +00:00
|
|
|
ifeq (1,$(RELEASE))
|
2006-04-13 20:47:06 +00:00
|
|
|
strip mapster32$(EXESUFFIX)
|
2008-10-18 12:37:26 +00:00
|
|
|
endif
|
2006-04-13 20:47:06 +00:00
|
|
|
|
2006-08-31 01:54:23 +00:00
|
|
|
duke3d_w32$(EXESUFFIX): $(OBJ)/wrapper.$o
|
2008-10-18 13:25:23 +00:00
|
|
|
$(LINK_STATUS)
|
2008-10-19 12:14:04 +00:00
|
|
|
if $(CC) $(CFLAGS) $(OURCFLAGS) -o $@ $^ -Wl; then $(LINK_OK); else $(LINK_FAILED); fi
|
2008-10-18 12:37:26 +00:00
|
|
|
ifeq (1,$(RELEASE))
|
2006-05-01 06:52:06 +00:00
|
|
|
strip duke3d_w32$(EXESUFFIX)
|
2008-10-18 12:37:26 +00:00
|
|
|
endif
|
2006-05-01 06:52:06 +00:00
|
|
|
|
2006-04-13 20:47:06 +00:00
|
|
|
include Makefile.deps
|
|
|
|
|
2008-11-12 04:16:41 +00:00
|
|
|
ifneq (0,$(RANCID_NETWORKING))
|
|
|
|
duke3d_h+=$(EINC)/mmulti_unstable.h
|
2008-11-11 14:48:59 +00:00
|
|
|
else
|
|
|
|
duke3d_h+=$(EINC)/mmulti.h
|
|
|
|
endif
|
|
|
|
|
2006-04-13 20:47:06 +00:00
|
|
|
.PHONY: enginelib editorlib
|
|
|
|
enginelib editorlib:
|
2006-11-19 07:09:43 +00:00
|
|
|
-mkdir -p $(EOBJ)
|
2008-10-20 12:33:29 +00:00
|
|
|
ifeq ($(PRETTY_OUTPUT),1)
|
2008-11-20 14:06:36 +00:00
|
|
|
printf "\033[K\033[0;35mChanging dir to \033[1;35m$(CURDIR)/$(EROOT)\033[0;35m \033[0m\n"
|
2008-10-20 12:33:29 +00:00
|
|
|
endif
|
2008-10-20 03:39:35 +00:00
|
|
|
$(MAKE) -C $(EROOT)/ "OBJ=../$(EOBJ)" \
|
2006-04-13 20:47:06 +00:00
|
|
|
SUPERBUILD=$(SUPERBUILD) POLYMOST=$(POLYMOST) \
|
2007-12-13 17:38:46 +00:00
|
|
|
USE_OPENGL=$(USE_OPENGL) BUILD32_ON_64=$(BUILD32_ON_64) \
|
2008-11-12 04:16:41 +00:00
|
|
|
NOASM=$(NOASM) RELEASE=$(RELEASE) OPTLEVEL=$(OPTLEVEL) RANCID_NETWORKING=$(RANCID_NETWORKING) $@
|
2008-10-20 12:33:29 +00:00
|
|
|
ifeq ($(PRETTY_OUTPUT),1)
|
2008-11-20 14:06:36 +00:00
|
|
|
printf "\033[K\033[0;35mChanging dir to \033[1;35m$(CURDIR)\033[0;35m \033[0m\n"
|
2008-10-20 12:33:29 +00:00
|
|
|
endif
|
2006-04-13 20:47:06 +00:00
|
|
|
|
2006-08-31 01:54:23 +00:00
|
|
|
$(EOBJ)/$(ENGINELIB): enginelib
|
|
|
|
$(EOBJ)/$(EDITORLIB): editorlib
|
2006-04-13 20:47:06 +00:00
|
|
|
|
|
|
|
# RULES
|
2006-08-31 01:54:23 +00:00
|
|
|
$(OBJ)/%.$o: $(SRC)/%.nasm
|
2008-10-18 13:25:23 +00:00
|
|
|
$(COMPILE_STATUS)
|
2006-04-13 20:47:06 +00:00
|
|
|
nasm $(NASMFLAGS) $< -o $@
|
2006-08-31 01:54:23 +00:00
|
|
|
$(OBJ)/%.$o: $(SRC)/jaudiolib/%.nasm
|
2008-10-18 13:25:23 +00:00
|
|
|
$(COMPILE_STATUS)
|
2006-04-13 20:47:06 +00:00
|
|
|
nasm $(NASMFLAGS) $< -o $@
|
|
|
|
|
2006-08-31 01:54:23 +00:00
|
|
|
$(OBJ)/%.$o: $(SRC)/%.c
|
2008-10-18 13:25:23 +00:00
|
|
|
$(COMPILE_STATUS)
|
2008-10-19 12:14:04 +00:00
|
|
|
if $(CC) $(CFLAGS) $(OURCFLAGS) -c $< -o $@; then $(COMPILE_OK); else $(COMPILE_FAILED); fi
|
2008-10-18 12:37:26 +00:00
|
|
|
|
2006-08-31 01:54:23 +00:00
|
|
|
$(OBJ)/%.$o: $(SRC)/%.cpp
|
2008-10-18 13:25:23 +00:00
|
|
|
$(COMPILE_STATUS)
|
2008-10-19 12:14:04 +00:00
|
|
|
if $(CXX) $(CXXFLAGS) $(OURCXXFLAGS) $(OURCFLAGS) -c $< -o $@; then $(COMPILE_OK); else $(COMPILE_FAILED); fi
|
2008-10-18 12:37:26 +00:00
|
|
|
|
2006-08-31 01:54:23 +00:00
|
|
|
$(OBJ)/%.$o: $(SRC)/jmact/%.c
|
2008-10-18 13:25:23 +00:00
|
|
|
$(COMPILE_STATUS)
|
2008-10-19 12:14:04 +00:00
|
|
|
if $(CC) $(CFLAGS) $(OURCFLAGS) -c $< -o $@; then $(COMPILE_OK); else $(COMPILE_FAILED); fi
|
2006-08-31 01:54:23 +00:00
|
|
|
$(OBJ)/%.$o: $(SRC)/jaudiolib/%.c
|
2008-10-18 13:25:23 +00:00
|
|
|
$(COMPILE_STATUS)
|
2008-10-19 12:14:04 +00:00
|
|
|
if $(CC) $(CFLAGS) $(OURCFLAGS) -c $< -o $@; then $(COMPILE_OK); else $(COMPILE_FAILED); fi
|
2006-07-14 07:28:32 +00:00
|
|
|
|
2006-08-31 01:54:23 +00:00
|
|
|
$(OBJ)/%.$o: $(SRC)/misc/%.rc
|
2008-10-18 13:25:23 +00:00
|
|
|
$(COMPILE_STATUS)
|
2008-10-19 12:14:04 +00:00
|
|
|
if windres -i $< -o $@ --include-dir=$(EINC) --include-dir=$(SRC); then $(COMPILE_OK); else $(COMPILE_FAILED); fi
|
2006-07-14 07:28:32 +00:00
|
|
|
|
2006-08-31 01:54:23 +00:00
|
|
|
$(OBJ)/%.$o: $(SRC)/util/%.c
|
2008-10-18 13:25:23 +00:00
|
|
|
$(COMPILE_STATUS)
|
2008-10-19 12:14:04 +00:00
|
|
|
if $(CC) $(CFLAGS) $(OURCFLAGS) -c $< -o $@; then $(COMPILE_OK); else $(COMPILE_FAILED); fi
|
2006-04-13 20:47:06 +00:00
|
|
|
|
2006-08-31 01:54:23 +00:00
|
|
|
$(OBJ)/%.$o: $(RSRC)/%.c
|
2008-10-18 13:25:23 +00:00
|
|
|
$(COMPILE_STATUS)
|
2008-10-19 12:14:04 +00:00
|
|
|
if $(CC) $(CFLAGS) $(OURCFLAGS) -c $< -o $@; then $(COMPILE_OK); else $(COMPILE_FAILED); fi
|
2006-04-13 20:47:06 +00:00
|
|
|
|
2006-08-31 01:54:23 +00:00
|
|
|
$(OBJ)/game_banner.$o: $(RSRC)/game_banner.c
|
|
|
|
$(OBJ)/editor_banner.$o: $(RSRC)/editor_banner.c
|
|
|
|
$(RSRC)/game_banner.c: $(RSRC)/game.bmp
|
2006-04-13 20:47:06 +00:00
|
|
|
echo "#include <gdk-pixbuf/gdk-pixdata.h>" > $@
|
|
|
|
gdk-pixbuf-csource --extern --struct --raw --name=startbanner_pixdata $^ | sed 's/load_inc//' >> $@
|
2006-08-31 01:54:23 +00:00
|
|
|
$(RSRC)/editor_banner.c: $(RSRC)/build.bmp
|
2006-04-13 20:47:06 +00:00
|
|
|
echo "#include <gdk-pixbuf/gdk-pixdata.h>" > $@
|
|
|
|
gdk-pixbuf-csource --extern --struct --raw --name=startbanner_pixdata $^ | sed 's/load_inc//' >> $@
|
|
|
|
|
|
|
|
# PHONIES
|
2008-08-20 22:58:09 +00:00
|
|
|
|
2006-04-13 20:47:06 +00:00
|
|
|
clean:
|
2008-10-18 12:37:26 +00:00
|
|
|
-rm -f $(OBJ)/* eduke32$(EXESUFFIX) mapster32$(EXESUFFIX) core* duke3d_w32$(EXESUFFIX)
|
2006-04-13 20:47:06 +00:00
|
|
|
|
|
|
|
veryclean: clean
|
2006-08-31 01:54:23 +00:00
|
|
|
-rm -f $(EOBJ)/*
|