1999-12-29 13:58:47 +00:00
|
|
|
########################################################################
|
|
|
|
#
|
|
|
|
# Quake general stuff
|
|
|
|
#
|
1999-12-30 13:40:47 +00:00
|
|
|
|
1999-12-31 02:10:33 +00:00
|
|
|
PROJECT_DIR = @top_srcdir@
|
|
|
|
SRC_DIR = @srcdir@
|
|
|
|
|
1999-12-30 13:40:47 +00:00
|
|
|
COMMON_DIR=$(PROJECT_DIR)/common
|
1999-12-31 02:10:33 +00:00
|
|
|
QW_COMMON_DIR= $(PROJECT_DIR)/qw_common
|
1999-12-31 06:54:05 +00:00
|
|
|
BUILD_DIR = ../targets/qw_server
|
1999-12-30 13:40:47 +00:00
|
|
|
|
|
|
|
LDFLAGS = @LDFLAGS@
|
|
|
|
LIBS = @LIBS@
|
|
|
|
CC = @CC@
|
|
|
|
INTEL_ARCH = @INTEL_ARCH@
|
|
|
|
|
|
|
|
ifneq ($(SRC_DIR),.)
|
|
|
|
SRC_DIR_INC = -I$(SRC_DIR)
|
|
|
|
endif
|
|
|
|
|
|
|
|
MAKE_SURE_DIR = if test -d "$(BUILD_DIR)/$$DIR"; \
|
|
|
|
then \
|
|
|
|
true; \
|
|
|
|
else \
|
|
|
|
echo "Creating directory $(BUILD_DIR)/$$DIR"; \
|
|
|
|
mkdir -p $(BUILD_DIR)/$$DIR; \
|
|
|
|
fi
|
|
|
|
|
1999-12-29 13:58:47 +00:00
|
|
|
|
|
|
|
########################################################################
|
|
|
|
#
|
|
|
|
# Source files
|
|
|
|
#
|
1999-12-30 13:40:47 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# System specific source files
|
|
|
|
#
|
|
|
|
|
|
|
|
QW_SRV_SYS_SRC = @QW_SRV_SYS_SRC@
|
|
|
|
|
|
|
|
#
|
|
|
|
# Networking source files
|
|
|
|
#
|
|
|
|
# XXX - Should not assume UNIX
|
2000-01-01 11:18:00 +00:00
|
|
|
QW_NET_SRC = net_udp.c net_com.c mdfour.c
|
1999-12-30 13:40:47 +00:00
|
|
|
|
|
|
|
|
|
|
|
#
|
|
|
|
# Server source files
|
|
|
|
#
|
|
|
|
# Server-related source used by all
|
|
|
|
SRV_SRC = sv_main.c sv_user.c sv_move.c sv_phys.c
|
|
|
|
# Server-related source used just by QW server
|
|
|
|
QW_SRV_SRC = sv_ccmds.c sv_ents.c sv_init.c sv_send.c sv_nchan.c world.c
|
|
|
|
# Server-related source used just by UQ
|
|
|
|
SRV_PR_SRC = pr_cmds.c pr_edict.c pr_exec.c
|
|
|
|
|
|
|
|
|
|
|
|
QW_GENERAL_SRC = pmove.c pmovetst.c
|
|
|
|
|
1999-12-29 13:58:47 +00:00
|
|
|
|
|
|
|
########################################################################
|
|
|
|
#
|
|
|
|
# Directory specific stuff
|
|
|
|
#
|
1999-12-31 06:54:05 +00:00
|
|
|
CFLAGS = -DQUAKEWORLD -DSERVERONLY $(OPTFLAGS) $(DEFS) -I. $(SRC_DIR_INC) \
|
|
|
|
-I$(QW_COMMON_DIR) -I$(COMMON_DIR) -I../common
|
1999-12-29 13:58:47 +00:00
|
|
|
DEFS = @DEFS@ @STRICMP_DEF@
|
|
|
|
|
|
|
|
SRVQUAKE = qw-server
|
|
|
|
targets = $(SRVQUAKE)
|
|
|
|
.PHONY: $(SRVQUAKE)
|
|
|
|
|
|
|
|
GENERAL_SRC = common.c crc.c cvar.c cmd.c mathlib.c wad.c zone.c \
|
|
|
|
$(QW_NET_SRC) net_chan.c $(SRV_SRC) $(QW_SRV_SRC) \
|
1999-12-31 02:10:33 +00:00
|
|
|
$(SRV_PR_SRC) $(QW_SRV_SYS_SRC) $(QW_GENERAL_SRC)
|
|
|
|
ALL_QW_SRV_SRC = $(GENERAL_SRC) model.c
|
1999-12-29 13:58:47 +00:00
|
|
|
# XXX - add dos/win specifc source
|
|
|
|
|
|
|
|
x: Makefile
|
|
|
|
@echo binaries: $(targets)
|
|
|
|
@echo other targets: distclean
|
|
|
|
|
|
|
|
all: $(targets)
|
|
|
|
|
|
|
|
###########################################################################
|
|
|
|
#
|
|
|
|
# qw-server
|
|
|
|
#
|
|
|
|
OBJSqw-server = $(patsubst %,$(BUILD_DIR)/srv/%, \
|
|
|
|
$(addsuffix .@OBJEXT@, $(basename $(ALL_QW_SRV_SRC) .c .s)))
|
|
|
|
|
|
|
|
SRV_CFLAGS = -DSRV $(X_CFLAGS)
|
|
|
|
# XXX - Don't use X_EXTRA_LIBS below
|
|
|
|
SRV_LDFLAGS = @X_EXTRA_LIBS@ -lm
|
|
|
|
|
|
|
|
MAKE_SURE_srv_DIR = @DIR=srv; $(MAKE_SURE_DIR)
|
|
|
|
$(BUILD_DIR)/srv/%.o: $(SRC_DIR)/%.c
|
|
|
|
$(MAKE_SURE_srv_DIR)
|
|
|
|
$(CC) $(CFLAGS) $(SRV_CFLAGS) -o $@ -c $<
|
|
|
|
|
|
|
|
$(BUILD_DIR)/srv/%.o: $(SRC_DIR)/%.s
|
|
|
|
$(MAKE_SURE_srv_DIR)
|
|
|
|
$(CC) $(CFLAGS) -DELF -x assembler-with-cpp -o $@ -c $<
|
|
|
|
|
|
|
|
$(BUILD_DIR)/srv/%.o: $(COMMON_DIR)/%.c
|
|
|
|
$(MAKE_SURE_srv_DIR)
|
|
|
|
$(CC) $(CFLAGS) $(SRV_CFLAGS) -o $@ -c $<
|
|
|
|
|
|
|
|
$(BUILD_DIR)/srv/%.o: $(QW_COMMON_DIR)/%.c
|
|
|
|
$(MAKE_SURE_srv_DIR)
|
|
|
|
$(CC) $(CFLAGS) $(SRV_CFLAGS) -o $@ -c $<
|
|
|
|
|
|
|
|
$(BUILD_DIR)/srv/%.o: $(COMMON_DIR)/%.s
|
|
|
|
$(MAKE_SURE_srv_DIR)
|
|
|
|
$(CC) $(CFLAGS) -DELF -x assembler-with-cpp -o $@ -c $<
|
|
|
|
|
1999-12-31 02:40:35 +00:00
|
|
|
$(SRVQUAKE): $(BUILD_DIR)/../$(SRVQUAKE)
|
1999-12-29 13:58:47 +00:00
|
|
|
|
1999-12-31 02:40:35 +00:00
|
|
|
$(BUILD_DIR)/../$(SRVQUAKE): $(OBJSqw-server)
|
|
|
|
$(CC) $(CFLAGS) $(OBJSqw-server) $(SRV_LDFLAGS) $(LDFLAGS) -o $(BUILD_DIR)/../$(SRVQUAKE)
|
1999-12-29 13:58:47 +00:00
|
|
|
# XXX - Can this be automated?
|
|
|
|
clean-$(SRVQUAKE):
|
|
|
|
rm -f $(OBJSqw-server)
|
|
|
|
|
|
|
|
clean: clean-$(SRVQUAKE)
|
|
|
|
|
1999-12-30 13:40:47 +00:00
|
|
|
###########################################################################
|
|
|
|
#
|
|
|
|
# cleaning (clean, distclean)
|
|
|
|
#
|
|
|
|
distclean: clean
|
|
|
|
rm -f config.cache config.log config.status Makefile
|
|
|
|
|
|
|
|
clean: $(CLEAN_TARGETS)
|
|
|
|
|
|
|
|
install:
|
|
|
|
@echo Install not implemented
|
|
|
|
|
|
|
|
check:
|
|
|
|
@echo check not implemented
|