Makefile 1.46 KB
Newer Older
dylan grafmyre's avatar
dylan grafmyre committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#

PYTHON_BIN?=./env/scripts/python
GARYSMOD_DIR?=D:\\Steam\\steamapps\\common\\GarrysMod\\
VBIN_DIR?=$(GARYSMOD_DIR)bin\\
MOD_DIR?=$(GARYSMOD_DIR)garrysmod\\
VBIN_FLAGS?=-game $(MOD_DIR)

BSP_BIN?=$(VBIN_DIR)vbsp.exe
BSP_FLAGS?=$(VBIN_FLAGS)
VIS_BIN?=$(VBIN_DIR)vvis.exe
VIS_FLAGS?=$(VBIN_FLAGS) -fast
RAD_BIN?=$(VBIN_DIR)vrad.exe
RAD_FLAGS?=$(VBIN_FLAGS) -StaticPropLighting -bounce 2 -noextra
# -StaticPropSampleScale 0.25 
BSPZIP_BIN?=$(VBIN_DIR)bspzip.exe
BSPZIP_FLAGS?=

%.bsp: %.vmf
	$(BSP_BIN) $(BSP_FLAGS) $(basename $^)  # writes bsp
	$(VIS_BIN) $(VIS_FLAGS) $(basename $^)  # depends on .prt, r/w bsp
	$(RAD_BIN) $(RAD_FLAGS) $(basename $^)  # reads lights.rad, r/w bsp
	cp $@ $(MOD_DIR)maps\\$(notdir $@)

%.prt: %.bsp
	@test -f $@ || rm -f $(basename $@).bsp
	@test -f $@ || $(MAKE) $(AM_MAKEFLAGS) $(basename $@).bsp
%.log: %.bsp
	@test -f $@ || rm -f $(basename $@).bsp
	@test -f $@ || $(MAKE) $(AM_MAKEFLAGS) $(basename $@).bsp

%_p.bsp: %.bsp
	$(BSPZIP_BIN) $(BSPZIP_FLAGS) -addlist $^ $(basename $^).bspzip-addlist $@

dylan grafmyre's avatar
snap    
dylan grafmyre committed
35
36
ttt_terrorcon_v2.bsp:

dylan grafmyre's avatar
dylan grafmyre committed
37
38
39
40
41
42
43
game: install ttt_terrorcon_v2_p.bsp
	$(GARYSMOD_DIR)hl2.exe -allowdebug $(VBIN_FLAGS) +map $(notdir $(basename $(word 2,$^))) +gamemode terrortown +ttt_debug_preventwin 1 +ttt_preptime_seconds 10 +ttt_minimum_players 1

install: ttt_terrorcon_v2_p.bsp
	cp -v $^ $(MOD_DIR)maps\\

%.lint: %.bspzip-addlist
44
	$(PYTHON_BIN) ./contrib/bspzip-lint $^ 2> $@
dylan grafmyre's avatar
dylan grafmyre committed
45
46
47
48
49

.PHONY: lint

lint: ttt_terrorcon_v2.lint
	$(PYTHON_BIN) ./contrib/vmt-lint 2> $@