1999-12-29 13:58:47 +00:00
|
|
|
########################################################################
|
|
|
|
#
|
|
|
|
# Quake general stuff
|
|
|
|
#
|
1999-12-30 13:40:47 +00:00
|
|
|
|
2000-01-04 21:29:10 +00:00
|
|
|
PROJECT_DIR = @top_srcdir@
|
|
|
|
PROJECT_ODIR = ..
|
|
|
|
SRC_DIR = @srcdir@
|
|
|
|
QW_COMMON_DIR = $(PROJECT_DIR)/qw_common
|
|
|
|
COMMON_DIR = $(PROJECT_DIR)/common
|
|
|
|
COMMON_ODIR = $(PROJECT_ODIR)/common
|
|
|
|
BIN_PREFIX = qw-server
|
1999-12-31 02:10:33 +00:00
|
|
|
|
2000-01-04 21:29:10 +00:00
|
|
|
DESTDIR =
|
2000-01-03 08:03:01 +00:00
|
|
|
|
2000-01-04 21:29:10 +00:00
|
|
|
prefix = @prefix@
|
2000-01-08 21:35:03 +00:00
|
|
|
exec_prefix = @exec_prefix@
|
2000-01-04 21:29:10 +00:00
|
|
|
bindir = @bindir@
|
|
|
|
mandir = @mandir@
|
2000-01-03 08:03:01 +00:00
|
|
|
|
2000-01-04 21:29:10 +00:00
|
|
|
BUILD_DIR = $(PROJECT_ODIR)/targets/qw_server
|
1999-12-30 13:40:47 +00:00
|
|
|
|
2000-01-04 22:59:57 +00:00
|
|
|
LDFLAGS = @LDFLAGS@ @NET_LIBS@ -lm
|
1999-12-30 13:40:47 +00:00
|
|
|
LIBS = @LIBS@
|
|
|
|
CC = @CC@
|
|
|
|
INTEL_ARCH = @INTEL_ARCH@
|
|
|
|
|
|
|
|
ifneq ($(SRC_DIR),.)
|
|
|
|
SRC_DIR_INC = -I$(SRC_DIR)
|
|
|
|
endif
|
|
|
|
|
1999-12-29 13:58:47 +00:00
|
|
|
|
|
|
|
########################################################################
|
|
|
|
#
|
|
|
|
# Source files
|
|
|
|
#
|
1999-12-30 13:40:47 +00:00
|
|
|
|
2000-01-06 16:56:38 +00:00
|
|
|
QW_SRV_SYS_SRC = sys_common.c @QW_SRV_SYS_SRC@
|
1999-12-30 13:40:47 +00:00
|
|
|
|
|
|
|
# Networking source files
|
2000-01-05 19:45:44 +00:00
|
|
|
# FIXME: Should not assume UNIX
|
1999-12-30 13:40:47 +00:00
|
|
|
|
2000-01-05 19:45:44 +00:00
|
|
|
QW_NET_SRC = net_udp.c net_com.c mdfour.c
|
1999-12-30 13:40:47 +00:00
|
|
|
|
|
|
|
# Server source files
|
2000-01-05 19:45:44 +00:00
|
|
|
|
1999-12-30 13:40:47 +00:00
|
|
|
SRV_SRC = sv_main.c sv_user.c sv_move.c sv_phys.c
|
|
|
|
QW_SRV_SRC = sv_ccmds.c sv_ents.c sv_init.c sv_send.c sv_nchan.c world.c
|
|
|
|
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
|
|
|
|
#
|
2000-01-03 08:03:01 +00:00
|
|
|
CFLAGS = @CFLAGS@ -DQUAKEWORLD -DSERVERONLY $(OPTFLAGS) $(DEFS) -I. \
|
2000-01-04 21:29:10 +00:00
|
|
|
$(SRC_DIR_INC) -I$(QW_COMMON_DIR) -I$(COMMON_ODIR) -I$(COMMON_DIR)
|
2000-01-03 08:03:01 +00:00
|
|
|
DEFS = @DEFS@
|
1999-12-29 13:58:47 +00:00
|
|
|
|
|
|
|
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) \
|
2000-01-03 01:40:54 +00:00
|
|
|
$(SRV_PR_SRC) $(QW_SRV_SYS_SRC) $(QW_GENERAL_SRC) \
|
|
|
|
register_check.c
|
1999-12-31 02:10:33 +00:00
|
|
|
ALL_QW_SRV_SRC = $(GENERAL_SRC) model.c
|
2000-01-05 19:45:44 +00:00
|
|
|
# FIXME: add dos/win specifc source
|
1999-12-29 13:58:47 +00:00
|
|
|
|
|
|
|
|
|
|
|
all: $(targets)
|
|
|
|
|
2000-01-05 19:45:44 +00:00
|
|
|
|
1999-12-29 13:58:47 +00:00
|
|
|
###########################################################################
|
|
|
|
#
|
2000-01-05 19:45:44 +00:00
|
|
|
# QuakeWorld server target
|
1999-12-29 13:58:47 +00:00
|
|
|
#
|
2000-01-05 19:45:44 +00:00
|
|
|
|
|
|
|
ALL_SRV_OBJS = $(patsubst %,$(BUILD_DIR)/%, $(addsuffix .@OBJEXT@,\
|
|
|
|
$(basename $(ALL_QW_SRV_SRC) .c .s)))
|
1999-12-29 13:58:47 +00:00
|
|
|
|
|
|
|
SRV_CFLAGS = -DSRV $(X_CFLAGS)
|
2000-01-05 19:45:44 +00:00
|
|
|
# FIXME: Don't use X_EXTRA_LIBS below
|
2000-01-03 10:25:01 +00:00
|
|
|
SRV_LDFLAGS = @X_EXTRA_LIBS@
|
1999-12-29 13:58:47 +00:00
|
|
|
|
2000-01-04 12:02:27 +00:00
|
|
|
srv_DIR:
|
2000-01-05 19:45:44 +00:00
|
|
|
mkdir -p $(BUILD_DIR)
|
2000-01-04 12:02:27 +00:00
|
|
|
|
2000-01-05 19:45:44 +00:00
|
|
|
$(BUILD_DIR)/%.o: $(SRC_DIR)/%.c
|
1999-12-29 13:58:47 +00:00
|
|
|
$(CC) $(CFLAGS) $(SRV_CFLAGS) -o $@ -c $<
|
|
|
|
|
2000-01-05 19:45:44 +00:00
|
|
|
$(BUILD_DIR)/%.o: $(SRC_DIR)/%.s
|
2000-01-06 01:06:17 +00:00
|
|
|
$(CC) $(CFLAGS) -x assembler-with-cpp -o $@ -c $<
|
1999-12-29 13:58:47 +00:00
|
|
|
|
2000-01-05 19:45:44 +00:00
|
|
|
$(BUILD_DIR)/%.o: $(COMMON_DIR)/%.c
|
1999-12-29 13:58:47 +00:00
|
|
|
$(CC) $(CFLAGS) $(SRV_CFLAGS) -o $@ -c $<
|
|
|
|
|
2000-01-05 19:45:44 +00:00
|
|
|
$(BUILD_DIR)/%.o: $(QW_COMMON_DIR)/%.c
|
1999-12-29 13:58:47 +00:00
|
|
|
$(CC) $(CFLAGS) $(SRV_CFLAGS) -o $@ -c $<
|
|
|
|
|
2000-01-05 19:45:44 +00:00
|
|
|
$(BUILD_DIR)/%.o: $(COMMON_DIR)/%.s
|
2000-01-06 01:06:17 +00:00
|
|
|
$(CC) $(CFLAGS) -x assembler-with-cpp -o $@ -c $<
|
1999-12-29 13:58:47 +00:00
|
|
|
|
2000-01-04 12:02:27 +00:00
|
|
|
$(SRVQUAKE): srv_DIR $(BUILD_DIR)/../$(SRVQUAKE)
|
1999-12-29 13:58:47 +00:00
|
|
|
|
2000-01-05 19:45:44 +00:00
|
|
|
$(BUILD_DIR)/../$(SRVQUAKE): $(ALL_SRV_OBJS)
|
2000-01-05 22:12:51 +00:00
|
|
|
$(CC) $(CFLAGS) $(ALL_SRV_OBJS) $(SRV_LDFLAGS) $(LDFLAGS) $(LIBS) \
|
2000-01-05 19:45:44 +00:00
|
|
|
-o $(BUILD_DIR)/../$(SRVQUAKE)
|
1999-12-29 13:58:47 +00:00
|
|
|
|
|
|
|
|
1999-12-30 13:40:47 +00:00
|
|
|
###########################################################################
|
|
|
|
#
|
2000-01-05 19:45:44 +00:00
|
|
|
# Misc Targets
|
1999-12-30 13:40:47 +00:00
|
|
|
#
|
2000-01-05 19:45:44 +00:00
|
|
|
|
1999-12-30 13:40:47 +00:00
|
|
|
distclean: clean
|
|
|
|
rm -f config.cache config.log config.status Makefile
|
|
|
|
|
2000-01-05 19:57:35 +00:00
|
|
|
clean: $(CLEAN_TARGETS)
|
2000-01-06 01:06:17 +00:00
|
|
|
rm -rf $(BUILD_DIR)
|
2000-01-05 19:45:44 +00:00
|
|
|
|
2000-01-03 08:03:01 +00:00
|
|
|
install: $(targets)
|
2000-01-08 21:35:03 +00:00
|
|
|
$(PROJECT_DIR)/mkinstalldirs $(DESTDIR)/$(bindir)
|
2000-01-03 08:03:01 +00:00
|
|
|
for i in $(targets); do \
|
|
|
|
$(PROJECT_DIR)/install-sh -m 755 $(BUILD_DIR)/../$$i \
|
2000-01-08 21:35:03 +00:00
|
|
|
$(DESTDIR)/$(bindir)/$$i; \
|
2000-01-03 08:03:01 +00:00
|
|
|
done
|
1999-12-30 13:40:47 +00:00
|
|
|
|
|
|
|
check:
|
|
|
|
@echo check not implemented
|
2000-01-05 19:45:44 +00:00
|
|
|
|