mirror of
https://git.code.sf.net/p/quake/quakeforge-old
synced 2024-11-25 05:11:23 +00:00
7d08fbe4fe
connect it all. Also modified Makefile.in for qw-(client|server) to use them.
142 lines
3.3 KiB
Makefile
142 lines
3.3 KiB
Makefile
########################################################################
|
|
#
|
|
# Quake general stuff
|
|
#
|
|
|
|
PROJECT_DIR = @top_srcdir@
|
|
SRC_DIR = @srcdir@
|
|
|
|
COMMON_DIR=$(PROJECT_DIR)/common
|
|
QW_COMMON_DIR= $(PROJECT_DIR)/qw_common
|
|
BUILD_DIR = ../targets/qw_server
|
|
|
|
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
|
|
|
|
|
|
########################################################################
|
|
#
|
|
# Source files
|
|
#
|
|
|
|
#
|
|
# System specific source files
|
|
#
|
|
|
|
QW_SRV_SYS_SRC = @QW_SRV_SYS_SRC@
|
|
|
|
#
|
|
# Networking source files
|
|
#
|
|
# XXX - Should not assume UNIX
|
|
QW_NET_SRC = net_udp.c net_com.c mdfour.c
|
|
|
|
|
|
#
|
|
# 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
|
|
|
|
|
|
########################################################################
|
|
#
|
|
# Directory specific stuff
|
|
#
|
|
CFLAGS = -DQUAKEWORLD -DSERVERONLY $(OPTFLAGS) $(DEFS) -I. $(SRC_DIR_INC) \
|
|
-I$(QW_COMMON_DIR) -I$(COMMON_DIR) -I../common
|
|
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) \
|
|
$(SRV_PR_SRC) $(QW_SRV_SYS_SRC) $(QW_GENERAL_SRC)
|
|
ALL_QW_SRV_SRC = $(GENERAL_SRC) model.c
|
|
# 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 $<
|
|
|
|
$(SRVQUAKE): $(BUILD_DIR)/../$(SRVQUAKE)
|
|
|
|
$(BUILD_DIR)/../$(SRVQUAKE): $(OBJSqw-server)
|
|
$(CC) $(CFLAGS) $(OBJSqw-server) $(SRV_LDFLAGS) $(LDFLAGS) -o $(BUILD_DIR)/../$(SRVQUAKE)
|
|
# XXX - Can this be automated?
|
|
clean-$(SRVQUAKE):
|
|
rm -f $(OBJSqw-server)
|
|
|
|
clean: clean-$(SRVQUAKE)
|
|
|
|
###########################################################################
|
|
#
|
|
# 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
|