163 lines
2.3 KiB
Plaintext
Executable file
163 lines
2.3 KiB
Plaintext
Executable file
#this file must be included in all makefiles right after TOPDIR is defined
|
|
#reads the build settings and corrects unusable configurations
|
|
|
|
include $(TOPDIR)/config
|
|
|
|
#version defines
|
|
|
|
D1XMAJOR = 0
|
|
D1XMINOR = 42
|
|
|
|
CFLAGS += -DD1XMAJOR=\"$(D1XMAJOR)\" -DD1XMINOR=\"$(D1XMINOR)\"
|
|
|
|
CFLAGS += -D DESCENT_DATA_PATH=\"$(DESCENT_DATA_PATH)\"
|
|
|
|
DESTDIR = $(TOPDIR)/$(DESTINATION_DIR)
|
|
|
|
LIBDIR = $(TOPDIR)/lib
|
|
|
|
OBJDIR = build
|
|
|
|
#use general include directory
|
|
|
|
CFLAGS += -I$(TOPDIR)/include -I$(TOPDIR)/main
|
|
|
|
#always support netip code
|
|
|
|
SUPPORTS_NET_IP = 1
|
|
|
|
#enabled dependant features
|
|
|
|
ifdef WGL_IO
|
|
OGL = 1
|
|
endif
|
|
|
|
ifdef SDLGL_IO
|
|
SDL_INPUT = 1
|
|
OGL = 1
|
|
SDL = 1
|
|
endif
|
|
|
|
ifdef SDL_IO
|
|
SDL_INPUT = 1
|
|
SDL_VIDEO = 1
|
|
SDL = 1
|
|
endif
|
|
|
|
ifdef SDL_AUDIO
|
|
SDL = 1
|
|
endif
|
|
|
|
#defines for features
|
|
|
|
ifndef MONO
|
|
CFLAGS += -DNMONO
|
|
endif
|
|
|
|
ifndef NETWORK
|
|
SUPPORTS_NET_IP = false
|
|
endif
|
|
|
|
ifdef SUPPORTS_NET_IP
|
|
CFLAGS += -DSUPPORTS_NET_IP
|
|
endif
|
|
|
|
ifdef NETWORK
|
|
CFLAGS += -DNETWORK
|
|
endif
|
|
|
|
ifdef RELEASE
|
|
CFLAGS += -DRELEASE
|
|
endif
|
|
|
|
ifdef SHAREWARE
|
|
NO_RL2 = 1
|
|
CFLAGS += -DSHAREWARE
|
|
endif
|
|
|
|
ifdef NO_ASM
|
|
CFLAGS += -DNO_ASM
|
|
endif
|
|
|
|
ifdef NOERROR
|
|
CFLAGS += -Werror
|
|
endif
|
|
|
|
ifdef MAKE_EDITOR
|
|
NO_RL2 = 1
|
|
CFLAGS += -DEDITOR -I.
|
|
endif
|
|
|
|
ifdef OGL
|
|
ifdef OGL_RUNTIME
|
|
CFLAGS += -DOGL_RUNTIME_LOAD
|
|
endif
|
|
CFLAGS += -I$(TOPDIR)/arch/ogl/include
|
|
CFLAGS += -DOGL
|
|
endif
|
|
|
|
ifdef SDL
|
|
CFLAGS += -D__SDL__
|
|
ifdef SDLGL_IO
|
|
CFLAGS += -DSDL_GL
|
|
endif
|
|
ifdef SDL_INPUT
|
|
CFLAGS += -I$(TOPDIR)/arch/sdl/include
|
|
CFLAGS += -DSDL_INPUT
|
|
endif
|
|
ifdef SDL_VIDEO
|
|
CFLAGS += -DSDL_VIDEO
|
|
endif
|
|
ifdef SDL_AUDIO
|
|
CFLAGS += -DSDL_AUDIO
|
|
endif
|
|
endif
|
|
|
|
ifdef ENV_CYGWIN
|
|
ENV_MINGW32 = 1
|
|
endif
|
|
|
|
ifdef ENV_MINGW32
|
|
CFLAGS += -I$(TOPDIR)/arch/win32/include
|
|
CFLAGS += -D__WINDOWS__
|
|
NASM = nasmw -f win32
|
|
endif
|
|
|
|
ifdef ENV_LINUX
|
|
CFLAGS += -I$(TOPDIR)/arch/linux/include
|
|
CFLAGS += -D__LINUX__
|
|
ifdef GLIBC
|
|
CFLAGS += -D_REENTRANT
|
|
endif
|
|
NASM = nasm -f elf -D__LINUX__
|
|
ifdef HAVENETIPX
|
|
CFLAGS += -DHAVE_NETIPX_IPX_H
|
|
endif
|
|
endif
|
|
|
|
# definitions for gcc
|
|
|
|
OBJ = o
|
|
LIB = a
|
|
CC = gcc
|
|
CXX = g++
|
|
ifdef DEBUG
|
|
CFLAGS += -c -Wall $(OPTFLAGS) -funsigned-char
|
|
else
|
|
CFLAGS += -c -Wall $(OPTFLAGS) -funsigned-char -DNDEBUG
|
|
ifndef DEBUGABLE
|
|
CFLAGS += -fomit-frame-pointer
|
|
endif
|
|
endif
|
|
ifdef MINGW_EXTRA
|
|
CFLAGS += -I$(MINGW_EXTRA)/include
|
|
LFLAGS += -L$(MINGW_EXTRA)/lib
|
|
endif
|
|
ifdef ENV_CYGWIN
|
|
CFLAGS += -mno-cygwin
|
|
LFLAGS += -mno-cygwin
|
|
endif
|
|
ifdef PROFILE
|
|
CFLAGS += -p
|
|
LFLAGS += -p
|
|
endif |