diff --git a/Makefile.in b/Makefile.in index e8ea787..6f92011 100644 --- a/Makefile.in +++ b/Makefile.in @@ -7,10 +7,7 @@ all: done distclean: - rm -f config.cache config.log config.status \ - Makefile.header Makefile.client Makefile.comp_rules \ - Makefile.source Makefile.tail Makefile \ - client pre post rules srcfiles + rm -f config.cache config.log config.status Makefile for dir in $(SUBDIRS); do \ $(MAKE) -C $$dir $@ || exit; \ done diff --git a/client.in b/client.in deleted file mode 100644 index 06142c1..0000000 --- a/client.in +++ /dev/null @@ -1,34 +0,0 @@ -ifneq ($(HAS_OGL),) -GLQUAKE =$(BIN_PREFIX)-gl -endif - -# FIX: Add 3dfxgl targets -ifneq ($(HAS_TDFXGL),) -TDFXQUAKE= $(BIN_PREFIX)-3dfx -endif - -ifneq ($(HAS_X11),) -X11QUAKE = $(BIN_PREFIX)-x11 -endif - -ifneq ($(HAS_VGA),) -SVGAQUAKE = $(BIN_PREFIX)-svga -endif - -RELEASE = @RELEASE@ -ifeq ($(RELEASE),yes) -OPTFLAGS = @RELEASE_CFLAGS@ -else -OPTFLAGS = -g -endif - -targets = $(SVGAQUAKE) $(GLQUAKE) $(TDFXQUAKE) $(X11QUAKE) -CLEAN_TARGETS = $(patsubst %,clean-%, $(targets)) -.PHONY: $(targets) ($CLEAN_TARGETS) - -x: Makefile - @echo binaries: $(targets) - @echo other targets: distclean - @echo all: makes all targets - $(targets) - -all: $(targets) diff --git a/configure b/configure index 21468d6..bffb6d1 100755 --- a/configure +++ b/configure @@ -3536,20 +3536,10 @@ fi # -MAKEFILE_HEADER=pre -MAKEFILE_TAIL=post -CLIENT_TARGETS=client - - -SRCFILES=srcfiles - - -COMP_RULES=rules - ########################################################## # # Output files @@ -3666,8 +3656,7 @@ done ac_given_srcdir=$srcdir -trap 'rm -fr `echo "pre post client srcfiles rules - qw_client/Makefile qw_server/Makefile uquake/Makefile Makefile" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 +trap 'rm -fr `echo "qw_client/Makefile qw_server/Makefile uquake/Makefile Makefile" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 EOF cat >> $CONFIG_STATUS <> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then diff --git a/configure.in b/configure.in index 822b3ed..9dfbeb4 100644 --- a/configure.in +++ b/configure.in @@ -390,24 +390,23 @@ AC_PATH_XTRA # make Makefile.header, Makefile.tail # -AC_SUBST_FILE(MAKEFILE_HEADER) -MAKEFILE_HEADER=pre +dnl AC_SUBST_FILE(MAKEFILE_HEADER) +dnl MAKEFILE_HEADER=pre -AC_SUBST_FILE(MAKEFILE_TAIL) -MAKEFILE_TAIL=post +dnl AC_SUBST_FILE(MAKEFILE_TAIL) +dnl MAKEFILE_TAIL=post -AC_SUBST_FILE(CLIENT_TARGETS) -CLIENT_TARGETS=client +dnl AC_SUBST_FILE(CLIENT_TARGETS) +dnl CLIENT_TARGETS=client -AC_SUBST_FILE(SRCFILES) -SRCFILES=srcfiles +dnl AC_SUBST_FILE(SRCFILES) +dnl SRCFILES=srcfiles -AC_SUBST_FILE(COMP_RULES) -COMP_RULES=rules +dnl AC_SUBST_FILE(COMP_RULES) +dnl COMP_RULES=rules ########################################################## # # Output files # -AC_OUTPUT(pre post client srcfiles rules - qw_client/Makefile qw_server/Makefile uquake/Makefile Makefile) +AC_OUTPUT(qw_client/Makefile qw_server/Makefile uquake/Makefile Makefile) diff --git a/post.in b/post.in deleted file mode 100644 index 3586897..0000000 --- a/post.in +++ /dev/null @@ -1,14 +0,0 @@ -########################################################################### -# -# 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 diff --git a/pre.in b/pre.in deleted file mode 100644 index e905610..0000000 --- a/pre.in +++ /dev/null @@ -1,31 +0,0 @@ -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) - diff --git a/qw_client/Makefile.in b/qw_client/Makefile.in index a8de8a4..9420929 100644 --- a/qw_client/Makefile.in +++ b/qw_client/Makefile.in @@ -2,7 +2,38 @@ # # Quake general stuff # -@MAKEFILE_HEADER@ + +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@ @@ -13,13 +44,132 @@ BIN_PREFIX = qw-client # # Client targets # -@CLIENT_TARGETS@ + +ifneq ($(HAS_OGL),) +GLQUAKE =$(BIN_PREFIX)-gl +endif + +# FIX: Add 3dfxgl targets +ifneq ($(HAS_TDFXGL),) +TDFXQUAKE= $(BIN_PREFIX)-3dfx +endif + +ifneq ($(HAS_X11),) +X11QUAKE = $(BIN_PREFIX)-x11 +endif + +ifneq ($(HAS_VGA),) +SVGAQUAKE = $(BIN_PREFIX)-svga +endif + +RELEASE = @RELEASE@ +ifeq ($(RELEASE),yes) +OPTFLAGS = @RELEASE_CFLAGS@ +else +OPTFLAGS = -g +endif + +targets = $(SVGAQUAKE) $(GLQUAKE) $(TDFXQUAKE) $(X11QUAKE) +CLEAN_TARGETS = $(patsubst %,clean-%, $(targets)) +.PHONY: $(targets) ($CLEAN_TARGETS) + +x: Makefile + @echo binaries: $(targets) + @echo other targets: distclean + @echo all: makes all targets - $(targets) + +all: $(targets) + ######################################################################## # # Source files # -@SRCFILES@ + +# **** 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 ######################################################################## # @@ -41,6 +191,223 @@ GENERAL_SRC = $(CL_COMMON_SRC) \ # # Compilation rules # -@COMP_RULES@ -@MAKEFILE_TAIL@ +########################################################################### +# +# qw-client-x11 +# +ifneq ($(X11QUAKE),) + +# Map the list of source files into a list of object files +OBJSquake-x11 = $(patsubst %,$(BUILD_DIR)/x11/%,$(addsuffix .@OBJEXT@, $(basename $(ALL_X11_SRC) .c .s))) + +X11_CFLAGS = -DX11 $(X_CFLAGS) +X11_LDFLAGS = @X_LIBS@ -lX11 @X11_SHM_LIB@ @X_EXTRA_LIBS@ -lm + +# This can be thought of as a macro that makes sure that the x11 +# sub-directory is created +# XXX - can we avoid doing every compile? +MAKE_SURE_x11_DIR = @DIR=x11; $(MAKE_SURE_DIR) + +$(BUILD_DIR)/x11/%.o: $(SRC_DIR)/%.c + $(MAKE_SURE_x11_DIR) + $(CC) $(CFLAGS) $(X11_CFLAGS) -o $@ -c $< + +$(BUILD_DIR)/x11/%.o: $(SRC_DIR)/%.s + $(MAKE_SURE_x11_DIR) + $(CC) $(CFLAGS) -DELF -x assembler-with-cpp -o $@ -c $< + +$(BUILD_DIR)/x11/%.o: $(COMMON_DIR)/%.c + $(MAKE_SURE_x11_DIR) + $(CC) $(CFLAGS) $(X11_CFLAGS) -o $@ -c $< + +ifneq ($(QW_COMMON_DIR),) +$(BUILD_DIR)/x11/%.o: $(QW_COMMON_DIR)/%.c + $(MAKE_SURE_x11_DIR) + $(CC) $(CFLAGS) $(X11_CFLAGS) -o $@ -c $< +endif + +$(BUILD_DIR)/x11/%.o: $(COMMON_DIR)/%.s + $(MAKE_SURE_x11_DIR) + $(CC) $(CFLAGS) -DELF -x assembler-with-cpp -o $@ -c $< + +$(X11QUAKE): $(BUILD_DIR)/bin/$(X11QUAKE) + +$(BUILD_DIR)/bin/$(X11QUAKE): $(OBJSquake-x11) + $(MAKE_SURE_bin_DIR) + $(CC) $(CFLAGS) $(OBJSquake-x11) $(X11_LDFLAGS) $(LDFLAGS) -o $(BUILD_DIR)/bin/$(X11QUAKE) +# XXX - Can this be automated? +clean-$(X11QUAKE): + rm -f $(OBJSquake-x11) +endif + +########################################################################### +# +# qw-client-svga +# +ifneq ($(SVGAQUAKE),) +ALL_SVGA_SRC = $(GENERAL_SRC) $(SW_REND_SRC) $(SVGA_VID_SRC) model.c +OBJSquake-svga= $(patsubst %,$(BUILD_DIR)/svga/%,$(addsuffix .@OBJEXT@, $(basename $(ALL_SVGA_SRC) .c .s))) + +SVGA_CFLAGS = +SVGA_LDFLAGS = -lvga +SVGA_VID_SRC = vid_svgalib.c + +# This can be thought of as a macro that makes sure that the x11 +# sub-directory is created +# XXX - can we avoid doing every compile? +MAKE_SURE_svga_DIR = @DIR=svga; $(MAKE_SURE_DIR) + +# Not sure why this -O is needed, but it is... +$(BUILD_DIR)/svga/vid_svgalib.o: $(COMMON_DIR)/vid_svgalib.c + $(MAKE_SURE_svga_DIR) + $(CC) -O $(CFLAGS) $(SVGA_CFLAGS) -o $@ -c $< + +$(BUILD_DIR)/svga/%.o: $(SRC_DIR)/%.c + $(MAKE_SURE_svga_DIR) + $(CC) $(CFLAGS) $(SVGA_CFLAGS) -o $@ -c $< + +$(BUILD_DIR)/svga/%.o: $(SRC_DIR)/%.s + $(MAKE_SURE_svga_DIR) + $(CC) $(CFLAGS) -DELF -x assembler-with-cpp -o $@ -c $< + +$(BUILD_DIR)/svga/%.o: $(COMMON_DIR)/%.c + $(MAKE_SURE_svga_DIR) + $(CC) $(CFLAGS) $(SVGA_CFLAGS) -o $@ -c $< + +ifneq ($(QW_COMMON_DIR),) +$(BUILD_DIR)/svga/%.o: $(QW_COMMON_DIR)/%.c + $(MAKE_SURE_svga_DIR) + $(CC) $(CFLAGS) $(SVGA_CFLAGS) -o $@ -c $< +endif + +$(BUILD_DIR)/svga/%.o: $(COMMON_DIR)/%.s + $(MAKE_SURE_svga_DIR) + $(CC) $(CFLAGS) -DELF -x assembler-with-cpp -o $@ -c $< + +$(SVGAQUAKE): $(BUILD_DIR)/bin/$(SVGAQUAKE) + +$(BUILD_DIR)/bin/$(SVGAQUAKE): $(OBJSquake-svga) + $(MAKE_SURE_bin_DIR) + $(CC) $(CFLAGS) $(OBJSquake-svga) $(SVGA_LDFLAGS) $(LDFLAGS) -o $(BUILD_DIR)/bin/$(SVGAQUAKE) +# XXX - Can this be automated? +clean-$(SVGAQUAKE): + rm -f $(OBJSquake-svga) +endif + +########################################################################### +# +# qw-client-gl +# +ifneq ($(GLQUAKE),) +OBJSquake-gl = $(patsubst %,$(BUILD_DIR)/gl/%,$(addsuffix .@OBJEXT@, $(basename $(ALL_GL_SRC) .c .s))) + +GL_CFLAGS = -DGLQUAKE @OGL_CFLAGS@ +GL_LDFLAGS = $(X11_LDFLAGS) @OGL_LDFLAGS@ -lGL +# XXX - this is for glx +# XXX - is this platform independent? +GL_VID_SRC = gl_vidlinuxglx.c + +# This can be thought of as a macro that makes sure that the x11 +# sub-directory is created +# XXX - can we avoid doing every compile? +MAKE_SURE_gl_DIR = @DIR=gl; $(MAKE_SURE_DIR) + +$(BUILD_DIR)/gl/%.o: $(SRC_DIR)/%.c + $(MAKE_SURE_gl_DIR) + $(CC) $(CFLAGS) $(GL_CFLAGS) -o $@ -c $< + +$(BUILD_DIR)/gl/%.o: $(SRC_DIR)/%.s + $(MAKE_SURE_gl_DIR) + $(CC) $(CFLAGS) -DELF -x assembler-with-cpp -o $@ -c $< + +$(BUILD_DIR)/gl/%.o: $(COMMON_DIR)/%.c + $(MAKE_SURE_gl_DIR) + $(CC) $(CFLAGS) $(GL_CFLAGS) -o $@ -c $< + +ifneq ($(QW_COMMON_DIR),) +$(BUILD_DIR)/gl/%.o: $(QW_COMMON_DIR)/%.c + $(MAKE_SURE_gl_DIR) + $(CC) $(CFLAGS) $(GL_CFLAGS) -o $@ -c $< +endif + +$(BUILD_DIR)/gl/%.o: $(COMMON_DIR)/%.s + $(MAKE_SURE_gl_DIR) + $(CC) $(CFLAGS) -DELF -x assembler-with-cpp -o $@ -c $< + +$(GLQUAKE): $(BUILD_DIR)/bin/$(GLQUAKE) + +$(BUILD_DIR)/bin/$(GLQUAKE): $(OBJSquake-gl) + $(MAKE_SURE_bin_DIR) + $(CC) $(CFLAGS) $(OBJSquake-gl) $(GL_LDFLAGS) $(LDFLAGS) -o $(BUILD_DIR)/bin/$(GLQUAKE) + +# XXX - Can this be automated? +clean-$(GLQUAKE): + rm -f $(OBJSquake-gl) +endif + +########################################################################### +# +# qw-client-3dfx +# +ifneq ($(TDFXQUAKE),) +OBJSquake-3dfx = $(patsubst %,$(BUILD_DIR)/3dfx/%,$(addsuffix .@OBJEXT@, $(basename $(ALL_TDFX_SRC) .c .s))) + +TDFX_CFLAGS = -DGLQUAKE @OGL_CFLAGS@ @GLIDE_CFLAGS@ +TDFX_LDFLAGS = $(SVGA_LDFLAGS) @GLIDE_LDFLAGS@ @TDFXGL_LDFLAGS@ -ldl +# XXX - this is for 3dfxgl +TDFX_VID_SRC = gl_vidlinux.c + +# This can be thought of as a macro that makes sure that the x11 +# sub-directory is created +# XXX - can we avoid doing every compile? +MAKE_SURE_3dfx_DIR = @DIR=3dfx; $(MAKE_SURE_DIR) + +$(BUILD_DIR)/3dfx/%.o: $(SRC_DIR)/%.c + $(MAKE_SURE_3dfx_DIR) + $(CC) $(CFLAGS) $(TDFX_CFLAGS) -o $@ -c $< + +$(BUILD_DIR)/3dfx/%.o: $(SRC_DIR)/%.s + $(MAKE_SURE_3dfx_DIR) + $(CC) $(CFLAGS) -DELF -x assembler-with-cpp -o $@ -c $< + +$(BUILD_DIR)/3dfx/%.o: $(COMMON_DIR)/%.c + $(MAKE_SURE_3dfx_DIR) + $(CC) $(CFLAGS) $(TDFX_CFLAGS) -o $@ -c $< + +ifneq ($(QW_COMMON_DIR),) +$(BUILD_DIR)/3dfx/%.o: $(QW_COMMON_DIR)/%.c + $(MAKE_SURE_3dfx_DIR) + $(CC) $(CFLAGS) $(TDFX_CFLAGS) -o $@ -c $< +endif + +$(BUILD_DIR)/3dfx/%.o: $(COMMON_DIR)/%.s + $(MAKE_SURE_gl_DIR) + $(CC) $(CFLAGS) -DELF -x assembler-with-cpp -o $@ -c $< + +$(TDFXQUAKE): $(BUILD_DIR)/bin/$(TDFXQUAKE) + +$(BUILD_DIR)/bin/$(TDFXQUAKE): $(OBJSquake-3dfx) + $(MAKE_SURE_bin_DIR) + $(CC) $(CFLAGS) $(OBJSquake-3dfx) $(TDFX_LDFLAGS) $(LDFLAGS) -o $(BUILD_DIR)/bin/$(TDFXQUAKE) + +# XXX - Can this be automated? +clean-$(TDFXQUAKE): + rm -f $(OBJSquake-3dfx) +endif + + +########################################################################### +# +# 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 diff --git a/qw_server/Makefile.in b/qw_server/Makefile.in index 228cc9e..5d30f91 100644 --- a/qw_server/Makefile.in +++ b/qw_server/Makefile.in @@ -2,7 +2,39 @@ # # Quake general stuff # -@MAKEFILE_HEADER@ + +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@ @@ -12,7 +44,92 @@ QW_COMMON_DIR= $(PROJECT_DIR)/qw_common # # Source files # -@SRCFILES@ + +# **** 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 + ######################################################################## # @@ -81,4 +198,17 @@ clean-$(SRVQUAKE): clean: clean-$(SRVQUAKE) -@MAKEFILE_TAIL@ +########################################################################### +# +# 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 diff --git a/rules.in b/rules.in deleted file mode 100644 index a22dcbd..0000000 --- a/rules.in +++ /dev/null @@ -1,204 +0,0 @@ -########################################################################### -# -# quake-x11 -# -ifneq ($(X11QUAKE),) - -# Map the list of source files into a list of object files -OBJSquake-x11 = $(patsubst %,$(BUILD_DIR)/x11/%,$(addsuffix .@OBJEXT@, $(basename $(ALL_X11_SRC) .c .s))) - -X11_CFLAGS = -DX11 $(X_CFLAGS) -X11_LDFLAGS = @X_LIBS@ -lX11 @X11_SHM_LIB@ @X_EXTRA_LIBS@ -lm - -# This can be thought of as a macro that makes sure that the x11 -# sub-directory is created -# XXX - can we avoid doing every compile? -MAKE_SURE_x11_DIR = @DIR=x11; $(MAKE_SURE_DIR) - -$(BUILD_DIR)/x11/%.o: $(SRC_DIR)/%.c - $(MAKE_SURE_x11_DIR) - $(CC) $(CFLAGS) $(X11_CFLAGS) -o $@ -c $< - -$(BUILD_DIR)/x11/%.o: $(SRC_DIR)/%.s - $(MAKE_SURE_x11_DIR) - $(CC) $(CFLAGS) -DELF -x assembler-with-cpp -o $@ -c $< - -$(BUILD_DIR)/x11/%.o: $(COMMON_DIR)/%.c - $(MAKE_SURE_x11_DIR) - $(CC) $(CFLAGS) $(X11_CFLAGS) -o $@ -c $< - -ifneq ($(QW_COMMON_DIR),) -$(BUILD_DIR)/x11/%.o: $(QW_COMMON_DIR)/%.c - $(MAKE_SURE_x11_DIR) - $(CC) $(CFLAGS) $(X11_CFLAGS) -o $@ -c $< -endif - -$(BUILD_DIR)/x11/%.o: $(COMMON_DIR)/%.s - $(MAKE_SURE_x11_DIR) - $(CC) $(CFLAGS) -DELF -x assembler-with-cpp -o $@ -c $< - -$(X11QUAKE): $(BUILD_DIR)/bin/$(X11QUAKE) - -$(BUILD_DIR)/bin/$(X11QUAKE): $(OBJSquake-x11) - $(MAKE_SURE_bin_DIR) - $(CC) $(CFLAGS) $(OBJSquake-x11) $(X11_LDFLAGS) $(LDFLAGS) -o $(BUILD_DIR)/bin/$(X11QUAKE) -# XXX - Can this be automated? -clean-$(X11QUAKE): - rm -f $(OBJSquake-x11) -endif - -########################################################################### -# -# quake-svga -# -ifneq ($(SVGAQUAKE),) -ALL_SVGA_SRC = $(GENERAL_SRC) $(SW_REND_SRC) $(SVGA_VID_SRC) model.c -OBJSquake-svga= $(patsubst %,$(BUILD_DIR)/svga/%,$(addsuffix .@OBJEXT@, $(basename $(ALL_SVGA_SRC) .c .s))) - -SVGA_CFLAGS = -SVGA_LDFLAGS = -lvga -SVGA_VID_SRC = vid_svgalib.c - -# This can be thought of as a macro that makes sure that the x11 -# sub-directory is created -# XXX - can we avoid doing every compile? -MAKE_SURE_svga_DIR = @DIR=svga; $(MAKE_SURE_DIR) - -# Not sure why this -O is needed, but it is... -$(BUILD_DIR)/svga/vid_svgalib.o: $(COMMON_DIR)/vid_svgalib.c - $(MAKE_SURE_svga_DIR) - $(CC) -O $(CFLAGS) $(SVGA_CFLAGS) -o $@ -c $< - -$(BUILD_DIR)/svga/%.o: $(SRC_DIR)/%.c - $(MAKE_SURE_svga_DIR) - $(CC) $(CFLAGS) $(SVGA_CFLAGS) -o $@ -c $< - -$(BUILD_DIR)/svga/%.o: $(SRC_DIR)/%.s - $(MAKE_SURE_svga_DIR) - $(CC) $(CFLAGS) -DELF -x assembler-with-cpp -o $@ -c $< - -$(BUILD_DIR)/svga/%.o: $(COMMON_DIR)/%.c - $(MAKE_SURE_svga_DIR) - $(CC) $(CFLAGS) $(SVGA_CFLAGS) -o $@ -c $< - -ifneq ($(QW_COMMON_DIR),) -$(BUILD_DIR)/svga/%.o: $(QW_COMMON_DIR)/%.c - $(MAKE_SURE_svga_DIR) - $(CC) $(CFLAGS) $(SVGA_CFLAGS) -o $@ -c $< -endif - -$(BUILD_DIR)/svga/%.o: $(COMMON_DIR)/%.s - $(MAKE_SURE_svga_DIR) - $(CC) $(CFLAGS) -DELF -x assembler-with-cpp -o $@ -c $< - -$(SVGAQUAKE): $(BUILD_DIR)/bin/$(SVGAQUAKE) - -$(BUILD_DIR)/bin/$(SVGAQUAKE): $(OBJSquake-svga) - $(MAKE_SURE_bin_DIR) - $(CC) $(CFLAGS) $(OBJSquake-svga) $(SVGA_LDFLAGS) $(LDFLAGS) -o $(BUILD_DIR)/bin/$(SVGAQUAKE) -# XXX - Can this be automated? -clean-$(SVGAQUAKE): - rm -f $(OBJSquake-svga) -endif - -########################################################################### -# -# quake-gl -# -ifneq ($(GLQUAKE),) -OBJSquake-gl = $(patsubst %,$(BUILD_DIR)/gl/%,$(addsuffix .@OBJEXT@, $(basename $(ALL_GL_SRC) .c .s))) - -GL_CFLAGS = -DGLQUAKE @OGL_CFLAGS@ -GL_LDFLAGS = $(X11_LDFLAGS) @OGL_LDFLAGS@ -lGL -# XXX - this is for glx -# XXX - is this platform independent? -GL_VID_SRC = gl_vidlinuxglx.c - -# This can be thought of as a macro that makes sure that the x11 -# sub-directory is created -# XXX - can we avoid doing every compile? -MAKE_SURE_gl_DIR = @DIR=gl; $(MAKE_SURE_DIR) - -$(BUILD_DIR)/gl/%.o: $(SRC_DIR)/%.c - $(MAKE_SURE_gl_DIR) - $(CC) $(CFLAGS) $(GL_CFLAGS) -o $@ -c $< - -$(BUILD_DIR)/gl/%.o: $(SRC_DIR)/%.s - $(MAKE_SURE_gl_DIR) - $(CC) $(CFLAGS) -DELF -x assembler-with-cpp -o $@ -c $< - -$(BUILD_DIR)/gl/%.o: $(COMMON_DIR)/%.c - $(MAKE_SURE_gl_DIR) - $(CC) $(CFLAGS) $(GL_CFLAGS) -o $@ -c $< - -ifneq ($(QW_COMMON_DIR),) -$(BUILD_DIR)/gl/%.o: $(QW_COMMON_DIR)/%.c - $(MAKE_SURE_gl_DIR) - $(CC) $(CFLAGS) $(GL_CFLAGS) -o $@ -c $< -endif - -$(BUILD_DIR)/gl/%.o: $(COMMON_DIR)/%.s - $(MAKE_SURE_gl_DIR) - $(CC) $(CFLAGS) -DELF -x assembler-with-cpp -o $@ -c $< - -$(GLQUAKE): $(BUILD_DIR)/bin/$(GLQUAKE) - -$(BUILD_DIR)/bin/$(GLQUAKE): $(OBJSquake-gl) - $(MAKE_SURE_bin_DIR) - $(CC) $(CFLAGS) $(OBJSquake-gl) $(GL_LDFLAGS) $(LDFLAGS) -o $(BUILD_DIR)/bin/$(GLQUAKE) - -# XXX - Can this be automated? -clean-$(GLQUAKE): - rm -f $(OBJSquake-gl) -endif - -########################################################################### -# -# quake-3dfx -# -ifneq ($(TDFXQUAKE),) -OBJSquake-3dfx = $(patsubst %,$(BUILD_DIR)/3dfx/%,$(addsuffix .@OBJEXT@, $(basename $(ALL_TDFX_SRC) .c .s))) - -TDFX_CFLAGS = -DGLQUAKE @OGL_CFLAGS@ @GLIDE_CFLAGS@ -TDFX_LDFLAGS = $(SVGA_LDFLAGS) @GLIDE_LDFLAGS@ @TDFXGL_LDFLAGS@ -ldl -# XXX - this is for 3dfxgl -TDFX_VID_SRC = gl_vidlinux.c - -# This can be thought of as a macro that makes sure that the x11 -# sub-directory is created -# XXX - can we avoid doing every compile? -MAKE_SURE_3dfx_DIR = @DIR=3dfx; $(MAKE_SURE_DIR) - -$(BUILD_DIR)/3dfx/%.o: $(SRC_DIR)/%.c - $(MAKE_SURE_3dfx_DIR) - $(CC) $(CFLAGS) $(TDFX_CFLAGS) -o $@ -c $< - -$(BUILD_DIR)/3dfx/%.o: $(SRC_DIR)/%.s - $(MAKE_SURE_3dfx_DIR) - $(CC) $(CFLAGS) -DELF -x assembler-with-cpp -o $@ -c $< - -$(BUILD_DIR)/3dfx/%.o: $(COMMON_DIR)/%.c - $(MAKE_SURE_3dfx_DIR) - $(CC) $(CFLAGS) $(TDFX_CFLAGS) -o $@ -c $< - -ifneq ($(QW_COMMON_DIR),) -$(BUILD_DIR)/3dfx/%.o: $(QW_COMMON_DIR)/%.c - $(MAKE_SURE_3dfx_DIR) - $(CC) $(CFLAGS) $(TDFX_CFLAGS) -o $@ -c $< -endif - -$(BUILD_DIR)/3dfx/%.o: $(COMMON_DIR)/%.s - $(MAKE_SURE_gl_DIR) - $(CC) $(CFLAGS) -DELF -x assembler-with-cpp -o $@ -c $< - -$(TDFXQUAKE): $(BUILD_DIR)/bin/$(TDFXQUAKE) - -$(BUILD_DIR)/bin/$(TDFXQUAKE): $(OBJSquake-3dfx) - $(MAKE_SURE_bin_DIR) - $(CC) $(CFLAGS) $(OBJSquake-3dfx) $(TDFX_LDFLAGS) $(LDFLAGS) -o $(BUILD_DIR)/bin/$(TDFXQUAKE) - -# XXX - Can this be automated? -clean-$(TDFXQUAKE): - rm -f $(OBJSquake-3dfx) -endif - diff --git a/srcfiles.in b/srcfiles.in deleted file mode 100644 index dd57cfc..0000000 --- a/srcfiles.in +++ /dev/null @@ -1,84 +0,0 @@ -# **** 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 diff --git a/uquake/Makefile.in b/uquake/Makefile.in index 1ecc912..699b6b4 100644 --- a/uquake/Makefile.in +++ b/uquake/Makefile.in @@ -2,7 +2,38 @@ # # Quake general stuff # -@MAKEFILE_HEADER@ + +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@ @@ -13,13 +44,132 @@ BIN_PREFIX = quake # # Client targets # -@CLIENT_TARGETS@ + +ifneq ($(HAS_OGL),) +GLQUAKE =$(BIN_PREFIX)-gl +endif + +# FIX: Add 3dfxgl targets +ifneq ($(HAS_TDFXGL),) +TDFXQUAKE= $(BIN_PREFIX)-3dfx +endif + +ifneq ($(HAS_X11),) +X11QUAKE = $(BIN_PREFIX)-x11 +endif + +ifneq ($(HAS_VGA),) +SVGAQUAKE = $(BIN_PREFIX)-svga +endif + +RELEASE = @RELEASE@ +ifeq ($(RELEASE),yes) +OPTFLAGS = @RELEASE_CFLAGS@ +else +OPTFLAGS = -g +endif + +targets = $(SVGAQUAKE) $(GLQUAKE) $(TDFXQUAKE) $(X11QUAKE) +CLEAN_TARGETS = $(patsubst %,clean-%, $(targets)) +.PHONY: $(targets) ($CLEAN_TARGETS) + +x: Makefile + @echo binaries: $(targets) + @echo other targets: distclean + @echo all: makes all targets - $(targets) + +all: $(targets) ######################################################################## # # Source files # -@SRCFILES@ + +# **** 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 + ######################################################################## # @@ -42,6 +192,224 @@ GENERAL_SRC = $(CL_COMMON_SRC) \ # # Compilation rules # -@COMP_RULES@ -@MAKEFILE_TAIL@ +########################################################################### +# +# quake-x11 +# +ifneq ($(X11QUAKE),) + +# Map the list of source files into a list of object files +OBJSquake-x11 = $(patsubst %,$(BUILD_DIR)/x11/%,$(addsuffix .@OBJEXT@, $(basename $(ALL_X11_SRC) .c .s))) + +X11_CFLAGS = -DX11 $(X_CFLAGS) +X11_LDFLAGS = @X_LIBS@ -lX11 @X11_SHM_LIB@ @X_EXTRA_LIBS@ -lm + +# This can be thought of as a macro that makes sure that the x11 +# sub-directory is created +# XXX - can we avoid doing every compile? +MAKE_SURE_x11_DIR = @DIR=x11; $(MAKE_SURE_DIR) + +$(BUILD_DIR)/x11/%.o: $(SRC_DIR)/%.c + $(MAKE_SURE_x11_DIR) + $(CC) $(CFLAGS) $(X11_CFLAGS) -o $@ -c $< + +$(BUILD_DIR)/x11/%.o: $(SRC_DIR)/%.s + $(MAKE_SURE_x11_DIR) + $(CC) $(CFLAGS) -DELF -x assembler-with-cpp -o $@ -c $< + +$(BUILD_DIR)/x11/%.o: $(COMMON_DIR)/%.c + $(MAKE_SURE_x11_DIR) + $(CC) $(CFLAGS) $(X11_CFLAGS) -o $@ -c $< + +ifneq ($(QW_COMMON_DIR),) +$(BUILD_DIR)/x11/%.o: $(QW_COMMON_DIR)/%.c + $(MAKE_SURE_x11_DIR) + $(CC) $(CFLAGS) $(X11_CFLAGS) -o $@ -c $< +endif + +$(BUILD_DIR)/x11/%.o: $(COMMON_DIR)/%.s + $(MAKE_SURE_x11_DIR) + $(CC) $(CFLAGS) -DELF -x assembler-with-cpp -o $@ -c $< + +$(X11QUAKE): $(BUILD_DIR)/bin/$(X11QUAKE) + +$(BUILD_DIR)/bin/$(X11QUAKE): $(OBJSquake-x11) + $(MAKE_SURE_bin_DIR) + $(CC) $(CFLAGS) $(OBJSquake-x11) $(X11_LDFLAGS) $(LDFLAGS) -o $(BUILD_DIR)/bin/$(X11QUAKE) +# XXX - Can this be automated? +clean-$(X11QUAKE): + rm -f $(OBJSquake-x11) +endif + +########################################################################### +# +# quake-svga +# +ifneq ($(SVGAQUAKE),) +ALL_SVGA_SRC = $(GENERAL_SRC) $(SW_REND_SRC) $(SVGA_VID_SRC) model.c +OBJSquake-svga= $(patsubst %,$(BUILD_DIR)/svga/%,$(addsuffix .@OBJEXT@, $(basename $(ALL_SVGA_SRC) .c .s))) + +SVGA_CFLAGS = +SVGA_LDFLAGS = -lvga +SVGA_VID_SRC = vid_svgalib.c + +# This can be thought of as a macro that makes sure that the x11 +# sub-directory is created +# XXX - can we avoid doing every compile? +MAKE_SURE_svga_DIR = @DIR=svga; $(MAKE_SURE_DIR) + +# Not sure why this -O is needed, but it is... +$(BUILD_DIR)/svga/vid_svgalib.o: $(COMMON_DIR)/vid_svgalib.c + $(MAKE_SURE_svga_DIR) + $(CC) -O $(CFLAGS) $(SVGA_CFLAGS) -o $@ -c $< + +$(BUILD_DIR)/svga/%.o: $(SRC_DIR)/%.c + $(MAKE_SURE_svga_DIR) + $(CC) $(CFLAGS) $(SVGA_CFLAGS) -o $@ -c $< + +$(BUILD_DIR)/svga/%.o: $(SRC_DIR)/%.s + $(MAKE_SURE_svga_DIR) + $(CC) $(CFLAGS) -DELF -x assembler-with-cpp -o $@ -c $< + +$(BUILD_DIR)/svga/%.o: $(COMMON_DIR)/%.c + $(MAKE_SURE_svga_DIR) + $(CC) $(CFLAGS) $(SVGA_CFLAGS) -o $@ -c $< + +ifneq ($(QW_COMMON_DIR),) +$(BUILD_DIR)/svga/%.o: $(QW_COMMON_DIR)/%.c + $(MAKE_SURE_svga_DIR) + $(CC) $(CFLAGS) $(SVGA_CFLAGS) -o $@ -c $< +endif + +$(BUILD_DIR)/svga/%.o: $(COMMON_DIR)/%.s + $(MAKE_SURE_svga_DIR) + $(CC) $(CFLAGS) -DELF -x assembler-with-cpp -o $@ -c $< + +$(SVGAQUAKE): $(BUILD_DIR)/bin/$(SVGAQUAKE) + +$(BUILD_DIR)/bin/$(SVGAQUAKE): $(OBJSquake-svga) + $(MAKE_SURE_bin_DIR) + $(CC) $(CFLAGS) $(OBJSquake-svga) $(SVGA_LDFLAGS) $(LDFLAGS) -o $(BUILD_DIR)/bin/$(SVGAQUAKE) +# XXX - Can this be automated? +clean-$(SVGAQUAKE): + rm -f $(OBJSquake-svga) +endif + +########################################################################### +# +# quake-gl +# +ifneq ($(GLQUAKE),) +OBJSquake-gl = $(patsubst %,$(BUILD_DIR)/gl/%,$(addsuffix .@OBJEXT@, $(basename $(ALL_GL_SRC) .c .s))) + +GL_CFLAGS = -DGLQUAKE @OGL_CFLAGS@ +GL_LDFLAGS = $(X11_LDFLAGS) @OGL_LDFLAGS@ -lGL +# XXX - this is for glx +# XXX - is this platform independent? +GL_VID_SRC = gl_vidlinuxglx.c + +# This can be thought of as a macro that makes sure that the x11 +# sub-directory is created +# XXX - can we avoid doing every compile? +MAKE_SURE_gl_DIR = @DIR=gl; $(MAKE_SURE_DIR) + +$(BUILD_DIR)/gl/%.o: $(SRC_DIR)/%.c + $(MAKE_SURE_gl_DIR) + $(CC) $(CFLAGS) $(GL_CFLAGS) -o $@ -c $< + +$(BUILD_DIR)/gl/%.o: $(SRC_DIR)/%.s + $(MAKE_SURE_gl_DIR) + $(CC) $(CFLAGS) -DELF -x assembler-with-cpp -o $@ -c $< + +$(BUILD_DIR)/gl/%.o: $(COMMON_DIR)/%.c + $(MAKE_SURE_gl_DIR) + $(CC) $(CFLAGS) $(GL_CFLAGS) -o $@ -c $< + +ifneq ($(QW_COMMON_DIR),) +$(BUILD_DIR)/gl/%.o: $(QW_COMMON_DIR)/%.c + $(MAKE_SURE_gl_DIR) + $(CC) $(CFLAGS) $(GL_CFLAGS) -o $@ -c $< +endif + +$(BUILD_DIR)/gl/%.o: $(COMMON_DIR)/%.s + $(MAKE_SURE_gl_DIR) + $(CC) $(CFLAGS) -DELF -x assembler-with-cpp -o $@ -c $< + +$(GLQUAKE): $(BUILD_DIR)/bin/$(GLQUAKE) + +$(BUILD_DIR)/bin/$(GLQUAKE): $(OBJSquake-gl) + $(MAKE_SURE_bin_DIR) + $(CC) $(CFLAGS) $(OBJSquake-gl) $(GL_LDFLAGS) $(LDFLAGS) -o $(BUILD_DIR)/bin/$(GLQUAKE) + +# XXX - Can this be automated? +clean-$(GLQUAKE): + rm -f $(OBJSquake-gl) +endif + +########################################################################### +# +# quake-3dfx +# +ifneq ($(TDFXQUAKE),) +OBJSquake-3dfx = $(patsubst %,$(BUILD_DIR)/3dfx/%,$(addsuffix .@OBJEXT@, $(basename $(ALL_TDFX_SRC) .c .s))) + +TDFX_CFLAGS = -DGLQUAKE @OGL_CFLAGS@ @GLIDE_CFLAGS@ +TDFX_LDFLAGS = $(SVGA_LDFLAGS) @GLIDE_LDFLAGS@ @TDFXGL_LDFLAGS@ -ldl +# XXX - this is for 3dfxgl +TDFX_VID_SRC = gl_vidlinux.c + +# This can be thought of as a macro that makes sure that the x11 +# sub-directory is created +# XXX - can we avoid doing every compile? +MAKE_SURE_3dfx_DIR = @DIR=3dfx; $(MAKE_SURE_DIR) + +$(BUILD_DIR)/3dfx/%.o: $(SRC_DIR)/%.c + $(MAKE_SURE_3dfx_DIR) + $(CC) $(CFLAGS) $(TDFX_CFLAGS) -o $@ -c $< + +$(BUILD_DIR)/3dfx/%.o: $(SRC_DIR)/%.s + $(MAKE_SURE_3dfx_DIR) + $(CC) $(CFLAGS) -DELF -x assembler-with-cpp -o $@ -c $< + +$(BUILD_DIR)/3dfx/%.o: $(COMMON_DIR)/%.c + $(MAKE_SURE_3dfx_DIR) + $(CC) $(CFLAGS) $(TDFX_CFLAGS) -o $@ -c $< + +ifneq ($(QW_COMMON_DIR),) +$(BUILD_DIR)/3dfx/%.o: $(QW_COMMON_DIR)/%.c + $(MAKE_SURE_3dfx_DIR) + $(CC) $(CFLAGS) $(TDFX_CFLAGS) -o $@ -c $< +endif + +$(BUILD_DIR)/3dfx/%.o: $(COMMON_DIR)/%.s + $(MAKE_SURE_gl_DIR) + $(CC) $(CFLAGS) -DELF -x assembler-with-cpp -o $@ -c $< + +$(TDFXQUAKE): $(BUILD_DIR)/bin/$(TDFXQUAKE) + +$(BUILD_DIR)/bin/$(TDFXQUAKE): $(OBJSquake-3dfx) + $(MAKE_SURE_bin_DIR) + $(CC) $(CFLAGS) $(OBJSquake-3dfx) $(TDFX_LDFLAGS) $(LDFLAGS) -o $(BUILD_DIR)/bin/$(TDFXQUAKE) + +# XXX - Can this be automated? +clean-$(TDFXQUAKE): + rm -f $(OBJSquake-3dfx) +endif + + +########################################################################### +# +# 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 +