aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authortma <tma@edf5b092-35ff-0310-97b2-ce42778d08ea>2008-03-17 16:47:40 +0000
committertma <tma@edf5b092-35ff-0310-97b2-ce42778d08ea>2008-03-17 16:47:40 +0000
commit41b0dc5ec81034cf85a2fb590830f6d13ca405e1 (patch)
tree0a641084bf4b37a5955eb9d65752be7e7a4f4b15 /Makefile
parent9a267a3b499514f5802b12faf6e44dfd1039897d (diff)
downloadioquake3-aero-41b0dc5ec81034cf85a2fb590830f6d13ca405e1.tar.gz
ioquake3-aero-41b0dc5ec81034cf85a2fb590830f6d13ca405e1.zip
* Compile bg_* files separately for each game module, as originally intended
git-svn-id: svn://svn.icculus.org/quake3/trunk@1272 edf5b092-35ff-0310-97b2-ce42778d08ea
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile138
1 files changed, 114 insertions, 24 deletions
diff --git a/Makefile b/Makefile
index cf38cd0..0240703 100644
--- a/Makefile
+++ b/Makefile
@@ -800,12 +800,48 @@ $(Q)$(CC) $(CFLAGS) $(SHLIBCFLAGS) -o $@ -c $<
$(Q)$(DO_QVM_DEP)
endef
+define DO_GAME_CC
+$(echo_cmd) "GAME_CC $<"
+$(Q)$(CC) -DQAGAME $(CFLAGS) $(SHLIBCFLAGS) -o $@ -c $<
+$(Q)$(DO_QVM_DEP)
+endef
+
+define DO_CGAME_CC
+$(echo_cmd) "CGAME_CC $<"
+$(Q)$(CC) -DCGAME $(CFLAGS) $(SHLIBCFLAGS) -o $@ -c $<
+$(Q)$(DO_QVM_DEP)
+endef
+
+define DO_UI_CC
+$(echo_cmd) "UI_CC $<"
+$(Q)$(CC) -DUI $(CFLAGS) $(SHLIBCFLAGS) -o $@ -c $<
+$(Q)$(DO_QVM_DEP)
+endef
+
define DO_SHLIB_CC_MISSIONPACK
$(echo_cmd) "SHLIB_CC_MISSIONPACK $<"
$(Q)$(CC) -DMISSIONPACK $(CFLAGS) $(SHLIBCFLAGS) -o $@ -c $<
$(Q)$(DO_QVM_DEP)
endef
+define DO_GAME_CC_MISSIONPACK
+$(echo_cmd) "GAME_CC_MISSIONPACK $<"
+$(Q)$(CC) -DMISSIONPACK -DQAGAME $(CFLAGS) $(SHLIBCFLAGS) -o $@ -c $<
+$(Q)$(DO_QVM_DEP)
+endef
+
+define DO_CGAME_CC_MISSIONPACK
+$(echo_cmd) "CGAME_CC_MISSIONPACK $<"
+$(Q)$(CC) -DMISSIONPACK -DCGAME $(CFLAGS) $(SHLIBCFLAGS) -o $@ -c $<
+$(Q)$(DO_QVM_DEP)
+endef
+
+define DO_UI_CC_MISSIONPACK
+$(echo_cmd) "UI_CC_MISSIONPACK $<"
+$(Q)$(CC) -DMISSIONPACK -DUI $(CFLAGS) $(SHLIBCFLAGS) -o $@ -c $<
+$(Q)$(DO_QVM_DEP)
+endef
+
define DO_AS
$(echo_cmd) "AS $<"
$(Q)$(CC) $(CFLAGS) -x assembler-with-cpp -o $@ -c $<
@@ -1016,11 +1052,41 @@ $(echo_cmd) "Q3LCC $<"
$(Q)$(Q3LCC) -o $@ $<
endef
+define DO_CGAME_Q3LCC
+$(echo_cmd) "CGAME_Q3LCC $<"
+$(Q)$(Q3LCC) -DCGAME -o $@ $<
+endef
+
+define DO_GAME_Q3LCC
+$(echo_cmd) "GAME_Q3LCC $<"
+$(Q)$(Q3LCC) -DQAGAME -o $@ $<
+endef
+
+define DO_UI_Q3LCC
+$(echo_cmd) "UI_Q3LCC $<"
+$(Q)$(Q3LCC) -DUI -o $@ $<
+endef
+
define DO_Q3LCC_MISSIONPACK
$(echo_cmd) "Q3LCC_MISSIONPACK $<"
$(Q)$(Q3LCC) -DMISSIONPACK -o $@ $<
endef
+define DO_CGAME_Q3LCC_MISSIONPACK
+$(echo_cmd) "CGAME_Q3LCC_MISSIONPACK $<"
+$(Q)$(Q3LCC) -DMISSIONPACK -DCGAME -o $@ $<
+endef
+
+define DO_GAME_Q3LCC_MISSIONPACK
+$(echo_cmd) "GAME_Q3LCC_MISSIONPACK $<"
+$(Q)$(Q3LCC) -DMISSIONPACK -DQAGAME -o $@ $<
+endef
+
+define DO_UI_Q3LCC_MISSIONPACK
+$(echo_cmd) "UI_Q3LCC_MISSIONPACK $<"
+$(Q)$(Q3LCC) -DMISSIONPACK -DUI -o $@ $<
+endef
+
Q3ASMOBJ = \
$(B)/tools/asm/q3asm.o \
@@ -1393,10 +1459,10 @@ $(B)/ioq3ded.$(ARCH)$(BINEXT): $(Q3DOBJ)
Q3CGOBJ_ = \
$(B)/baseq3/cgame/cg_main.o \
- $(B)/baseq3/game/bg_misc.o \
- $(B)/baseq3/game/bg_pmove.o \
- $(B)/baseq3/game/bg_slidemove.o \
- $(B)/baseq3/game/bg_lib.o \
+ $(B)/baseq3/cgame/bg_misc.o \
+ $(B)/baseq3/cgame/bg_pmove.o \
+ $(B)/baseq3/cgame/bg_slidemove.o \
+ $(B)/baseq3/cgame/bg_lib.o \
$(B)/baseq3/cgame/cg_consolecmds.o \
$(B)/baseq3/cgame/cg_draw.o \
$(B)/baseq3/cgame/cg_drawtools.o \
@@ -1435,10 +1501,10 @@ $(B)/baseq3/vm/cgame.qvm: $(Q3CGVMOBJ) $(CGDIR)/cg_syscalls.asm $(Q3ASM)
MPCGOBJ_ = \
$(B)/missionpack/cgame/cg_main.o \
- $(B)/missionpack/game/bg_misc.o \
- $(B)/missionpack/game/bg_pmove.o \
- $(B)/missionpack/game/bg_slidemove.o \
- $(B)/missionpack/game/bg_lib.o \
+ $(B)/missionpack/cgame/bg_misc.o \
+ $(B)/missionpack/cgame/bg_pmove.o \
+ $(B)/missionpack/cgame/bg_slidemove.o \
+ $(B)/missionpack/cgame/bg_lib.o \
$(B)/missionpack/cgame/cg_consolecmds.o \
$(B)/missionpack/cgame/cg_newdraw.o \
$(B)/missionpack/cgame/cg_draw.o \
@@ -1585,8 +1651,8 @@ $(B)/missionpack/vm/qagame.qvm: $(MPGVMOBJ) $(GDIR)/g_syscalls.asm $(Q3ASM)
Q3UIOBJ_ = \
$(B)/baseq3/ui/ui_main.o \
- $(B)/baseq3/game/bg_misc.o \
- $(B)/baseq3/game/bg_lib.o \
+ $(B)/baseq3/ui/bg_misc.o \
+ $(B)/baseq3/ui/bg_lib.o \
$(B)/baseq3/ui/ui_addbots.o \
$(B)/baseq3/ui/ui_atoms.o \
$(B)/baseq3/ui/ui_cdkey.o \
@@ -1651,8 +1717,8 @@ MPUIOBJ_ = \
$(B)/missionpack/ui/ui_players.o \
$(B)/missionpack/ui/ui_shared.o \
\
- $(B)/missionpack/game/bg_misc.o \
- $(B)/missionpack/game/bg_lib.o \
+ $(B)/missionpack/ui/bg_misc.o \
+ $(B)/missionpack/ui/bg_lib.o \
\
$(B)/missionpack/qcommon/q_math.o \
$(B)/missionpack/qcommon/q_shared.o
@@ -1741,43 +1807,67 @@ endif
## GAME MODULE RULES
#############################################################################
+$(B)/baseq3/cgame/bg_%.o: $(GDIR)/bg_%.c
+ $(DO_CGAME_CC)
+
$(B)/baseq3/cgame/%.o: $(CGDIR)/%.c
- $(DO_SHLIB_CC)
+ $(DO_CGAME_CC)
+
+$(B)/baseq3/cgame/bg_%.asm: $(GDIR)/bg_%.c $(Q3LCC)
+ $(DO_CGAME_Q3LCC)
$(B)/baseq3/cgame/%.asm: $(CGDIR)/%.c $(Q3LCC)
- $(DO_Q3LCC)
+ $(DO_CGAME_Q3LCC)
+
+$(B)/missionpack/cgame/bg_%.o: $(GDIR)/bg_%.c
+ $(DO_CGAME_CC_MISSIONPACK)
$(B)/missionpack/cgame/%.o: $(CGDIR)/%.c
- $(DO_SHLIB_CC_MISSIONPACK)
+ $(DO_CGAME_CC_MISSIONPACK)
+
+$(B)/missionpack/cgame/bg_%.asm: $(GDIR)/bg_%.c $(Q3LCC)
+ $(DO_CGAME_Q3LCC_MISSIONPACK)
$(B)/missionpack/cgame/%.asm: $(CGDIR)/%.c $(Q3LCC)
- $(DO_Q3LCC_MISSIONPACK)
+ $(DO_CGAME_Q3LCC_MISSIONPACK)
$(B)/baseq3/game/%.o: $(GDIR)/%.c
- $(DO_SHLIB_CC)
+ $(DO_GAME_CC)
$(B)/baseq3/game/%.asm: $(GDIR)/%.c $(Q3LCC)
- $(DO_Q3LCC)
+ $(DO_GAME_Q3LCC)
$(B)/missionpack/game/%.o: $(GDIR)/%.c
- $(DO_SHLIB_CC_MISSIONPACK)
+ $(DO_GAME_CC_MISSIONPACK)
$(B)/missionpack/game/%.asm: $(GDIR)/%.c $(Q3LCC)
- $(DO_Q3LCC_MISSIONPACK)
+ $(DO_GAME_Q3LCC_MISSIONPACK)
+
+$(B)/baseq3/ui/bg_%.o: $(GDIR)/bg_%.c
+ $(DO_UI_CC)
$(B)/baseq3/ui/%.o: $(Q3UIDIR)/%.c
- $(DO_SHLIB_CC)
+ $(DO_UI_CC)
+
+$(B)/baseq3/ui/bg_%.asm: $(GDIR)/bg_%.c $(Q3LCC)
+ $(DO_UI_Q3LCC)
$(B)/baseq3/ui/%.asm: $(Q3UIDIR)/%.c $(Q3LCC)
- $(DO_Q3LCC)
+ $(DO_UI_Q3LCC)
+
+$(B)/missionpack/ui/bg_%.o: $(GDIR)/bg_%.c
+ $(DO_UI_CC_MISSIONPACK)
$(B)/missionpack/ui/%.o: $(UIDIR)/%.c
- $(DO_SHLIB_CC_MISSIONPACK)
+ $(DO_UI_CC_MISSIONPACK)
+
+$(B)/missionpack/ui/bg_%.asm: $(GDIR)/bg_%.c $(Q3LCC)
+ $(DO_UI_Q3LCC_MISSIONPACK)
$(B)/missionpack/ui/%.asm: $(UIDIR)/%.c $(Q3LCC)
- $(DO_Q3LCC_MISSIONPACK)
+ $(DO_UI_Q3LCC_MISSIONPACK)
$(B)/baseq3/qcommon/%.o: $(CMDIR)/%.c