mirror of
https://git.code.sf.net/p/quake/quakeforge-old
synced 2024-11-26 13:50:51 +00:00
ee9f745b14
places in the various Makefile.in's. Having them all in the module root like that may make it easy to make a change that affects everything all at once but it's real bitch to try and maintain those files. They're all gone now and we'll just have to maintain the seperate makefiles.
214 lines
5.4 KiB
Makefile
214 lines
5.4 KiB
Makefile
########################################################################
|
|
#
|
|
# Quake general stuff
|
|
#
|
|
|
|
COMMON_DIR=$(PROJECT_DIR)/common
|
|
ifeq ($(BUILD_DIR),)
|
|
BUILD_DIR = .
|
|
endif
|
|
|
|
LDFLAGS = @LDFLAGS@
|
|
LIBS = @LIBS@
|
|
CC = @CC@
|
|
INTEL_ARCH = @INTEL_ARCH@
|
|
|
|
ifneq ($(SRC_DIR),.)
|
|
SRC_DIR_INC = -I$(SRC_DIR)
|
|
endif
|
|
|
|
HAS_VGA = @HAS_VGA@
|
|
HAS_GLIDE = @HAS_GLIDE@
|
|
HAS_TDFXGL = @HAS_TDFXGL@
|
|
HAS_OGL = @HAS_OGL@
|
|
HAS_XIL = @HAS_XIL@
|
|
HAS_X11 = @HAS_X11@
|
|
|
|
MAKE_SURE_DIR = if test -d "$(BUILD_DIR)/$$DIR"; \
|
|
then \
|
|
true; \
|
|
else \
|
|
echo "Creating directory $(BUILD_DIR)/$$DIR"; \
|
|
mkdir -p $(BUILD_DIR)/$$DIR; \
|
|
fi
|
|
MAKE_SURE_bin_DIR = @DIR=bin; \
|
|
$(MAKE_SURE_DIR)
|
|
|
|
|
|
|
|
PROJECT_DIR = @top_srcdir@
|
|
SRC_DIR = @srcdir@
|
|
QW_COMMON_DIR= $(PROJECT_DIR)/qw_common
|
|
|
|
########################################################################
|
|
#
|
|
# Source files
|
|
#
|
|
|
|
# **** Note - two apps may appear to share source, but they may just share
|
|
# source file *names*
|
|
|
|
ifeq ($(INTEL_ARCH),yes)
|
|
# Source file the Intel archictecture only
|
|
UQ_GENERAL_SRC = worlda.s
|
|
UQ_SWREND_SRC_PLAT = dosasm.s
|
|
CL_ADDITIONAL_GENERAL_SRC = sys_dosa.s math.s
|
|
SWREND_SRC_PLAT = d_copy.s d_draw.s d_draw16.s d_parta.s d_polysa.s d_scana.s \
|
|
d_spr8.s d_varsa.s r_aclipa.s r_aliasa.s \
|
|
r_drawa.s r_edgea.s r_varsa.s surf16.s surf8.s
|
|
else
|
|
# Source files for non-Intel platforms
|
|
SWREND_SRC_PLAT = nonintel.c
|
|
endif
|
|
|
|
#
|
|
# System specific source files
|
|
#
|
|
CD_AUDIO_SRC = @CD_AUDIO_SRC@
|
|
|
|
MACH_SND_SRC = @SND_SRC@
|
|
|
|
X11_VID_SRC = @X11_VID_SRC@
|
|
QW_X11_VID_SRC = vid_x.c
|
|
|
|
SYS_SRC = @SYS_SRC@
|
|
QW_CL_SYS_SRC = @QW_CL_SYS_SRC@
|
|
QW_SRV_SYS_SRC = @QW_SRV_SYS_SRC@
|
|
|
|
#
|
|
# Networking source files
|
|
#
|
|
# XXX - Should not assume UNIX
|
|
NET_SRC = net_bsd.c net_udp.c
|
|
QW_NET_SRC = net_udp.c md4.c
|
|
UQ_NET_SRC = net_dgrm.c net_loop.c net_main.c net_vcr.c $(NET_SRC)
|
|
|
|
#
|
|
# Common source files
|
|
#
|
|
MISC_SRC = common.c crc.c cvar.c cmd.c mathlib.c wad.c zone.c
|
|
SND_SRC = snd_mem.c snd_mix.c $(MACH_SND_SRC)
|
|
|
|
#
|
|
# Rendering source files
|
|
#
|
|
|
|
# OpenGL
|
|
GL_REND_SRC = gl_screen.c gl_model.c gl_draw.c gl_mesh.c gl_refrag.c \
|
|
gl_rlight.c gl_rmain.c gl_rmisc.c gl_rsurf.c gl_test.c gl_warp.c
|
|
QW_GL_REND_SRC = gl_ngraph.c
|
|
|
|
# Software source
|
|
SW_REND_SRC = screen.c $(SWREND_SRC_PLAT) draw.c \
|
|
d_edge.c d_fill.c d_init.c d_modech.c d_part.c d_polyse.c d_scan.c \
|
|
d_sky.c d_sprite.c d_surf.c d_vars.c d_zpoint.c r_aclip.c r_alias.c \
|
|
r_bsp.c r_draw.c r_edge.c r_efrag.c r_light.c r_main.c r_misc.c \
|
|
r_sky.c r_sprite.c r_surf.c r_vars.c
|
|
|
|
#
|
|
# Client source files
|
|
#
|
|
CL_SRC = cl_demo.c cl_input.c cl_main.c cl_parse.c cl_tent.c
|
|
QW_CL_SRC = cl_cam.c cl_ents.c cl_pred.c
|
|
CL_GUI_SRC= console.c sbar.c view.c keys.c menu.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
|
|
UQ_SRV_SRC = host.c host_cmd.c $(SRV_SRC)
|
|
SRV_PR_SRC = pr_cmds.c pr_edict.c pr_exec.c
|
|
|
|
|
|
QW_GENERAL_SRC = pmove.c pmovetst.c
|
|
|
|
# Source common to both UQ and QW-client
|
|
CL_COMMON_SRC = $(MISC_SRC) $(CL_GUI_SRC) $(CL_SRC) \
|
|
$(CL_ADDITIONAL_GENERAL_SRC) $(SND_SRC) $(CD_AUDIO_SRC) r_part.c
|
|
|
|
|
|
########################################################################
|
|
#
|
|
# Directory specific stuff
|
|
#
|
|
CFLAGS = -DQUAKEWORLD -DSERVERONLY $(OPTFLAGS) $(DEFS) -I. $(SRC_DIR_INC) -I$(QW_COMMON_DIR) -I$(COMMON_DIR)
|
|
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) $(ADDITIONAL_GENERAL_SRC) \
|
|
$(QW_GENERAL_SRC)
|
|
ALL_QW_SRV_SRC = $(GENERAL_SRC) $(SRV_VID_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)/bin/$(SRVQUAKE)
|
|
|
|
$(BUILD_DIR)/bin/$(SRVQUAKE): $(OBJSqw-server)
|
|
$(MAKE_SURE_bin_DIR)
|
|
$(CC) $(CFLAGS) $(OBJSqw-server) $(SRV_LDFLAGS) $(LDFLAGS) -o $(BUILD_DIR)/bin/$(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
|