2003-10-24 21:43:32 +00:00
|
|
|
###############################################
|
|
|
|
|
|
|
|
GAME=qw
|
|
|
|
DEBUG=0
|
|
|
|
|
|
|
|
###############################################
|
|
|
|
|
|
|
|
CPP=cpp
|
2003-10-25 06:05:14 +00:00
|
|
|
CPPFLAGS=-I. -Iweapons -Imdl -Iact -Imapents
|
2003-10-24 21:43:32 +00:00
|
|
|
|
|
|
|
QFCC=qfcc
|
|
|
|
QFCCFLAGS=-q --warn all --code v6only $(CPPFLAGS)
|
|
|
|
|
|
|
|
###############################################
|
|
|
|
|
|
|
|
QW_SOURCES= $(prefix qw/, \
|
|
|
|
system.qc builtins.qc sz_watch.qc effect.qc \
|
|
|
|
)
|
|
|
|
|
|
|
|
WEAPONS_SOURCES=weapon.qc weapon_g.qc \
|
|
|
|
w_void.qc w_axe.qc w_shotgun.qc w_nailgun.qc \
|
|
|
|
w_grenade_launcher.qc w_rocket_launcher.qc w_lightning_gun.qc
|
|
|
|
|
|
|
|
ACT_SOURCES= act.qc act_player.qc act_dead.qc
|
|
|
|
|
|
|
|
MDL_SOURCES= mdl.qc mdl_void.qc mdl_player.qc mdl_eyes.qc
|
|
|
|
|
|
|
|
MAPENTS_SOURCES=mapents_util.qc \
|
|
|
|
\
|
|
|
|
mapents.qc items.qc \
|
|
|
|
mapents_triggers.qc mapents_movewall.qc mapents_traps.qc \
|
|
|
|
id_compat.qc mapents_items.qc mapents_powerup.qc
|
|
|
|
|
|
|
|
COMMON_SOURCES=system.qc \
|
|
|
|
\
|
2003-10-25 06:05:14 +00:00
|
|
|
equipid.qc \
|
2003-10-24 21:43:32 +00:00
|
|
|
server.qc worldspawn.qc \
|
|
|
|
client.qc spectate.qc \
|
|
|
|
math.qc \
|
|
|
|
misc.qc \
|
|
|
|
teleport.qc delays.qc \
|
|
|
|
bodyque.qc damage.qc \
|
|
|
|
menu.qc menus.qc \
|
|
|
|
override.qc \
|
|
|
|
\
|
2003-10-25 06:05:14 +00:00
|
|
|
$(addprefix weapons/, $(WEAPONS_SOURCES)) \
|
|
|
|
$(addprefix act/, $(ACT_SOURCES)) \
|
|
|
|
$(addprefix mdl/, $(MDL_SOURCES)) \
|
|
|
|
$(addprefix mapents/, $(MAPENTS_SOURCES))
|
2003-10-24 21:43:32 +00:00
|
|
|
|
|
|
|
DEBUG_SOURCES= debug.qc entnum.qc
|
|
|
|
|
|
|
|
ifeq ($(GAME),qw)
|
|
|
|
PROGS=../qwprogs.dat
|
2003-10-25 06:05:14 +00:00
|
|
|
CPPFLAGS+=-I qw
|
2003-10-24 21:43:32 +00:00
|
|
|
SOURCES=$(QW_SOURCES) $(COMMON_SOURCES)
|
|
|
|
else
|
|
|
|
PROGS=../progs.dat
|
2003-10-25 06:05:14 +00:00
|
|
|
CPPFLAGS+=-I nq
|
2003-10-24 21:43:32 +00:00
|
|
|
SOURCES=$(NQ_SOURCES) $(COMMON_SOURCES)
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(DEBUG),1)
|
|
|
|
CPPFLAGS+=-DDEBUG=1
|
|
|
|
SOURCES+=$(DEBUG_SOURCES)
|
|
|
|
endif
|
|
|
|
|
2003-10-27 21:13:53 +00:00
|
|
|
OBJECTS=$(addsuffix .o,$(basename $(SOURCES)))
|
|
|
|
DEPENDS=$(addprefix .deps/,$(addsuffix .d,$(basename $(SOURCES))))
|
2003-10-24 21:43:32 +00:00
|
|
|
|
2003-10-25 06:05:14 +00:00
|
|
|
GENERATED_SOURCES = equipid.qh equipid.qc weapons/weapon_g.qc
|
2003-10-24 21:43:32 +00:00
|
|
|
|
|
|
|
all: $(PROGS)
|
|
|
|
|
|
|
|
##########################
|
|
|
|
|
|
|
|
$(PROGS): $(OBJECTS)
|
|
|
|
$(QFCC) $(QFCCFLAGS) -o $@ $^
|
|
|
|
|
2003-10-27 21:13:53 +00:00
|
|
|
WEAPON_G_SOURCES=$(filter weapons/w_%.qc,$(SOURCES))
|
2003-10-25 06:05:14 +00:00
|
|
|
weapons/weapon_g.qc: weapons/weapon_gen.sh $(WEAPON_G_SOURCES)
|
|
|
|
bash weapons/weapon_gen.sh $(WEAPON_G_SOURCES) > $@
|
2003-10-24 21:43:32 +00:00
|
|
|
|
|
|
|
EQUIPID_SOURCES=$(filter-out $(GENERATED_SOURCES),$(SOURCES))
|
|
|
|
equipid.qh equipid.qc: equipid_gen.pl Makefile $(EQUIPID_SOURCES)
|
|
|
|
cat $(EQUIPID_SOURCES) | perl equipid_gen.pl > equipid.qh
|
|
|
|
|
|
|
|
clean:
|
|
|
|
rm -f $(OBJECTS) $(GENERATED_SOURCES)
|
2003-10-27 21:13:53 +00:00
|
|
|
rm -rf .deps
|
2003-10-24 21:43:32 +00:00
|
|
|
|
|
|
|
#########################
|
|
|
|
|
2003-10-27 21:13:53 +00:00
|
|
|
|
|
|
|
%.o: %.r
|
|
|
|
@mkdir -p .deps
|
|
|
|
@$(QFCC) -M -q $(QFCCFLAGS) -c $< | sed -e 's/\(\.r\)\?\.o\>/.o/' > .deps/`basename $@ .o`.d
|
|
|
|
$(QFCC) $(QFCCFLAGS) -c -o $@ $<
|
|
|
|
|
|
|
|
%.o: %.qc
|
|
|
|
@mkdir -p .deps
|
|
|
|
@$(QFCC) -M -q $(QFCCFLAGS) -c $< | sed -e 's/\(\.qc\)\?\.o\>/.o/' > .deps/`basename $@ .o`.d
|
|
|
|
$(QFCC) $(QCFLAGS) $(QFCCFLAGS) -c -o $@ $<
|
|
|
|
|
2003-10-24 21:43:32 +00:00
|
|
|
|
|
|
|
#########################
|
|
|
|
|
|
|
|
unused:
|
|
|
|
@echo $(filter-out $(SOURCES),$(wildcard *.qc))
|
|
|
|
|
|
|
|
#########################
|
|
|
|
|
|
|
|
.PHONY: unused
|
|
|
|
|
|
|
|
#########################
|
|
|
|
|
|
|
|
#progs.src: Makefile
|
|
|
|
# echo $(PROGS) > $@
|
|
|
|
# for i in $(SOURCES); do echo "$$i" >> $@; done
|
|
|
|
#
|
|
|
|
#$(PROGS): progs.src $(SOURCES)
|
|
|
|
# $(QFCC) $(QFCCFLAGS)
|
|
|
|
|
|
|
|
|
2003-10-27 21:13:53 +00:00
|
|
|
-include $(DEPENDS)
|